/* ============================================================
   Hal's portfolio site — shared chrome
   nav, footer, layout primitives, components
   Built on top of colors_and_type.css (desktop register)
   ============================================================ */

html, body { background: var(--paper); color: var(--ink); }
body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Layout ----------------------------------------- */

main { flex: 1; }

.shell {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
  box-sizing: border-box;
}
.shell--bleed { max-width: var(--content-bleed); }
.shell--narrow { max-width: calc(var(--content-narrow) + var(--page-pad) * 2); }

/* ---------- Nav -------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: var(--bw-rule) solid var(--ink);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  box-sizing: border-box;
  gap: var(--sp-5);
}
.nav__brand {
  display: flex; align-items: flex-end; gap: 20px;
  text-decoration: none; color: var(--ink);
}
.nav__brand img { display: block; height: 48px; width: auto; margin-bottom: 2px; }
.nav__brand-text {
  display: flex; flex-direction: column; gap: 2px;
}
.nav__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-h2); line-height: 1.1; letter-spacing: var(--tracking-tight);
  color: var(--ink);
}
.nav__role {
  font-family: var(--font-body); font-size: var(--t-body);
  line-height: 1.3; color: var(--ink-60);
}
.nav__links {
  display: flex; align-items: center; gap: var(--sp-6);
  list-style: none; margin: 0; padding: 0;
}
.nav__links a {
  font-family: var(--font-body);
  font-size: var(--t-body);
  color: var(--ink);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-1) var(--ease-quiet),
              border-color var(--dur-1) var(--ease-quiet);
}
.nav__links a:hover { color: var(--sun-deep); border-bottom-color: var(--sun-deep); }
.nav__links a[aria-current="page"] {
  border-bottom: 2px solid var(--sun);
  padding-bottom: 3px;
}
/* The CTA button override — sits inside .nav__links so we need
   to win on specificity. */
.nav__links a.btn {
  color: var(--paper);
  border-bottom: 0;
  padding: 10px 16px;
}
.nav__links a.btn:hover {
  color: var(--paper);
  border-bottom: 0;
}

/* ---------- Button — stamped ink CTA ----------------------- */

.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-body); font-size: var(--t-body);
  text-decoration: none;
  color: var(--paper); background: var(--ink);
  padding: 10px 16px;
  border: 0;
  border-radius: 0;
  transition: background var(--dur-1) var(--ease-quiet);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover  { background: var(--ink-80); color: var(--paper); }
.btn .arrow { display: inline-block; transform: translateY(-1px); font-size: 1.6em; }

.btn--ghost {
  background: var(--paper); color: var(--ink);
  box-shadow: inset 0 0 0 var(--bw-rule) var(--ink);
  padding: 10px 16px;
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- Eyebrow / meta type ---------------------------- */

.eyebrow {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60); line-height: var(--lh-small);
}
.eyebrow--ink { color: var(--ink); }
.small { font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-60); }

/* status dot */
.status {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-body); font-size: var(--t-body); color: var(--ink);
}
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: var(--r-pill);
  background: var(--sun);
  display: inline-block;
}

/* ---------- Marker highlight ------------------------------- */
/* coral fine-liner pulled under a span of text               */

.marker {
  background-image: linear-gradient(transparent 68%, var(--sun) 68%, var(--sun) 92%, transparent 92%);
  padding: 0 0.04em;
}
.marker--sky {
  background-image: linear-gradient(transparent 68%, var(--sky-soft) 68%, var(--sky-soft) 92%, transparent 92%);
}

/* ---------- Link styles ------------------------------------ */
/* Default <a> = ink underline. Sky links for "elsewhere".    */

.link-sky {
  color: var(--sky); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.link-sky:hover { color: var(--sky-deep); text-decoration-thickness: 2px; }

/* ---------- Display headings (desktop register) ------------ */

.display-1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-display-1); line-height: var(--lh-display-1);
  letter-spacing: var(--tracking-tight);
  text-wrap: pretty;
}
.display-2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-display-2); line-height: var(--lh-display-2);
  letter-spacing: var(--tracking-tight);
  text-wrap: pretty;
}

.prose {
  font-size: var(--t-body-lg);
  line-height: var(--lh-body-lg);
  max-width: var(--measure);
}
.prose p + p { margin-top: var(--sp-4); }
.prose em { font-style: italic; }
.prose strong { font-weight: 700; }
.prose a { color: var(--ink); }

/* ---------- Footer ----------------------------------------- */

.footer {
  margin-top: 0;
  border-top: 2px solid var(--ink-20);
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-7);
  background: var(--paper);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  column-gap: var(--grid-gap);
  row-gap: var(--sp-7);
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  box-sizing: border-box;
}
.footer__brand img { height: 28px; display: block; margin-bottom: var(--sp-4); }
.footer__brand p {
  font-size: var(--t-body); color: var(--ink-60);
  max-width: 30ch;
  margin-bottom: var(--sp-4);
}
.footer__col .head {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: var(--sp-3);
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { font-size: var(--t-body); margin-bottom: var(--sp-2); }
.footer__col li a {
  color: var(--ink); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.footer__col li a:hover { color: var(--sun-deep); }
.footer__col.elsewhere li a { color: var(--sky); }
.footer__col.elsewhere li a:hover { color: var(--sky-deep); }

.footer__colophon {
  max-width: var(--content-wide);
  margin: var(--sp-7) auto 0;
  padding: var(--sp-4) var(--page-pad) 0;
  box-sizing: border-box;
  border-top: 1px solid var(--ink-20);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--t-small); color: var(--ink-60);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  gap: var(--sp-5); flex-wrap: wrap;
}

/* ---------- Hero region ------------------------------------ */

.hero {
  padding-top: var(--sp-10);
  padding-bottom: var(--sp-10);
}
.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  row-gap: var(--sp-7);
  align-items: end;
}

/* ---------- Section heading -------------------------------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: var(--bw-rule) solid var(--ink);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-7);
  gap: var(--sp-5);
}
.section-head h2 {
  font-size: var(--t-h2); line-height: 1.15;
}
.section-head .right {
  font-family: var(--font-body); font-size: var(--t-small); color: var(--ink-60);
}

/* ---------- Work card -------------------------------------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--grid-gap);
  row-gap: var(--sp-9);
}
.card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-top: 2px solid var(--ink);
  padding-top: var(--sp-4);
  transition: color var(--dur-1) var(--ease-quiet);
}
.card__media {
  aspect-ratio: 4 / 3;
  background: var(--ink-08);
  border: 1px solid var(--ink-20);
  margin-bottom: var(--sp-4);
  overflow: hidden;
  display: block;
  transition: border-color var(--dur-1) var(--ease-quiet);
}
.card__media image-slot { width: 100%; height: 100%; display: block; }
.card__index {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60);
  display: flex; justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.card__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-h3); line-height: var(--lh-h3);
  margin: var(--sp-1) 0 var(--sp-2);
}
.card__title .marker { padding: 0 0.06em; }
.card__desc {
  font-size: var(--t-body); line-height: var(--lh-body);
  color: var(--ink-60);
  max-width: 56ch;
}
.card__tags {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.card__tags span {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60);
  border: 1px solid var(--ink-20);
  padding: 3px 8px;
  border-radius: var(--r-2);
}
.card:hover .card__media { border-color: var(--ink); }
.card:hover .card__title .marker {
  background-image: linear-gradient(transparent 0%, var(--sun) 0%, var(--sun) 100%, transparent 100%);
}

/* ---------- Card thumbnails — splash-screen device frames ---
   Four shapes, all 4:3 outer to fit .card__media.
   Drop a screenshot into the image-slot inside; it fills the
   "screen" area. Frames are ink-on-paper-warm, no colour. */

.thumb {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-warm);
  overflow: hidden;
  isolation: isolate;
}
.thumb__index {
  position: absolute; left: var(--sp-4); top: var(--sp-3);
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-h4); line-height: 1;
  color: var(--ink-40);
  font-feature-settings: "tnum";
  letter-spacing: var(--tracking-tight);
  z-index: 3;
}
.thumb__caption {
  position: absolute; right: var(--sp-4); bottom: var(--sp-3);
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60);
  z-index: 3;
}
.thumb image-slot { width: 100%; height: 100%; display: block; }

/* ---- 1. Phone — Compass --------------------------------- */

.thumb--phone .phone {
  position: relative;
  height: 86%;
  aspect-ratio: 9 / 19.5;
  background: var(--ink);
  border-radius: 18px;
  padding: 5px;
  box-sizing: border-box;
  box-shadow: var(--sh-2);
}
.thumb--phone .phone__screen {
  width: 100%; height: 100%;
  background: var(--paper);
  border-radius: 13px;
  overflow: hidden;
  position: relative;
}
.thumb--phone .phone__notch {
  position: absolute; top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 28%; height: 12px;
  background: var(--ink);
  border-radius: var(--r-pill);
  z-index: 2;
}
.thumb--phone .phone__statusbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 22px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  font-family: var(--font-body); font-weight: 700;
  font-size: 9px;
  color: var(--ink);
  z-index: 3;
  pointer-events: none;
}
.thumb--phone .phone__statusbar .bat {
  display: inline-block;
  width: 14px; height: 6px;
  border: 1px solid var(--ink);
  border-radius: 1px;
  position: relative;
}
.thumb--phone .phone__statusbar .bat::before {
  content: ""; position: absolute;
  top: 1px; left: 1px;
  width: 9px; height: 2px;
  background: var(--ink);
}
.thumb--phone .phone__statusbar .bat::after {
  content: ""; position: absolute;
  top: 1px; right: -2px;
  width: 1px; height: 2px;
  background: var(--ink);
}
.thumb--phone .phone__screen image-slot { width: 100%; height: 100%; display: block; }

/* ---- 2. Window — generic desktop app (Atlas) ------------ */

.thumb--window { padding: var(--sp-5); }
.window {
  width: 100%; height: 100%;
  background: var(--paper);
  border: 1px solid var(--ink);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh-2);
}
.window__chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ink-20);
  background: var(--ink-04);
  flex-shrink: 0;
}
.window__chrome .dot {
  width: 9px; height: 9px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 1px solid var(--ink-40);
}
.window__chrome .title {
  margin-left: var(--sp-3);
  font-family: var(--font-body); font-size: var(--t-small);
  color: var(--ink-60);
  line-height: 1;
}
.window__body {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ---- 3. Editor — code/library window (Almanac) ---------- */

.thumb--editor .window__tabs {
  display: flex;
  border-bottom: 1px solid var(--ink-20);
  background: var(--ink-04);
  flex-shrink: 0;
}
.thumb--editor .window__tabs .tab {
  padding: 5px 12px;
  font-family: var(--font-body); font-size: var(--t-small);
  color: var(--ink-60);
  border-right: 1px solid var(--ink-20);
  line-height: 1;
}
.thumb--editor .window__tabs .tab.active {
  background: var(--paper);
  color: var(--ink);
}

/* ---- 4. Browser — web (Headlands) ------------------------ */

.thumb--browser .window__urlbar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 7px 12px;
  border-bottom: 1px solid var(--ink-20);
  background: var(--paper);
  flex-shrink: 0;
}
.thumb--browser .window__urlbar .nav-arrows {
  display: flex; gap: 4px;
  font-family: var(--font-body); font-size: 11px;
  color: var(--ink-40);
  line-height: 1;
}
.thumb--browser .window__urlbar .url {
  flex: 1;
  font-family: var(--font-body); font-size: var(--t-small);
  color: var(--ink-60);
  background: var(--ink-04);
  border: 1px solid var(--ink-20);
  padding: 4px 10px;
  text-align: center;
  border-radius: var(--r-1);
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Case study scaffold ---------------------------- */

.cs-hero { padding-top: var(--sp-9); padding-bottom: var(--sp-7); }
.cs-hero .eyebrow { margin-bottom: var(--sp-4); }
.cs-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-display-2); line-height: var(--lh-display-2);
  letter-spacing: var(--tracking-tight);
  max-width: 18ch;
}
.cs-hero .blurb {
  margin-top: var(--sp-5);
  font-size: var(--t-body-lg); line-height: var(--lh-body-lg);
  color: var(--ink-60);
  max-width: var(--measure);
}
.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--grid-gap);
  border-top: 2px solid var(--ink-20);
  border-bottom: 1px solid var(--ink-20);
  padding: var(--sp-4) 0;
  margin-top: var(--sp-7);
}
.cs-meta dt {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60); margin-bottom: var(--sp-1);
}
.cs-meta dd { margin: 0; font-size: var(--t-body); color: var(--ink); }

.cs-figure {
  margin: var(--sp-9) auto;
  border: 1px solid var(--ink-20);
  aspect-ratio: 16 / 9;
  background: var(--ink-04);
  overflow: hidden;
}
.cs-figure.tall { aspect-ratio: 4 / 5; max-width: 720px; }
.cs-figure image-slot { width: 100%; height: 100%; display: block; }
.cs-figure-caption {
  font-size: var(--t-small); color: var(--ink-60);
  max-width: var(--content-narrow);
  margin: calc(var(--sp-9) * -1 + var(--sp-3)) auto var(--sp-9);
  text-align: left;
}

.cs-section {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  margin: var(--sp-9) 0;
}
.cs-section .label {
  grid-column: span 3;
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60);
  padding-top: 6px;
}
.cs-section .body {
  grid-column: 5 / span 8;
  font-size: var(--t-body-lg); line-height: var(--lh-body-lg);
  max-width: var(--measure);
}
.cs-section .body h3 {
  font-size: var(--t-h3); line-height: var(--lh-h3);
  margin-bottom: var(--sp-3);
}
.cs-section .body p + p { margin-top: var(--sp-4); }
.cs-section .body em { font-style: italic; }

.cs-next {
  display: grid; grid-template-columns: 1fr auto;
  align-items: end;
  border-top: 2px solid var(--ink-20);
  padding: var(--sp-7) 0 0;
  margin-top: var(--sp-10);
  gap: var(--sp-5);
}
.cs-next .label {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60); margin-bottom: var(--sp-3);
}
.cs-next a {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-h2); line-height: 1.15;
  color: var(--ink); text-decoration: none;
}
/* Restore standard .btn appearance inside .cs-next */
.cs-next a.btn {
  font-family: var(--font-body); font-weight: 400;
  font-size: var(--t-body); line-height: var(--lh-body);
  color: var(--paper);
}
.cs-next a.btn:hover { color: var(--paper); }


/* ---------- Case study page --------------------------------- */

.cs { padding-top: var(--sp-7); padding-bottom: var(--sp-9); }

.cs__back {
  display: inline-block;
  font-size: var(--t-body); line-height: var(--lh-body);
  color: var(--ink-60); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  margin-bottom: var(--sp-7);
}
.cs__back:hover { color: var(--ink); }

.cs__hero {
  padding-bottom: var(--sp-7);
  border-bottom: 1px solid var(--ink-20);
  margin-bottom: var(--sp-8);
}
.cs__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--t-h1); line-height: var(--lh-h1);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--sp-4);
}
.cs__lede {
  font-size: var(--t-body-lg); line-height: var(--lh-body-lg);
  color: var(--ink-60);
}

.cs__eyebrow {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60); margin-bottom: var(--sp-3);
}
.cs__section { margin-bottom: var(--sp-8); }
.cs__section h2 {
  font-size: var(--t-h2); line-height: var(--lh-h2);
  margin-bottom: var(--sp-5);
}
.cs__section p { font-size: var(--t-body-lg); line-height: var(--lh-body-lg); color: var(--ink); }
.cs__section p + p { margin-top: var(--sp-4); }
.cs__section strong { font-weight: 700; }

.cs__quote {
  margin: var(--sp-6) 0; padding-left: var(--sp-5);
  border-left: 2px solid var(--ink); font-style: italic;
  font-size: var(--t-body-lg); line-height: var(--lh-body-lg);
}

.cs__image { margin: var(--sp-8) 0; }
.cs__image-frame {
  width: 100%; aspect-ratio: 16 / 9;
  background: var(--ink-04); border: 1px solid var(--ink-20); overflow: hidden;
}
.cs__image-frame image-slot { width: 100%; height: 100%; display: block; }
.cs__caption {
  margin-top: var(--sp-2);
  font-size: var(--t-small); line-height: var(--lh-small);
  color: var(--ink-60); font-style: italic;
}

.cs__two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: var(--grid-gap); margin: var(--sp-8) 0;
}
.cs__two-col-frame {
  aspect-ratio: 4 / 3;
  background: var(--ink-04); border: 1px solid var(--ink-20); overflow: hidden;
}
.cs__two-col-frame image-slot { width: 100%; height: 100%; display: block; }

/* ---------- Contact form ------------------------------------ */

.form-stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.form-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-field label {
  font-family: var(--font-body); font-size: var(--t-small);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--ink-60);
}
.form-field input,
.form-field textarea {
  font-family: var(--font-body); font-size: var(--t-body); line-height: var(--lh-body);
  border: 1px solid var(--ink-20); padding: var(--sp-3);
  background: var(--paper); color: var(--ink);
  width: 100%; box-sizing: border-box; border-radius: 0;
  transition: border-color var(--dur-1) var(--ease-quiet);
  appearance: none;
}
.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--ink); }
.form-field textarea { resize: vertical; min-height: 140px; }

/* ---------- Responsive ------------------------------------- */

@media (max-width: 880px) {
  .work-grid { grid-template-columns: 1fr; row-gap: var(--sp-7); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .cs-section { display: block; }
  .cs-section .label { margin-bottom: var(--sp-2); }
  .cs-meta { grid-template-columns: repeat(2, 1fr); row-gap: var(--sp-3); }
  .hero__grid { grid-template-columns: 1fr; }
  .display-1 { font-size: 56px; line-height: 60px; }
  .cs-hero h1 { font-size: 40px; line-height: 44px; }
  .cs__two-col { grid-template-columns: 1fr; }
  .cs__title { font-size: var(--t-h2); line-height: var(--lh-h2); }
}

@media (max-width: 640px) {
  .nav__links { gap: var(--sp-3); }
  .nav__brand .wordmark { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
  .display-1 { font-size: 40px; line-height: 44px; }
}
