/* ============================================================
   THE EDGE — preview3 (Gridgeist redesign)
   Thesis: image-led build-record portfolio. Let project
   photography lead; pace with a quiet alignment grid, warm
   editorial type, and a "site documentation" motif (index
   numbers, project IDs, material/scope notes) so the site
   reads as a build record, not a presentation.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  /* paper + ink, warm but more "spec-sheet" than the current warm linen */
  --paper: #efebe2;
  --surface: #faf7f1;
  --ink: #16130f;
  --ink-soft: #4c463e;
  --muted: #7a7267;
  --line: rgba(22, 19, 15, 0.14);
  --line-strong: rgba(22, 19, 15, 0.30);
  /* burnt-orange material accent (powder-coated steel / raw timber territory) */
  --accent: #b0532a;
  --accent-soft: rgba(176, 83, 42, 0.12);
  --ok: #3f6b4f;
  --shadow: 0 24px 60px rgba(22, 19, 15, 0.14);
  --maxw: 1220px;
  --gutter: clamp(20px, 4vw, 44px);
  /* mono for project IDs / specs — the "build record" voice */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -6%, rgba(176,83,42,0.07), transparent 36%),
    linear-gradient(180deg, #f3efe7 0%, var(--paper) 46%, #eae4d9 100%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button, input, textarea { font: inherit; }

.container {
  width: min(100% - var(--gutter), var(--maxw));
  margin: 0 auto;
}

/* ---------- top utility strip (site-doc flavor) ---------- */
.doc-strip {
  border-bottom: 1px solid var(--line);
  background: rgba(239, 235, 226, 0.85);
}
.doc-strip .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; padding: 8px 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.doc-strip .ds-right { display: flex; gap: 20px; align-items: center; }
.doc-strip .ds-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(243, 239, 230, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.brand { display: inline-flex; flex-direction: column; gap: 2px; }
.brand-logo { width: 150px; max-width: 100%; height: auto; }
.brand-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.24em; color: var(--muted); }
.nav-wrap { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  position: relative;
  font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); padding: 6px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-utility {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 15px;
  border: 1px solid var(--line-strong); border-radius: 2px;
  background: var(--surface); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink); transition: border-color .2s, background .2s;
}
.nav-utility:hover { border-color: var(--accent); background: #fff; }
.nav-toggle { display: none; align-items: center; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 2px; padding: 9px 13px; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.16em; cursor: pointer; }
.mobile-only { display: none; }

.site-main { padding-top: 0; }

/* ---------- type ---------- */
h1, h2, h3, h4, .display { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: clamp(46px, 7.5vw, 96px); line-height: 0.96; }
h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.0; }
h3 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.08; }
h4 { font-size: 21px; line-height: 1.15; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content:""; width: 32px; height: 2px; background: var(--accent); }
.section-label {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
}

/* ---------- hero ----------
   ASYMMETRIC + DYNAMIC: the hero is a rotating, editorial composition.
   - grid split is ~38/62 (not the symmetric 50/50 an AI template defaults to)
   - the right media side layers N project images that crossfade on a timer;
     which slide renders first is chosen by JS per visit, so the hero is never
     the same twice and there is always a sensible static fallback (slide 1).
   - annotation chips/labels overlap the image so it reads like an archiving
     sheet, not a clean digital template.
*/
.hero {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); /* ~41/59 — column wide enough to hold the headline lines */
  min-height: calc(100svh - 60px);
  background: #423a31; overflow: hidden;
}
/* rotating media side */
.hero-media { position: relative; min-height: 78svh; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  background-size: cover; background-position: center; transform: scale(1.02); }
.hero-slide.is-on { opacity: 1; }
.hero-slide::after { content:""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,12,10,0.10) 0%, rgba(15,12,10,0.0) 45%, rgba(15,12,10,0.38) 100%); }
/* identity chip overlapping the image (bottom-left of media) */
.shot-flag {
  position: absolute; z-index: 3; left: 0; bottom: 0;
  background: var(--surface); color: var(--ink);
  padding: 14px 20px 16px; width: min(78%, 360px);
  box-shadow: 10px 10px 0 rgba(15,12,10,0.18); border-radius: 2px 2px 0 0;
}
.shot-flag .sf-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.shot-flag .sf-title { font-family: var(--serif); font-size: 26px; line-height: 1.05; }
.shot-flag .sf-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
/* progress bars for the rotation */
.hero-ticks { position: absolute; z-index: 4; right: 22px; bottom: 20px; display: flex; gap: 6px; }
.hero-ticks span { width: 34px; height: 3px; background: rgba(255,255,255,0.32); border-radius: 2px; }
.hero-ticks span.on { background: var(--accent); }

/* content side (offset, asymmetric, oversized display) */
.hero-copy {
  position: relative; z-index: 2; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 22px; padding: clamp(30px, 5vw, 72px);
  color: var(--ink); background: linear-gradient(180deg, #f3efe7 0%, #ece5d9 100%);
  padding-bottom: clamp(56px, 7vw, 96px); /* leave room for the overlapping flag */
}
.hero-copy h1 {
  font-size: clamp(48px, 5.5vw, 84px); /* oversized but every line fits the column */
  line-height: 1.02; letter-spacing: -0.012em;
  max-width: 100%;              /* never overflow the column into the image */
  overflow-wrap: break-word;    /* last resort; won't hyphenate a word if it fits */
}
.hero-copy .eyebrow { color: var(--ink-soft); }
.hero-copy .eyebrow::before { background: var(--accent); width: 44px; height: 2px; }
.hero-copy .lead { max-width: 500px; font-size: 17.5px; color: var(--ink-soft); }
/* oversized stat block hugging the bottom for drama */
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: clamp(18px, 3vw, 40px); margin-top: 8px; }
.hero-stat strong { font-family: var(--serif); font-size: clamp(44px, 5vw, 64px); font-weight: 600; color: var(--ink); line-height: 1; }
.hero-stat span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); display: block; margin-top: 4px; }
.hero-aside {
  max-width: 340px; padding: 18px 20px; border-left: 3px solid var(--accent);
  background: var(--surface); box-shadow: 10px 10px 0 rgba(22,19,15,0.06);
  font-size: 13px; color: var(--ink-soft); line-height: 1.7;
}
.hero-aside strong { display: block; margin-bottom: 6px; font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.hero-notes { max-width: 340px; padding: 16px 18px;
  border: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-soft);
  background: rgba(250,247,241,0.6); }
.hero-notes strong { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* ---------- buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  padding: 0 22px; border-radius: 2px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em; border: 1px solid transparent;
  transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #94421f; }
.btn-secondary { border-color: rgba(255,255,255,0.5); color: #fff; background: transparent; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 108px) 0; }
.section-topline { display: grid; gap: 16px; margin-bottom: 40px; max-width: 760px; }
.statement-band { border-block: 1px solid var(--line); background: rgba(250,247,241,0.72); }
.statement-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 30px; align-items: start; }
.statement-kicker { padding-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); }
.statement-copy p { margin: 0; font-family: var(--serif); font-size: clamp(22px, 3vw, 34px); line-height: 1.3; }

/* ---------- media frames (image-led) ---------- */
.media-frame {
  position: relative; overflow: hidden; min-height: 340px; background: #d8cfc2;
}
.media-frame.tall { min-height: 640px; }
.media-frame.medium { min-height: 520px; }
.media-frame::before { content:""; position: absolute; inset: 0;
  background-image: var(--media-image); background-size: cover; background-position: center;
  transform: scale(1.02); transition: transform .6s ease; }
.media-frame:hover::before { transform: scale(1.06); }
.media-caption { position: absolute; inset: auto 0 0; padding: 20px 22px 18px;
  background: linear-gradient(180deg, rgba(15,12,10,0) 0%, rgba(15,12,10,0.82) 100%); color: rgba(255,255,255,0.9); }
.media-caption strong { display: block; margin-bottom: 3px; font-family: var(--serif); font-size: 26px; color: #fff; }
.media-caption span { font-size: 12.5px; letter-spacing: 0.05em; }

/* ---------- feature work ---------- */
.feature-work { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,0.8fr); gap: 32px; align-items: end; }
.feature-copy { display: grid; gap: 24px; }
.works-overview { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; }
.works-list { display: grid; gap: 22px; }
.works-row { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.works-row strong { display: block; margin-bottom: 5px; font-family: var(--serif); font-size: 28px; }
.works-row p { margin: 0; color: var(--muted); font-size: 14px; }
.works-row span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); justify-self: end; padding-top: 6px; }

/* ---------- project grid (non-uniform asymmetric mosaic) ---------- */
.project-grid { display: grid; gap: clamp(20px, 3vw, 40px);
  grid-template-columns: repeat(6, 1fr); grid-auto-rows: 72px; }
.project-item { display: grid; gap: 14px; align-content: start; }
.project-item .media-frame { min-height: 100%; position: relative; overflow: hidden; }
/* deliberately varied spans — every card occupies a different footprint so
   the grid reads like a working index, not a uniform 3-column template */
.project-item:nth-child(6n+1) { grid-column: 1 / 4; grid-row: span 7; }
.project-item:nth-child(6n+2) { grid-column: 4 / 7; grid-row: span 5; align-self: end; }
.project-item:nth-child(6n+3) { grid-column: 1 / 4; grid-row: span 5; }
.project-item:nth-child(6n+4) { grid-column: 4 / 7; grid-row: span 7; }
.project-item:nth-child(6n+5) { grid-column: 1 / 5; grid-row: span 6; }
.project-item:nth-child(6n+6) { grid-column: 5 / 7; grid-row: span 6; align-self: end; }
/* annotation chip overlaying each project image (build-record label) */
.project-tag { position: absolute; left: 0; bottom: 0; z-index: 2;
  background: var(--surface); color: var(--ink); padding: 7px 11px 8px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; box-shadow: 6px 6px 0 rgba(15,12,10,0.16); }
.project-id { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted); }
.project-meta { display: grid; gap: 5px; }
.project-type { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); }
.project-meta p, .service-copy p, .contact-column p, .contact-list p { margin: 0; color: var(--muted); }

/* ---------- services (indexed spec list) ---------- */
.service-stack { display: grid; gap: 0; }
.service-row {
  display: grid; grid-template-columns: 180px minmax(0,1fr) auto; gap: 26px; align-items: start;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-index { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.service-copy { display: grid; gap: 8px; }
.service-copy h3 { max-width: 560px; }
.service-spec { justify-self: end; align-self: start; text-align: right;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* ---------- image band (full-bleed) ---------- */
.image-band { position: relative; min-height: 72svh; overflow: hidden; background: #221c17; }
.image-band::before { content:""; position: absolute; inset: 0;
  background-image: var(--band-image); background-size: cover; background-position: center; transform: scale(1.02); }
.image-band::after { content:""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(17,13,11,0.1) 0%, rgba(17,13,11,0.6) 100%); }
.image-band-copy { position: relative; z-index: 1; display: flex; align-items: end; min-height: 72svh; padding: 44px 0; }
.image-band-copy .copy-box { max-width: 560px; color: #f7f1e9; }
.copy-box .section-label { color: rgba(255,255,255,0.72); }
.copy-box p { margin: 14px 0 0; color: rgba(247,241,233,0.84); }

/* ---------- contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0,0.9fr) minmax(0,1.1fr); gap: 34px; }
.contact-list { display: grid; gap: 20px; padding-top: 24px; border-top: 1px solid var(--line-strong); }
.contact-line { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 14px; align-items: baseline; }
.contact-line strong { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.contact-links a { padding-bottom: 3px; border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- footer ---------- */
.footer { padding: 34px 0 42px; border-top: 1px solid var(--line); }
.footer-grid { display: flex; justify-content: space-between; gap: 18px; align-items: center;
  color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.footer-social { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-social a { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; }
.footer-social a:hover { color: var(--accent); }

/* ---------- motion / reveal ----------
   Base state = visible by default. Animation only as progressive
   enhancement (added by a .js-enabled class / reduced-motion guard),
   so content is NEVER hidden if JS or animation is unavailable. */
.reveal, .hero-rise { opacity: 1; transform: none; }
body.js-anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
body.js-anim .reveal.is-visible { opacity: 1; transform: translateY(0); }
body.js-anim .hero-rise { opacity: 0; transform: translateY(20px); animation: rise .8s ease forwards; }
body.js-anim .hero-rise.d1 { animation-delay: .12s; } .hero-rise.d2 { animation-delay: .24s; } .hero-rise.d3 { animation-delay: .36s; }
@keyframes rise { to { opacity:1; transform: translateY(0); } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { min-height: 52svh; }
  .shot-flag { width: 88%; }
  .hero-copy { padding: clamp(24px, 5vw, 48px); padding-bottom: 72px; }
  .hero-copy h1 { font-size: clamp(56px, 14vw, 84px); }
  .feature-work, .works-overview, .contact-layout, .statement-layout { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .service-row { grid-template-columns: 1fr; gap: 10px; }
  .service-copy h3 { max-width: none; }
  .service-spec { justify-self: start; text-align: left; }
  .image-band, .image-band-copy { min-height: 58svh; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .desktop-only { display: none; }
  .mobile-only { display: inline-flex; }
  .nav-links { position: absolute; top: calc(100% + 10px); right: var(--gutter);
    flex-direction: column; align-items: flex-start; min-width: 220px; padding: 18px;
    background: rgba(250,247,241,0.98); border: 1px solid var(--line); box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: opacity .2s, transform .2s; }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-links .nav-utility { margin-top: 10px; }
  .works-row, .contact-line { grid-template-columns: 1fr; }
  .works-row span { justify-self: start; padding-top: 0; }
  .contact-line { gap: 4px; }
  .hero-stats { grid-template-columns: repeat(3, auto); }
}
@media (max-width: 640px) {
  .container { width: min(100% - 24px, var(--maxw)); }
  .brand-logo { width: 128px; }
  .doc-strip .ds-right { gap: 12px; }
  .doc-strip .ds-meta { display: none; }
  h1 { font-size: clamp(38px, 13vw, 60px); }
  h2 { font-size: clamp(28px, 9vw, 42px); }
  .lead, .statement-copy p { font-size: 17px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .section { padding: 60px 0; }
  .media-frame.tall { min-height: 480px; }
  .media-frame.medium, .project-item .media-frame { min-height: 300px; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
  .hero-stats { grid-template-columns: 1fr; gap: 16px; }
  .project-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
