/* ============================================================
   Nkurisani Austin Mabasa — portfolio
   Brand: ink black + single gold accent. One accent, used rarely.
   ============================================================ */

:root {
  /* Palette — 5 values. Discipline over variety. */
  --ink:      #0A0A0A;   /* page ground */
  --surface:  #131313;   /* raised panels */
  --gold:     #C9A84C;   /* the only accent */
  --bone:     #EDE8DD;   /* body text, warm not clinical */
  --muted:    #8A857C;   /* secondary text */

  --line:      rgba(237, 232, 221, .11);
  --line-firm: rgba(237, 232, 221, .22);
  --gold-dim:  rgba(201, 168, 76, .16);

  /* Type */
  /* Fallbacks chosen for similar metrics, so a blocked font CDN
     degrades rather than breaks the layout. */
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
             Georgia, "Times New Roman", serif;
  --body:    "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI",
             Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono",
             Consolas, "Liberation Mono", Menlo, monospace;

  /* Scale */
  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.08rem);
  --step-1:  clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.15rem);
  --step-3:  clamp(2.1rem, 1.7rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);

  --wrap: 68rem;
  --gut:  clamp(1.25rem, 4vw, 2.5rem);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--gold); color: var(--ink);
  padding: .7rem 1.1rem; font-weight: 600; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Layout ────────────────────────────────────────────── */
.wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; }
main { flex: 1; }
section { padding-block: clamp(3rem, 8vw, 6rem); }
.section-tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

/* ── Type utilities ────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: .9rem;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--bone);
  max-width: 46ch;
  font-weight: 300;
}

p { max-width: 68ch; color: var(--muted); }
p strong, p b { color: var(--bone); font-weight: 600; }

.gold { color: var(--gold); }

/* ── Header ────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: #0A0A0A;                    /* fallback: opaque */
  border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .masthead {
    background: rgba(10,10,10,.82);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
  }
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: 1rem;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.05rem; font-weight: 600;
  text-decoration: none; letter-spacing: -.01em;
  white-space: nowrap;
}
.wordmark::after {
  content: ""; display: block; height: 2px; width: 0;
  background: var(--gold); transition: width .3s ease;
}
.wordmark:hover::after { width: 100%; }

.nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end;
       gap: clamp(.8rem, 3vw, 1.9rem); min-width: 0; }
.nav a {
  font-size: var(--step--1); text-decoration: none;
  color: var(--muted); transition: color .2s ease;
  position: relative;
  /* 44px minimum touch target — Apple HIG / Material guidance */
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:hover { color: var(--bone); }
.nav a[aria-current="page"] { color: var(--bone); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 11px;
  height: 1px; background: var(--gold);
}
.nav .nav-cv { display: none; }
@media (min-width: 46rem) { .nav .nav-cv { display: inline-flex; } }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: var(--step--1); font-weight: 500;
  padding: .72rem 1.25rem; border-radius: 999px;
  border: 1px solid var(--line-firm);
  background: transparent; color: var(--bone);
  text-decoration: none; cursor: pointer;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
  font-family: var(--body);
}
.btn:hover { border-color: var(--gold); background: var(--gold-dim); transform: translateY(-1px); }
.btn-solid { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 600; }
.btn-solid:hover { background: #d9b95e; border-color: #d9b95e; }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ── Link with underline sweep ─────────────────────────── */
.ln {
  color: var(--bone); text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  transition: border-color .25s ease;
}
.ln:hover { border-color: var(--gold); }

/* ── Hero ──────────────────────────────────────────────── */
.hero { padding-block: clamp(2.5rem, 8vw, 6rem) clamp(2.5rem, 7vw, 4.5rem); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (min-width: 54rem) {
  .hero-grid { grid-template-columns: 1.25fr .75fr; }
}
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 1.5rem; }
.hero .btn-row { margin-top: 2.2rem; }

/* Portrait — restrained, framed, never a centred template headshot */
.portrait { position: relative; justify-self: center; width: 100%; max-width: 20rem; }
@media (min-width: 54rem) { .portrait { justify-self: end; max-width: 22rem; } }
.portrait img {
  width: 100%; height: auto;
  border-radius: 16px; border: 1px solid var(--line-firm);
  filter: grayscale(.15) contrast(1.04);
}
@supports (aspect-ratio: 4 / 5) {
  .portrait img {
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
    object-position: center 22%;
  }
}
/* Gold corner mark — ties the portrait to the brand without decoration for its own sake */
.portrait::before {
  content: ""; position: absolute; top: -9px; right: -9px;
  width: 54px; height: 54px;
  border-top: 2px solid var(--gold); border-right: 2px solid var(--gold);
  border-radius: 0 16px 0 0; pointer-events: none;
}
@media (max-width: 40rem) {
  .portrait { max-width: 14rem; }
  .portrait::before { width: 40px; height: 40px; }
}

.status {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.6rem;
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(201,168,76,.5);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,168,76,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(201,168,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
}

/* ── Proof strip: the signature element ────────────────── */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-list { list-style: none; padding: 0; margin: 0; }
.proof-item { border-bottom: 1px solid var(--line); }
.proof-item:last-child { border-bottom: 0; }

.proof-link {
  display: grid; gap: .35rem 1.5rem; align-items: baseline;
  grid-template-columns: 1fr;
  padding: 1.6rem 0; text-decoration: none;
  transition: padding-left .3s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 46rem) {
  .proof-link { grid-template-columns: 4.5rem 1fr auto; }
}
.proof-link:hover { padding-left: .9rem; }
.proof-link:hover .proof-title { color: var(--gold); }

.proof-year { font-family: var(--mono); font-size: .72rem; color: var(--muted); letter-spacing: .06em; }
.proof-title { font-family: var(--display); font-size: var(--step-1); color: var(--bone); transition: color .25s ease; }
.proof-note { font-size: var(--step--1); color: var(--muted); }
.proof-tag {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-dim); border-radius: 999px;
  padding: .2rem .68rem; white-space: nowrap;
  align-self: center; justify-self: start; margin-top: .5rem;
}
@media (min-width: 46rem) { .proof-tag { margin-top: 0; justify-self: end; } }

/* ── Cards ─────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 46rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
  transition: border-color .3s ease, transform .3s ease;
}
.card:hover { border-color: var(--line-firm); transform: translateY(-2px); }
.card h3 { margin-bottom: .6rem; }
.card p { font-size: var(--step--1); }

a.card { text-decoration: none; display: block; }
a.card:hover { border-color: var(--gold); }

/* ── Chips ─────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.1rem; }
.chip {
  font-family: var(--mono); font-size: .68rem;
  color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: .25rem .68rem;
}

/* ── Breadcrumbs ───────────────────────────────────────── */
.crumbs { padding-top: 1.6rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.crumbs li::after { content: "/"; margin-left: .5rem; color: var(--line-firm); }
.crumbs li:last-child::after { content: ""; }
.crumbs [aria-current] { color: var(--bone); }

/* ── Definition rows (specs, facts) ────────────────────── */
.rows { border-top: 1px solid var(--line); margin-top: 1.5rem; }
.row {
  display: grid; gap: .2rem 1.5rem;
  grid-template-columns: 1fr;
  padding: .95rem 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 40rem) { .row { grid-template-columns: 11rem 1fr; } }
.row dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row dd { margin: 0; font-size: var(--step--1); }

/* ── Prose blocks in case studies ──────────────────────── */
.prose > * + * { margin-top: 1.15rem; }
.prose h3 { margin-top: 2.4rem; }
.prose ul { padding-left: 1.1rem; color: var(--muted); font-size: var(--step--1); }
.prose li + li { margin-top: .45rem; }
.prose li::marker { color: var(--gold); }

.pull {
  border-left: 2px solid var(--gold);
  padding: .3rem 0 .3rem 1.3rem;
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--bone);
  margin-block: 2rem;
  max-width: 44ch;
}

/* ── Forms ─────────────────────────────────────────────── */
.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-family: var(--mono);
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .45rem;
}
.field input, .field textarea, .field select {
  width: 100%; padding: .8rem .95rem;
  background: var(--surface); color: var(--bone);
  border: 1px solid var(--line-firm); border-radius: 9px;
  font-family: var(--body); font-size: var(--step-0);
  transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input::placeholder, .field textarea::placeholder { color: rgba(138,133,124,.6); }

.field-err { color: #E8886A; font-size: var(--step--1); margin-top: .35rem; display: none; }
.field.invalid input, .field.invalid textarea { border-color: #E8886A; }
.field.invalid .field-err { display: block; }

.form-note { font-size: var(--step--1); color: var(--muted); margin-top: 1rem; }

.form-status { margin-top: 1rem; font-size: var(--step--1); display: none; }
.form-status.show { display: block; }
.form-status.ok { color: var(--gold); }
.form-status.bad { color: #E8886A; }

.hp { position: absolute; left: -9999px; }

/* ── FAQ ───────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1.3rem 2.5rem 1.3rem 0; position: relative;
  font-family: var(--display); font-size: var(--step-1);
  line-height: 1.3; transition: color .2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--gold); }
.faq summary::after {
  content: "+"; position: absolute; right: .3rem; top: 50%;
  transform: translateY(-50%); color: var(--gold);
  font-family: var(--mono); font-size: 1.3rem; transition: transform .3s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding-bottom: 1.4rem; font-size: var(--step--1); }

/* ── Sticky mobile CTA ─────────────────────────────────── */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: .7rem var(--gut) calc(.7rem + env(safe-area-inset-bottom));
  background: #0A0A0A;
  border-top: 1px solid var(--line);
  display: flex; gap: .6rem;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.sticky-cta.up { transform: translateY(0); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sticky-cta {
    background: rgba(10,10,10,.94);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
  }
}
.sticky-cta .btn { flex: 1; justify-content: center; min-height: 46px; }
@media (min-width: 46rem) { .sticky-cta { display: none; } }
@media (max-width: 45.99rem) { body { padding-bottom: 4.5rem; } }

/* ── Footer ────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding-block: 2.5rem 3rem; margin-top: 2rem; }
.foot-grid { display: grid; gap: 2rem; }
@media (min-width: 46rem) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h4 {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 400; margin-bottom: .85rem;
}
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li + li { margin-top: .5rem; }
.foot a { font-size: var(--step--1); color: var(--muted); text-decoration: none; transition: color .2s ease; }
.foot a:hover { color: var(--gold); }
.foot-base {
  margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: .78rem; color: var(--muted);
}

/* ── Motion ────────────────────────────────────────────── */
[data-rise] {
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
}
[data-rise].in { opacity: 1; transform: none; }

.stagger > * { opacity: 0; transform: translateY(12px); animation: rise .75s cubic-bezier(.2,.8,.2,1) forwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .15s; }
.stagger > *:nth-child(3) { animation-delay: .25s; }
.stagger > *:nth-child(4) { animation-delay: .35s; }
.stagger > *:nth-child(5) { animation-delay: .45s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-rise] { opacity: 1; transform: none; }
  .stagger > * { opacity: 1; transform: none; }
}

/* ── 404 ───────────────────────────────────────────────── */
.oops { text-align: center; padding-block: clamp(4rem, 14vw, 9rem); }
.oops .code {
  font-family: var(--mono); font-size: clamp(4rem, 16vw, 8rem);
  color: var(--gold); line-height: 1; letter-spacing: -.04em;
}
.oops p { margin-inline: auto; }
.oops .btn-row { justify-content: center; margin-top: 2rem; }


/* ── Small screens ─────────────────────────────────────── */
@media (max-width: 26rem) {
  :root { --gut: 1.1rem; }
  .masthead-inner { padding-block: .8rem; gap: .75rem; }
  .nav { gap: .85rem; }
  .nav a { font-size: .78rem; }
  .wordmark { font-size: .92rem; }
  .btn { padding: .65rem 1rem; font-size: .8rem; }
  .card { padding: 1.25rem; }
  .proof-link { padding: 1.25rem 0; }
  .proof-link:hover { padding-left: 0; }
  .lede { font-size: 1.05rem; }
  .row { padding: .8rem 0; }
  .faq summary { font-size: 1.1rem; padding-right: 2rem; }
  .foot-grid { gap: 1.5rem; }
}

/* Never let long strings blow out the layout */
.ln, .row dd a, .foot a { word-break: break-word; overflow-wrap: anywhere; }

/* ── Maintenance label ─────────────────────────────────── */
.badge-maint {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 999px;
  padding: .3rem .8rem; white-space: nowrap; min-height: 2rem;
}
.badge-maint::before {
  content: ""; width: .45rem; height: .45rem; border-radius: 50%;
  background: var(--gold); flex: none;
}
