:root {
  --bg: #ffffff;
  --ink: #171717;
  --muted: #636363;
  --line: #d9d9d5;
  --accent: #c45a3c;
  --accent-soft: rgba(196, 90, 60, 0.08);
  --name-color: #e2e0dc;
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  border-radius: 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 8px;
}

.page {
  width: 100%;
  height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 4px 6px 10px;
  overflow: hidden;
}

.nameplate {
  width: 100%;
  height: clamp(180px, 34vh, 420px);
  min-height: 0;
  overflow: visible;
  animation: name-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.nameplate h1 {
  width: 100%;
  height: 100%;
  display: block;
  font-size: 0;
  line-height: 1;
}

.wordmark {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wordmark text {
  fill: var(--name-color);
  font-family: var(--font-display);
  font-size: 220px;
  font-weight: 400;
  letter-spacing: -2px;
}

.content {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  animation: content-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

/* A long-dash frame keeps the page structured without the feel of a default card. */
.content::before {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, var(--line) 0 13px, transparent 13px 21px) top / 100% 1px no-repeat,
    repeating-linear-gradient(to right, var(--line) 0 13px, transparent 13px 21px) bottom / 100% 1px no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 13px, transparent 13px 21px) left / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 13px, transparent 13px 21px) right / 1px 100% no-repeat;
}

.left-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.left-panel::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 0;
  bottom: 20px;
  width: 1px;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--line) 0 8px, transparent 8px 16px);
}

.intro-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 0;
}

.about-section,
.contact-section {
  position: relative;
  min-width: 0;
  padding: 18px 26px;
}

.contact-section::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: 20px;
  bottom: 20px;
  left: 0;
  width: 1px;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--line) 0 8px, transparent 8px 16px);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.section-label {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.section-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.about-section p {
  max-width: 300px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.email {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 12px;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: #9d9d9d;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

.email:hover {
  text-decoration-color: var(--accent);
}

.contact-x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  transition: opacity 0.2s ease;
}

.contact-x:hover {
  opacity: 0.5;
}

.social-section {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 26px 20px;
  overflow: hidden;
}

.social-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 1px;
  pointer-events: none;
  background: repeating-linear-gradient(to right, var(--line) 0 13px, transparent 13px 21px);
}

.right-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 25px 26px;
}

.featured-project {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  transition: opacity 0.2s ease;
}

.featured-project:hover {
  opacity: 0.85;
}

.featured-project:hover .featured-project-icon {
  opacity: 1;
}

.featured-project-icon {
  display: block;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
}

.featured-project-body {
  min-width: 0;
  flex: 1;
}

.featured-project-body strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.featured-project:hover strong {
  color: var(--accent);
}

.featured-project-body p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.more-projects {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.social-feed {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 10px;
  overflow: visible;
}

.x-embed-row {
  min-height: 0;
}

.embed-loading {
  color: var(--muted);
  font-size: 12px;
  padding: 12px 0;
}

.x-embed-row iframe {
  border: none !important;
}

/* Social grid & cell styles — hidden for now, re-enable when YouTube/GitHub are ready */
/*
.social-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  border-top: 1px dashed var(--line);
}
*/

@keyframes name-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) and (min-width: 601px) {
  .nameplate {
    height: clamp(170px, 30vh, 270px);
  }

  .about-section,
  .contact-section,
  .social-section,
  .right-panel {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-height: 620px) and (min-width: 601px) {
  .page {
    gap: 8px;
    padding-top: 4px;
  }

  .nameplate {
    height: 145px;
  }

  .about-section,
  .contact-section,
  .social-section,
  .right-panel {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .intro-row {
    min-height: 0;
  }

  .featured-project {
    margin-top: 14px;
  }
}

@media (max-width: 600px) {
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page {
    height: auto;
    min-height: 100svh;
    display: block;
    padding: 12px 16px 24px;
    overflow: visible;
  }

  .nameplate {
    height: clamp(118px, 31vw, 170px);
    margin-bottom: 18px;
  }

  .wordmark text {
    font-size: 220px;
  }

  .content {
    height: auto;
    display: block;
    overflow: hidden;
  }

  .left-panel {
    display: block;
  }

  .left-panel::after {
    display: none;
  }

  .intro-row {
    min-height: 0;
  }

  .about-section,
  .contact-section,
  .social-section,
  .right-panel {
    padding: 22px 18px;
  }

  .contact-section::before {
    display: none;
  }

  .about-section p {
    max-width: 26ch;
    font-size: 14px;
  }

  .social-section {
    min-height: 0;
    overflow: visible;
  }

  .right-panel {
    padding-top: 18px;
  }

  .social-feed {
    margin-top: 14px;
    overflow: visible;
  }

  .featured-project {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nameplate,
  .content {
    animation: none;
    opacity: 1;
  }
}
