/* ==========================================================================
   EDITORIAL REBUILD — global foundation (variables, reset, type scale,
   asymmetric grid + reveal utilities). See roadmap.md for the full design
   rationale. Component rules further down (.panel, .hero, .page-shell, etc.)
   belong to the previous design and are left in place, unused by the new
   index.html, until the sections that replace them are fully built out.
   ========================================================================== */

:root {
  /* One consistent shade throughout the site — no dark-mode variant. */
  --bg: #f7f4ee;
  --surface: #fcfbf8;
  --text: #1d1b19;
  --muted: #6f675f;
  --accent: #886c24;
  --accent-strong: #785907;
  --border: rgba(29, 27, 25, 0.12);
  --shadow: 0 24px 60px rgba(29, 27, 25, 0.08);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --type-display: clamp(3.5rem, 9vw, 8.5rem);
  --type-heading: clamp(2rem, 4vw, 3.25rem);
  --type-label-size: 0.72rem;
  --tracking-label: 0.18em;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(120, 89, 7, 0.14), transparent 25%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* Oversized architectural heading — the brand serif pushed to genuinely
   dramatic scale, tightened, rather than a different display face. */
.type-display {
  font-family: var(--font-display);
  font-size: var(--type-display);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}

.type-heading {
  font-family: var(--font-display);
  font-size: var(--type-heading);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Vertical rhythm between editorial sections — generous negative space
   instead of the old tight panel-card stacking. */
.editorial-section {
  padding: clamp(4rem, 10vw, 9rem) 0;
}

/* Small tracked-out monospace label/metadata — the contrast note to the
   oversized display type; doesn't exist anywhere in the previous type system. */
.label-mono {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--type-label-size);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent-strong);
}

/* Full-bleed editorial container with generous, asymmetric side margins
   rather than a centered fixed-width column. */
.editorial-shell {
  width: 100%;
  padding: 0 clamp(1.25rem, 6vw, 5rem);
}

/* Two-column asymmetric layout (content-heavy / narrow), collapsing to a
   single column on narrow viewports. */
.grid-asymmetric {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 5vw, 4rem);
}

@media (max-width: 860px) {
  .grid-asymmetric {
    grid-template-columns: 1fr;
  }
}

/* Mask-reveal: content clips in from below rather than just fading, via an
   overflow-hidden wrapper (add .reveal-mask to a parent) around a
   .reveal-mask-inner child that translates. */
.reveal-mask {
  overflow: hidden;
}

.reveal-mask-inner {
  transform: translateY(100%);
  transition: transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-mask.is-revealed .reveal-mask-inner {
  transform: translateY(0);
}

/* Stagger group: theme-scroll.js sets --stagger-index on each child when the
   group enters view; children fade/rise the same way as .reveal but offset
   from one another instead of all at once. */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 560ms ease, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--stagger-index, 0) * 90ms);
}

.reveal-stagger.is-revealed > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-mask-inner,
  .reveal-stagger > * {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* Cursor-reactive 3D tilt (theme-scroll.js sets --tilt-x/--tilt-y inline on
   pointermove within the card, resets to 0 on pointerleave — the transition
   is what makes the reset ease back rather than snap). */
.tilt-card {
  transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Scroll-driven parallax and the heading scroll-centering tilt are both set
   directly via inline style every frame in theme-scroll.js (no CSS
   transition — they track scroll position 1:1 instead of easing toward it). */
[data-depth],
[data-tilt-heading] {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .tilt-card {
    transition: none;
  }
}

/* ---- New editorial sections (structural pass — see roadmap.md for what's
   deferred to a later art-direction pass) ---- */

/* "Signature split" hero — an asymmetric two-column layout (copy left, a
   giant faint watermark of the flat brand mark right) replacing the
   earlier centered/HUD-framed hero built around hero-icon.js (removed;
   see roadmap.md's Change Log). Same 7fr/5fr ratio as .grid-asymmetric
   elsewhere on the page, for the same "content-heavy / narrow" language.
   Framed as a single card sitting on the page — rounded corners, a border,
   and the same drop shadow the old .panel convention used — rather than
   full-bleed to the viewport edges, per the client's "should look like a
   business card" note; <main>'s own padding (24px/19.2px/48px) already
   supplies the inset that keeps it from touching the browser edges. */
.hero-split {
  min-height: 88vh;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-split-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 2rem);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem)
    clamp(1.25rem, 6vw, 5rem);
  border-right: 1px solid var(--border);
}

.hero-split-heading {
  font-size: clamp(2.5rem, 4.4vw, 4.25rem);
  line-height: 1.02;
  max-width: 620px;
}

.hero-split-copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 520px;
}

.hero-split-copy p {
  margin: 0;
}

/* Left-aligned instead of .hero-actions's site-wide centered default — the
   split layout's copy block isn't centered text, so its CTAs shouldn't be
   either — and the gap above already comes from .hero-split-copy's own
   flex gap, not .hero-actions's centered-hero margin-top. */
.hero-split-copy .hero-actions {
  justify-content: flex-start;
  margin-top: 0;
}

/* The right panel: a slightly brighter surface than the page background so
   the split reads as two distinct panels, not just copy floating on the
   same ground. */
.hero-split-visual {
  position: relative;
  background: var(--surface);
  overflow: hidden;
}

/* The flat mark itself, hugely scaled and nearly invisible — brand texture
   for the panel rather than a second logo competing with the real one. */
.hero-split-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 82%;
  transform: translate(-50%, -50%);
  opacity: 0.09;
  pointer-events: none;
}

/* The real, legible lockup — same file as the header brand — anchored in
   the corner so the panel still reads as identifiably "Novation Ghost" up
   close, not just an abstract watermark. */
.hero-split-brand {
  position: absolute;
  left: clamp(1.5rem, 4vw, 2.5rem);
  bottom: clamp(1.5rem, 4vw, 2.5rem);
  width: clamp(120px, 12vw, 160px);
}

@media (max-width: 860px) {
  .hero-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-split-content {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: clamp(3rem, 10vw, 4rem) clamp(1.25rem, 6vw, 2rem) clamp(2rem, 6vw, 2.5rem);
  }

  .hero-split-visual {
    min-height: 220px;
  }

  .hero-split-watermark {
    width: 55%;
  }
}

.approach-list {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

@media (min-width: 700px) {
  .approach-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.approach-item .label-mono {
  display: block;
  margin-bottom: 0.75rem;
}

.service-index-list {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.service-index-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.service-index-row .label-mono {
  color: var(--muted);
}

.project-entry {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  border-bottom: 1px solid var(--border);
}

.project-entry:first-child {
  border-top: 1px solid var(--border);
}

.project-entry .type-heading {
  margin: 0.75rem 0 1rem;
}

.project-placeholder-tag {
  color: var(--accent);
}

.contact-editorial .contact-form {
  max-width: 520px;
}

.cta-editorial {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
}

/*
  Each section's content fades and slides up as it scrolls into view, and
  resets when it leaves so scrolling back up and down again re-triggers the
  reveal (see script.js's IntersectionObserver). Skipped under reduced
  motion — content just stays visible instead of animating in.
*/
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  background: rgba(247, 244, 238, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 52px;
  width: auto;
  max-width: none;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--accent-strong);
}

main {
  padding: 1.5rem 1.2rem 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  max-width: 1080px;
  min-height: 82vh;
  margin: 0 auto 1.5rem;
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Overrides .panel's opaque card so the 3D scene (z-index:-1, three-scene.js)
     is actually visible behind the hero instead of hidden under a solid card. */
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero::after {
  content: '';
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(220px, 45vw);
  aspect-ratio: 158 / 141;
  background-image: url('assets/logo-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section-heading .eyebrow,
.page-copy .eyebrow,
.cta-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.section-heading .eyebrow::before,
.page-copy .eyebrow::before,
.cta-panel .eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 14px;
  background-image: url('assets/logo-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

h1,
h2,
h3 {
  font-family: 'Cormorant Garamond', serif;
  line-height: 1.1;
  margin: 0 0 0.8rem;
}

h1 {
  font-size: clamp(2.4rem, 4.8vw, 4.1rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.hero p,
.story-card p,
.service-grid p,
.page-copy p,
.contact-form label,
.site-footer p {
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.hero-highlights {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.hero-highlights div {
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: rgba(120, 89, 7, 0.12);
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 600;
}

.button {
  display: inline-block;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 30px rgba(120, 89, 7, 0.25);
}

.button.secondary {
  color: var(--text);
  border: 1px solid var(--border);
  background: #fff;
}

.story-section,
.services-overview,
.cta-panel {
  max-width: 1080px;
  margin: 2rem auto 0;
}

.section-heading {
  max-width: 760px;
  margin: 0 0 1.25rem;
}

.section-copy {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.story-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 38vw);
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.3rem 0.2rem 0.6rem;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.story-track::-webkit-scrollbar {
  display: none;
}

.story-card {
  min-height: 40vh;
  padding: 2rem;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 32px;
}

.services-overview,
.cta-panel,
.page-shell {
  padding: 2rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.service-grid article,
.page-list div,
.contact-form {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(120, 89, 7, 0.08);
  border: 1px solid var(--border);
}

.service-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  transition: max-height 280ms ease, opacity 220ms ease, margin 280ms ease;
}

.service-detail.is-expanded {
  max-height: 400px;
  opacity: 1;
  margin: 0.75rem 0 0;
}

.detail-toggle {
  display: inline-flex;
  margin-top: 0.6rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.detail-toggle:hover {
  text-decoration: underline;
}

.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-shell {
  max-width: 860px;
  margin: 2rem auto 0;
}

.page-copy {
  padding: 0 0 1rem;
}

.page-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--text);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-status {
  margin: 0;
  font-size: 0.95rem;
  min-height: 1.2em;
}

.form-status[data-state="success"] {
  color: #2f6b3a;
}

.form-status[data-state="error"] {
  color: #a03b3b;
}

.button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 0 1.2rem 2rem;
}

.footer-mark {
  height: 22px;
  width: auto;
  opacity: 0.75;
}

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .cta-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    min-height: auto;
    padding: 3rem 1.2rem;
  }

  .story-track {
    grid-auto-columns: minmax(84vw, 84vw);
  }
}
