/* =========================================================================
   SECTIONS — navigation, hero, section shell, about, skills, security,
   client work, contact, footer, case-study page.
   ========================================================================= */

/* ---- Navigation --------------------------------------------------------
   A floating pill, detached from the top edge, in the site's dark ink.
   Solid rather than frosted glass: it reads the same over every section.

   --nav-h (68px) is the full band it occupies: a 12px gap above a 56px pill.
   Everything that clears the nav (hero padding, scroll offsets) uses that. */
.nav {
  --pill-bg: #221f1b;
  --pill-fg: #f3ece0;
  --pill-dim: rgba(243, 236, 224, 0.72);
  --pill-line: rgba(255, 255, 255, 0.1);

  position: fixed;
  inset: 12px 0 auto 0;
  z-index: 100;
  height: calc(var(--nav-h) - 12px);
  padding-inline: var(--gutter);
  pointer-events: none; /* the band is see-through; only the pill takes clicks */
}
.nav__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  max-width: calc(var(--maxw) - var(--gutter) * 2);
  height: 100%;
  margin-inline: auto;
  padding: 0 8px 0 18px;
  border: 1px solid var(--pill-line);
  border-radius: var(--r-pill);
  background: var(--pill-bg);
  color: var(--pill-fg);
}

/* On a dark ground the page's near-black focus ring would vanish. */
.nav :focus-visible { outline-color: var(--on-ink); }

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--pill-fg);
  text-decoration: none;
  flex: none;
}
.nav__brand img { width: 40px; height: 28px; object-fit: contain; }
.nav__brand span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.nav__brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  color: var(--pill-dim);
  font-weight: 400;
  text-transform: none;
}

.nav__list { display: flex; align-items: center; gap: var(--s-1); }
.nav__list a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--pill-dim);
  text-decoration: none;
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.nav__list a:hover { color: var(--pill-fg); background: rgba(255, 255, 255, 0.08); }
.nav__list a[aria-current='true'] { color: var(--pill-fg); background: rgba(255, 255, 255, 0.1); }

.nav__actions { display: flex; align-items: center; gap: var(--s-2); flex: none; }

/* The CTA is a darker pill inside the pill, as in the reference. */
.nav .nav__cta {
  --btn-bg: #111215;
  --btn-fg: var(--pill-fg);
  --btn-bd: rgba(255, 255, 255, 0.12);
  padding: 0.62rem 1.15rem;
  border-radius: var(--r-pill);
}
.nav .nav__cta:hover { --btn-bg: #000; --btn-bd: rgba(255, 255, 255, 0.22); }

/* The in-drawer CTA only exists for the mobile menu. */
.nav__menu > .btn { display: none; }

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pill-line);
  border-radius: 50%;
  cursor: pointer;
}
.nav__toggle span {
  position: relative;
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--pill-fg);
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-1) var(--ease);
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--pill-fg);
  transition: transform var(--dur-2) var(--ease);
}
.nav__toggle span::before { top: -5px; }
.nav__toggle span::after { top: 5px; }
.nav__toggle[aria-expanded='true'] span { background: transparent; }
.nav__toggle[aria-expanded='true'] span::before { transform: translateY(5px) rotate(45deg); }
.nav__toggle[aria-expanded='true'] span::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav { padding-inline: 10px; }
  .nav__inner { padding: 0 8px 0 14px; }
  .nav__toggle { display: grid; }
  .nav__cta { display: none; }

  /* The menu drops out of the pill as a second panel, same width. */
  .nav__menu {
    pointer-events: auto;
    position: fixed;
    top: calc(var(--nav-h) + 8px);
    left: 10px;
    right: 10px;
    max-height: calc(100svh - var(--nav-h) - 20px);
    overflow-y: auto;
    padding: var(--s-2) var(--s-5) var(--s-5);
    border: 1px solid var(--pill-line);
    border-radius: 12px;
    background: var(--pill-bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-1) var(--ease), visibility var(--dur-1);
  }
  .nav__menu.is-open { opacity: 1; visibility: visible; }

  /* Scrim, so the open menu reads as modal rather than as a panel floating
     over live content. Sits under the nav (z-100) and over everything else. */
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(28, 22, 14, 0.45);
  }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a {
    padding: var(--s-4) var(--s-1);
    font-size: 1.15rem;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--pill-fg);
    border-bottom: 1px solid var(--pill-line);
    border-radius: 0;
  }
  .nav__list a:hover,
  .nav__list a[aria-current='true'] { background: transparent; }
  .nav__menu > .btn {
    --btn-bg: var(--on-ink);
    --btn-fg: var(--ink);
    --btn-bd: var(--on-ink);
    display: inline-flex;
    margin-top: var(--s-5);
    width: 100%;
    justify-content: center;
    border-radius: var(--r-pill);
  }
}

/* ---- Section shell ----------------------------------------------------- */
.section { padding-block: var(--section-y); position: relative; }
.section + .section { border-top: 1px solid var(--line); }

.section__head { margin-bottom: var(--s-7); }
.section__title { max-width: 30ch; }
.section__lead {
  margin-top: var(--s-4);
  max-width: 58ch;
  color: var(--fg-mid);
  font-size: var(--t-lead);
}


/* ---- Hero -------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(560px, 86svh, 860px);
  padding-top: calc(var(--nav-h) + var(--s-5));
  padding-bottom: var(--s-8);
}
.hero > .shell { width: 100%; }

/* On phones the window keeps a sliver of page around it so it still reads
   as a window, but gives the headline back most of the width. */
@media (max-width: 640px) {
  .hero .window { margin-inline: calc(var(--gutter) * -1 + 8px); }
}

.hero__intro { max-width: 62rem; }
.hero h1 { margin-bottom: var(--s-5); }
.hero__lead {
  max-width: 58ch;
  font-size: var(--t-lead);
  color: var(--fg-mid);
  margin-bottom: var(--s-6);
}
.hero__lead strong { color: var(--fg); font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

@media (max-width: 980px) {
  .hero { min-height: 0; padding-bottom: var(--s-7); }
}

/* The down-arrow at the foot of the window, as in the reference. Static. */
.hero__scroll {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: var(--s-6) auto calc(var(--s-3) * -1);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--fg-dim);
  text-decoration: none;
}
.hero__scroll:hover { color: var(--fg); }
@media (max-width: 980px) { .hero__scroll { display: none; } }

/* Short laptop screens (1366x768 and similar): tighten so all four edges of
   the window stay above the fold. */
@media (min-width: 981px) and (max-height: 820px) {
  .hero { padding-top: calc(var(--nav-h) + var(--s-4)); }
  .hero h1 { font-size: clamp(2.75rem, 10.5vh, 5rem); }
  .hero .window__body { padding-block: var(--s-6); }
  .hero__scroll { display: none; }
}

/* ---- Work grid --------------------------------------------------------- */
/* Two across at most: projects get room for a real screenshot, and it
   avoids the three-identical-cards row. */
.grid-work {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr));
  gap: var(--s-5);
}

.empty-note {
  padding: var(--s-6) 0;
  color: var(--fg-dim);
  font-size: var(--t-sm);
}

/* ---- Client work ------------------------------------------------------- */
.clients { display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 6rem); }

.client {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}
.client:nth-child(even) .client__visual { order: 2; }
/* Grid items default to min-width:auto, so the mockup's no-wrap URL text
   would hold the column open and push the page wider than a phone screen. */
.client__visual { min-width: 0; }
@media (max-width: 900px) {
  .client { grid-template-columns: 1fr; gap: var(--s-5); }
  .client:nth-child(even) .client__visual { order: 0; }
}

.client__name { margin-bottom: var(--s-2); }
.client__kind { color: var(--fg-dim); margin-bottom: var(--s-4); }
.client__desc { color: var(--fg-mid); margin-bottom: var(--s-5); max-width: 46ch; }

/* Plain lists everywhere: hairline-separated rows, no bullet glyphs. */
.client__features,
.prose ul {
  border-top: 1px solid var(--line);
  margin-bottom: var(--s-5);
}
.client__features li,
.prose ul li {
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-mid);
}
.client__features li { font-size: var(--t-sm); }
.client__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

/* ---- About / Lab: text with a list beside it --------------------------- */
.about,
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 900px) { .about, .lab { grid-template-columns: 1fr; } }
.about__body p { color: var(--fg-mid); font-size: var(--t-lead); }
.about__body p:first-child { color: var(--fg); }
.lab__body p { color: var(--fg-mid); }
.lab__body .lab__small { font-size: var(--t-sm); color: var(--fg-dim); }

/* A short list with a heading: no box, just a rule above each row. */
.aside-list {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.aside-list h3 {
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-3);
}
.aside-list ul { border-top: 1px solid var(--line-strong); }
.aside-list li {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
  color: var(--fg-mid);
}

/* ---- Toolkit ----------------------------------------------------------- */
/* Three columns of rules rather than three boxed cards. */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--s-6) clamp(2rem, 4vw, 3.5rem);
}
.skillset {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.skillset__head {
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-strong);
}
.skillset__head h3 { font-size: var(--t-body); font-weight: 600; letter-spacing: -0.01em; }
.skillset li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.skillset li img { width: 24px; height: 24px; object-fit: contain; flex: none; }
/* Rows without a logo get a dot in a box the same width as the icons
   (5 + 9.5 + 9.5 = 24px), so every label starts on the same line. */
.skillset li .dotmark {
  width: 5px;
  height: 5px;
  margin-inline: 9.5px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}
.skillset li span { color: var(--fg); }
.skillset li em {
  margin-left: auto;
  font-style: normal;
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--fg-dim);
}
.section__lead strong { color: var(--fg); font-weight: 600; }

/* ---- Contact ----------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
.contact h2 { font-size: clamp(2rem, 1.3rem + 2.9vw, 3.4rem); }
.contact__lead { margin-top: var(--s-4); color: var(--fg-mid); font-size: var(--t-lead); max-width: 46ch; }

.contact__links { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.contact__links a,
.contact__row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.contact__links a:hover .v { text-decoration: underline; text-underline-offset: 0.25em; }
.contact__links .k {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.contact__links .v { color: var(--fg); font-size: var(--t-sm); overflow-wrap: anywhere; }
.contact__links .arrow { color: var(--fg-dim); }

/* ---- Footer ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line); padding-block: var(--s-7) var(--s-6); }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.6fr));
  gap: var(--s-6);
  padding-bottom: var(--s-6);
}
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
.footer__brand img { width: 53px; height: 36px; margin-bottom: var(--s-3); }
.footer__brand p { color: var(--fg-mid); font-size: var(--t-sm); max-width: 34ch; margin-top: var(--s-2); }
.footer h4 {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: var(--s-4);
}
.footer ul { display: grid; gap: var(--s-3); }
.footer ul a { font-size: var(--t-sm); color: var(--fg-mid); text-decoration: none; }
.footer ul a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 0.25em; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--fg-dim);
}
/* Side by side, so the global "p + p" paragraph spacing must not apply. */
.footer__bottom p { margin: 0; }
.footer__bottom a { color: var(--fg-dim); }
.footer__bottom a:hover { color: var(--fg); }

/* ---- Case-study page --------------------------------------------------- */
.case { padding-top: calc(var(--nav-h) + var(--s-7)); }
.crumbs { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-5); }
.crumbs a { text-decoration: none; color: var(--fg-dim); font-size: var(--t-xs); font-weight: 500; }
.crumbs a:hover { color: var(--fg); }
.crumbs span { color: var(--fg-dim); font-size: var(--t-xs); font-weight: 500; }

.case__head { display: grid; gap: var(--s-5); margin-bottom: var(--s-7); }
.case__title { max-width: 20ch; }
.case__lead { max-width: 62ch; color: var(--fg-mid); font-size: var(--t-lead); }
.case__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.case__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 900px) { .case__layout { grid-template-columns: 1fr; } }
.case__visual { margin-bottom: var(--s-7); }
.case__aside { position: sticky; top: calc(var(--nav-h) + var(--s-5)); }
@media (max-width: 900px) { .case__aside { position: static; } }

.prose h2 { font-size: 1.5rem; margin-top: var(--s-7); margin-bottom: var(--s-4); }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--fg-mid); }
.prose ul { margin-top: var(--s-4); }

.case__shots { display: grid; gap: var(--s-4); margin-top: var(--s-7); }

.case__next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

/* ---- Plain text pages (privacy) ---------------------------------------- */
.page { padding-top: calc(var(--nav-h) + var(--s-7)); padding-bottom: var(--s-9); }
.page h1 { font-size: var(--t-h2); margin-bottom: var(--s-6); }
.page h2 { font-size: var(--t-h3); margin: var(--s-7) 0 var(--s-3); }
.page p, .page li { color: var(--fg-mid); max-width: 64ch; }
.page ul { border-top: 1px solid var(--line); margin-top: var(--s-4); }
.page li { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.page__updated { font-size: var(--t-sm); color: var(--fg-dim); }

/* ---- 404 --------------------------------------------------------------- */
.notfound {
  display: grid;
  place-content: center;
  gap: var(--s-5);
  min-height: 100svh;
  text-align: center;
  padding: var(--gutter);
}
.notfound__code {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(4rem, 14vw, 9rem);
  line-height: 1;
  color: var(--fg);
}
