/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Site header / nav                                                       */
/* ---------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(21, 23, 28, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-3);
}
.site-header__row {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: var(--sp-4);
}
.brand { display: flex; flex-direction: column; line-height: 1.1; color: var(--ink-text); }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand__name .accent { color: var(--gold); }
.brand__tag { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em; color: var(--ink-text-muted); text-transform: uppercase; margin-top: 2px; }

.nav-desktop { display: none; }
@media (min-width: 940px) {
  .nav-desktop { display: flex; align-items: center; gap: var(--sp-6); }
  .nav-desktop a {
    font-size: 0.85rem; letter-spacing: 0.03em; color: var(--ink-text-muted);
    padding-block: var(--sp-2); position: relative;
    transition: color var(--dur-fast) var(--ease);
  }
  .nav-desktop a:hover, .nav-desktop a[aria-current="page"] { color: var(--ink-text); }
  .nav-desktop a[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--gold);
  }
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: none; border: 1px solid var(--ink-3);
  border-radius: var(--radius-sm); color: var(--ink-text); cursor: pointer;
}
@media (min-width: 940px) { .nav-toggle { display: none; } }
.nav-toggle svg { width: 18px; height: 18px; }

.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--ink-3);
  padding: var(--sp-5) 0 var(--sp-6);
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  padding: var(--sp-4) 0; font-size: 1.05rem; color: var(--ink-text);
  border-bottom: 1px solid var(--ink-3);
}
.nav-mobile a:last-of-type { border-bottom: none; }
@media (min-width: 940px) { .nav-mobile { display: none !important; } }

/* ---------------------------------------------------------------------- */
/* The Spine — signature element. A hairline rule that runs the height of */
/* the page on wide viewports, with small tab ticks marking each section, */
/* nodding to a book's bound edge without reusing the cover design.        */
/* ---------------------------------------------------------------------- */
.spine { display: none; }
@media (min-width: 1180px) {
  .spine {
    display: block;
    position: fixed;
    left: clamp(1rem, 2.4vw, 2.25rem);
    top: 50%;
    transform: translateY(-50%);
    height: min(64vh, 620px);
    width: var(--spine-w);
    background: linear-gradient(to bottom, transparent, var(--ink-3) 8%, var(--ink-3) 92%, transparent);
    z-index: 40;
  }
  body.on-light .spine { background: linear-gradient(to bottom, transparent, var(--paper-3) 8%, var(--paper-3) 92%, transparent); }
  .spine__mark {
    position: absolute; left: -3px; width: 7px; height: 1px; background: var(--gold-dim);
  }
  .spine__mark.is-active { background: var(--gold); width: 11px; left: -5px; }
  .spine__label {
    position: absolute; left: 14px; top: -6px;
    font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
    color: var(--ink-text-muted); text-transform: uppercase; white-space: nowrap;
    opacity: 0; transform: translateX(-4px);
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  }
  body.on-light .spine__label { color: var(--paper-text-muted); }
  .spine__mark:hover .spine__label,
  .spine__mark.is-active .spine__label { opacity: 1; transform: translateX(0); }
}

/* ---------------------------------------------------------------------- */
/* Hero grid — stacked on mobile, portrait beside text on wider screens    */
/* ---------------------------------------------------------------------- */
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.3fr 0.7fr !important; align-items: center; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 0.85em 1.5em; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #1a1508; }
.btn-primary:hover { background: var(--gold-bright); }
.btn-ghost-dark { border-color: var(--ink-3); color: var(--ink-text); }
.btn-ghost-dark:hover { border-color: var(--gold-dim); }
.btn-ghost-light { border-color: var(--paper-3); color: var(--paper-text); }
.btn-ghost-light:hover { border-color: var(--gold-dim); }
.btn-text { padding: 0; min-height: 0; color: var(--gold-dim); border-bottom: 1px solid currentColor; border-radius: 0; }
.btn-text:hover { color: var(--gold); transform: none; }

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.surface-ink .card { background: var(--ink-2); border-color: var(--ink-3); }
.card:hover { border-color: var(--gold-dim); }

.card--project {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
}
.card--project .card__media { aspect-ratio: 16/10; overflow: hidden; background: var(--ink-3); }
.card--project .card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform var(--dur-med) var(--ease); }
.card--project:hover .card__media img { transform: scale(1.035); }
.card--project .card__body { padding: var(--sp-5); }

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em;
  padding: 0.3em 0.65em; border-radius: 999px; border: 1px solid var(--paper-3);
  color: var(--paper-text-muted);
}
.surface-ink .tag { border-color: var(--ink-3); color: var(--ink-text-muted); }
.tag--status { border-color: var(--gold-dim); color: var(--gold-dim); }
.surface-ink .tag--status { color: var(--gold); border-color: var(--gold-dim); }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--ink-text-muted); padding-block: var(--sp-8) var(--sp-6); }
.site-footer a:hover { color: var(--gold); }
.site-footer__grid { display: grid; gap: var(--sp-7); }
@media (min-width: 780px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer__bottom {
  margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--ink-3);
  display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between;
  font-size: var(--fs-small);
}

/* ---------------------------------------------------------------------- */
/* Misc                                                                    */
/* ---------------------------------------------------------------------- */
.hr { border: none; border-top: 1px solid var(--paper-3); }
.surface-ink .hr { border-top-color: var(--ink-3); }

/* Inner-page header band */
.page-header { padding-block: var(--sp-8) var(--sp-7); }
.page-header h1 { max-width: 18ch; }

/* Simple accessible accordion (used for FAQ-like or expandable content) */
details.disclosure { border-top: 1px solid var(--paper-3); padding-block: var(--sp-4); }
.surface-ink details.disclosure { border-top-color: var(--ink-3); }
details.disclosure summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; gap: var(--sp-4);
}
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary::after { content: "+"; font-family: var(--font-mono); color: var(--gold-dim); font-size: 1.2rem; flex-shrink: 0; }
details.disclosure[open] summary::after { content: "–"; }
details.disclosure .disclosure__body { margin-top: var(--sp-4); color: var(--paper-text-muted); }
.surface-ink details.disclosure .disclosure__body { color: var(--ink-text-muted); }

/* Timeline */
.timeline { border-left: 1px solid var(--paper-3); padding-left: var(--sp-6); }
.surface-ink .timeline { border-left-color: var(--ink-3); }
.timeline__year { position: relative; padding-bottom: var(--sp-8); }
.timeline__year:last-child { padding-bottom: 0; }
.timeline__year::before {
  content: ""; position: absolute; left: calc(-1 * var(--sp-6) - 4px); top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
}

/* Simple table for résumé-like data */
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-small); }
.kv-list dt { color: var(--paper-text-muted); }
.surface-ink .kv-list dt { color: var(--ink-text-muted); }

/* Form */
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.field label { font-size: var(--fs-small); font-weight: 600; }
.field input, .field textarea {
  background: var(--ink-2); border: 1px solid var(--ink-3); color: var(--ink-text);
  padding: 0.85em 1em; border-radius: var(--radius-sm); font-size: 1rem;
}
.field input:focus, .field textarea:focus { border-color: var(--gold-dim); }
.field-hp { position: absolute; left: -9999px; }

.skip-target:focus { outline: none; }
