/* Eli Turner portfolio
   Layout: one centered column (max 1320px) with fluid gutters; every size
   scales smoothly with the window using clamp(), so there are no "jumps"
   between laptop, monitor, tablet and phone. */

@font-face { font-family: "Geist"; src: url("../fonts/geist-latin.woff2") format("woff2"); font-weight: 300 600; font-display: swap; }

:root {
  --paper: #fffefa;
  --ink: #050505;
  --body: #424242;
  --muted: #8b8a85;
  --line: #e8e6dd;
  --tile: #f2f1eb;
  --on-image: #fffefa;
  --grey: #8c8c8c;

  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --edge: 16px;            /* thin outer margin used by the nav and project grid */
  --t-ui: clamp(15px, 1.4vw, 20px);
  --bar-h: 56px;

  --max: 1320px;
  --gutter: clamp(16px, 4vw, 60px);
  --section: clamp(64px, 9vw, 140px);
  --gap: clamp(16px, 2.2vw, 32px);

  --t-display: clamp(52px, 8vw, 112px);
  --t-h2: clamp(30px, 3.6vw, 48px);
  --t-h3: clamp(20px, 1.7vw, 24px);
  --t-lead: clamp(17px, 1.35vw, 19px);
  --t-body: clamp(15.5px, 1.15vw, 17px);
  --t-small: 13px;
  --t-footer: clamp(30px, 3.6vw, 52px);

  --header-h: 72px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 500; line-height: 1.05; text-wrap: balance; }
p { margin: 0; max-width: 65ch; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--paper); padding: 8px 12px; }

/* ---------- Header ----------
   One transparent row of text. Name far left, links from 1/8 across,
   tagline from 2/3 across, contact far right. White text in "difference"
   mode, so it reads as black on the page and stays visible over images. */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: var(--bar-h);
  color: #fff; mix-blend-mode: difference;
}
.bar {
  height: 100%;
  display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: 10px; align-items: center;
  padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
  padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
  font-size: var(--t-ui); font-weight: 500; letter-spacing: .01em; line-height: 1.2; text-transform: lowercase;
}
.bar a { text-decoration: none; color: inherit; }
/* Projects dropdown: plain text under "projects", shown on hover or keyboard focus */
.has-menu { position: relative; }
.dropdown {
  position: absolute; left: 0; top: 100%;
  display: grid; gap: .2em; padding-top: .45em;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s ease, transform .25s ease, visibility 0s .25s;
}
.dropdown a { white-space: nowrap; }
.has-menu:hover .dropdown, .has-menu:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .2s ease, transform .25s ease, visibility 0s;
}

/* Nav hover motion (driven by main.js): each word leans gently toward the
   pointer and gives a small bump when touched. */
.wob { display: inline-block; transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg)); transform-origin: 50% 80%; will-change: transform; }
.bar .name { grid-column: 1 / 4; white-space: nowrap; }
.bar .links { grid-column: 4 / 16; display: flex; gap: 0 .6em; flex-wrap: wrap; }
.bar .tag { grid-column: 17 / 21; white-space: nowrap; }
.bar .contact-link { grid-column: 21 / -1; justify-self: end; }

/* Home: the bar starts in the middle of the full-screen image, scrolls up
   with the page and then sticks to the top. */
.site-header.centered { margin-top: calc(50svh - var(--bar-h) / 2); }
.site-header.over-hero { mix-blend-mode: normal; color: var(--on-image); text-shadow: 0 0 18px rgb(0 0 0 / .45), 0 1px 3px rgb(0 0 0 / .35); }
body.menu-open .site-header.over-hero { mix-blend-mode: difference; color: #fff; text-shadow: none; }

.pill {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 18px; border: 1px solid var(--ink); border-radius: 999px;
  font-size: 14px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--ink);
  background: transparent; cursor: pointer; font-family: inherit;
  transition: background .2s, color .2s;
}
.pill .arrow {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); transition: transform .25s, background .2s, color .2s;
}
.pill .arrow svg { width: 13px; height: 13px; }
.pill:hover { background: var(--ink); color: var(--paper); }
.pill:hover .arrow { background: var(--paper); color: var(--ink); transform: rotate(45deg); }
.pill.light { border-color: var(--on-image); color: var(--on-image); }
.pill.light .arrow { background: var(--on-image); color: var(--ink); }
.pill.light:hover { background: var(--on-image); color: var(--ink); }
.pill.light:hover .arrow { background: var(--ink); color: var(--on-image); }

.menu-btn { display: none; grid-column: 13 / -1; justify-self: end; background: none; border: 0; padding: 8px 0; cursor: pointer; color: inherit; font: inherit; text-transform: lowercase; }
.mobile-nav { display: none; }

@media (max-width: 760px) {
  .bar .links, .bar .tag, .bar .contact-link { display: none; }
  .bar .name { grid-column: 1 / 13; }
  .menu-btn { display: block; }
  /* Full-screen menu that sits under the header text */
  .mobile-nav {
    position: fixed; inset: 0; z-index: 40;
    background: var(--paper);
    padding-block: calc(env(safe-area-inset-top, 0px) + var(--bar-h) + 16px) 24px;
    padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
    padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
    flex-direction: column; justify-content: flex-end;
  }
  .mobile-nav.open { display: flex; }
  /* The open menu has its own top row, so the header (which can sit mid-screen on home) is hidden */
  body.menu-open .site-header { visibility: hidden; }
  .mobile-top {
    position: absolute; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: var(--bar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
    padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
    font-size: var(--t-ui); font-weight: 500; text-transform: lowercase;
  }
  .mobile-nav .mobile-top a { font-size: inherit; padding: 0; border: 0; }
  .menu-close { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--ink); cursor: pointer; }
  .mobile-nav a.sub { font-size: 22px; padding-left: 1em; color: var(--grey); }
  .mobile-nav a { font-size: 32px; letter-spacing: -.01em; text-transform: lowercase; text-decoration: none; color: var(--ink); padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Home ---------- */
/* Full-screen image; it slides up under the centered bar. */
.hero {
  position: relative; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 480px;
  margin-top: calc(-50svh - var(--bar-h) / 2);
  background: var(--ink);
}
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero::after { content: ""; position: absolute; inset: 0; background: rgb(5 5 5 / .22); }

.edge {
  padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
  padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
}
.work { padding-block: calc(var(--bar-h) + clamp(24px, 3vw, 48px)) clamp(72px, 9vw, 140px); }
.work-label { font-size: var(--t-ui); color: var(--ink); padding-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 6vw, 96px) 10px; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card { display: grid; gap: 10px; align-content: start; text-decoration: none; }
.card-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--tile); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
a.card:hover .card-img img { transform: scale(1.03); }
.card h3 { font-size: var(--t-ui); font-weight: 400; line-height: 1.25; }
.card p { font-size: var(--t-ui); color: var(--grey); line-height: 1.25; }

.section { padding-block: var(--section); }
.eyebrow { font-size: var(--t-small); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Page titles (about / gallery / contact) ---------- */
.page-title { padding-block: clamp(40px, 6vw, 90px) clamp(24px, 3vw, 40px); }
.page-title h1 { font-size: var(--t-display); letter-spacing: -.02em; padding-bottom: clamp(20px, 2.5vw, 32px); border-bottom: 1px solid var(--line); }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); align-items: start; padding-bottom: var(--section); }
.about figure { margin: 0; display: grid; gap: 14px; }
.about figure img { border-radius: 6px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.about figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.about figcaption strong { display: block; color: var(--ink); font-weight: 500; }
.about figcaption small { color: var(--muted); font-size: var(--t-small); }
.socials { display: flex; gap: 8px; }
.socials a { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background .2s, color .2s; }
.socials a:hover { background: var(--ink); color: var(--paper); }
.socials svg { width: 16px; height: 16px; }
.about-text { display: grid; gap: 1.2em; font-size: var(--t-lead); }
.about-text .pill { justify-self: start; margin-top: 12px; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } }

/* Gallery: masonry columns */
.masonry { columns: 4 260px; column-gap: var(--gap); padding-bottom: var(--section); }
.masonry button { display: block; width: 100%; margin: 0 0 var(--gap); padding: 0; border: 0; background: var(--tile); border-radius: 6px; overflow: hidden; cursor: zoom-in; break-inside: avoid; }
.masonry img { width: 100%; transition: transform .5s; }
.masonry button:hover img { transform: scale(1.03); }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); padding-bottom: var(--section); }
.contact-intro { display: grid; gap: 28px; align-content: start; }
.contact-intro .lead { font-size: var(--t-h3); color: var(--ink); }
.contact-lines { display: grid; gap: 6px; }
.contact-lines a { color: var(--ink); text-decoration: none; font-size: var(--t-lead); width: fit-content; }
.contact-lines a:hover { text-decoration: underline; text-underline-offset: 4px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: var(--t-small); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: transparent; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 0;
  transition: border-color .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.form .pill { justify-self: start; }
.form-note { grid-column: 1 / -1; font-size: var(--t-small); color: var(--muted); min-height: 1.4em; }
@media (max-width: 800px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }

/* ---------- Project pages ---------- */
/* Project hero sits under the transparent nav */
.p-hero { position: relative; margin-top: calc(-1 * var(--bar-h)); }
.p-hero img { width: 100%; height: clamp(360px, 62vw, 900px); object-fit: cover; }
.p-hero::after { content: ""; position: absolute; inset: 0 0 auto; height: 160px; background: linear-gradient(rgb(5 5 5 / .3), rgb(5 5 5 / 0)); pointer-events: none; }
.p-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding-block: clamp(48px, 6vw, 96px); border-bottom: 1px solid var(--line); }
.p-intro h1 { font-size: var(--t-display); letter-spacing: -.02em; }
.p-intro .sub { font-size: var(--t-lead); color: var(--ink); font-weight: 500; margin-top: 14px; }
.p-intro .desc { display: grid; gap: 28px; align-content: end; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.facts div { display: grid; gap: 2px; }
.facts dt { font-size: var(--t-small); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); font-size: 15px; }
@media (max-width: 800px) { .p-intro { grid-template-columns: 1fr; } }

.block { padding-block: clamp(48px, 7vw, 110px); }
.block + .block { padding-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.split.wide-media { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.wide-media.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.split.top { align-items: start; }
.text { display: grid; gap: 1em; align-content: start; min-width: 0; }
.text h2 { font-size: var(--t-h3); letter-spacing: .02em; text-transform: uppercase; margin-bottom: .3em; }
.text h2.big { font-size: var(--t-h2); letter-spacing: 0; }
.text .quote { font-size: var(--t-lead); color: var(--ink); font-weight: 500; }
@media (max-width: 800px) {
  .split, .split.wide-media, .split.wide-media.flip { grid-template-columns: 1fr; }
  .split .text { order: -1; }
}

.media img, .full img, .grid img { width: 100%; border-radius: 4px; background: var(--tile); }
.zoomable { cursor: zoom-in; }
.full { padding-block: clamp(24px, 3vw, 40px); }
.full.bleed img { border-radius: 0; }

.grid { display: grid; gap: clamp(8px, 1.2vw, 16px); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.square img { aspect-ratio: 1.17; object-fit: cover; }
.grid.tall img { aspect-ratio: 0.65; object-fit: cover; }
.grid.landscape img { aspect-ratio: 1.6; object-fit: cover; }
@media (max-width: 900px) {
  .grid.c5, .grid.c6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .grid.c3:not(.keep), .grid.c2 { grid-template-columns: 1fr; }
  .grid.c5, .grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Existing products comparison */
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.product { display: grid; gap: 14px; align-content: start; }
.product img { aspect-ratio: 1.2; object-fit: cover; border-radius: 4px; width: 100%; background: var(--tile); }
.product h3 { font-size: 16px; letter-spacing: .04em; }
.product dl { margin: 0; display: grid; gap: 12px; font-size: 14px; }
.product dt { font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.product dd { margin: 0; }
.product ul { margin: 4px 0 0; padding-left: 1.1em; line-height: 1.55; }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } .product { grid-template-columns: 120px minmax(0, 1fr); align-items: start; } .product img { grid-row: span 2; } }

.opportunity { background: var(--tile); }
.opportunity .wrap { display: grid; gap: 24px; padding-block: clamp(56px, 7vw, 110px); }
.opportunity h2 { font-size: var(--t-h2); }
.opportunity .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 60px); }
@media (max-width: 800px) { .opportunity .cols { grid-template-columns: 1fr; } }

.specs { display: grid; gap: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-size: 12px; letter-spacing: .1em; color: var(--ink); font-weight: 500; padding-top: 3px; }
.specs dd { margin: 0; }

.next { border-top: 1px solid var(--line); }
.next .wrap { padding-block: clamp(40px, 5vw, 72px); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.next a.title { text-decoration: none; color: var(--ink); font-size: var(--t-h2); }
.next a.title:hover { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: clamp(48px, 6vw, 90px) 32px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: clamp(28px, 6vw, 110px); }
.footer-contact { display: grid; gap: 8px; align-content: start; min-width: 0; }
.footer-contact .big { font-size: var(--t-footer); font-weight: 300; color: var(--ink); text-decoration: none; line-height: 1.15; overflow-wrap: anywhere; width: fit-content; }
.footer-contact .big:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col a { text-decoration: none; color: var(--ink); font-size: 15px; width: fit-content; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-col .eyebrow, .footer-contact .eyebrow { margin-bottom: 6px; }
.copyright { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: var(--t-small); color: var(--muted); padding-top: 28px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .footer-contact { grid-column: 1 / -1; } }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(5 5 5 / .9); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; padding: clamp(16px, 4vw, 56px); cursor: zoom-out; }
.lightbox .close { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); font-size: 22px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
