/* ==========================================================================
   Finwall Landing Page — site.css
   Depends on: Finwall Classic Design System/colors_and_type.css
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

img { display: block; max-width: 100%; }

::selection { background: var(--fw-accent); color: #fff; }

/* --- Layout --------------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 96px;
}

.section         { padding: 120px 0; }
.section-white   { background: var(--fw-white); }
.section-canvas  { background: var(--fw-canvas); }

/* --- Sticky Header -------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 96px;
  padding-left: max(96px, env(safe-area-inset-left));
  padding-right: max(96px, env(safe-area-inset-right));
  background: rgba(255,255,255,0.84);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity var(--dur-normal) var(--ease-standard),
    transform var(--dur-normal) var(--ease-standard);
}

.site-header.header-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.header-lockup { height: 22px; width: auto; }

/* --- Hero ----------------------------------------------------------------- */
.section-hero {
  display: grid;
  grid-template-columns: 5fr 6fr;
  min-height: 100vh;
  background: var(--fw-ink);
  overflow: hidden;
}

/* Left column — text. Padding-left scales with viewport so text doesn't
   strand on the far left of large displays. */
.hero-left {
  display: flex;
  flex-direction: column;
  padding-top: 48px;
  padding-right: 64px;
  padding-bottom: 72px;
  padding-left: clamp(96px, calc((100vw - 1100px) / 2), 320px);
  position: relative;
  z-index: 2;
}

/* Subtle divider between columns */
.hero-left::after {
  content: '';
  position: absolute;
  right: 0; top: 56px; bottom: 56px;
  width: 1px;
  background: rgba(255,255,255,0.07);
}

.hero-brand { flex-shrink: 0; }

.hero-wordmark { height: 26px; width: auto; }

.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 48px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-4xl);       /* 48px — tighter than before */
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--fw-white);
  margin-bottom: 24px;
  animation: hero-rise 0.9s var(--ease-emphatic) both;
  animation-delay: 0.05s;
}

.hero-lineage {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.01em;
  max-width: 340px;
  animation: hero-rise 0.9s var(--ease-emphatic) both;
  animation-delay: 0.2s;
}

/* Hero logos — IHC + Judan, rendered in white against the dark hero */
.hero-logos {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  animation: hero-rise 0.9s var(--ease-emphatic) both;
  animation-delay: 0.35s;
}

.hero-logo-ihc {
  height: 38px;
  width: auto;
  /* Pure white silhouette — PNG with transparency */
  filter: brightness(0) invert(1);
  opacity: 0.78;
}

/* Judan: 1080x1080 JPG with the wordmark+subtitle lockup occupying ~14-86%
   horizontally and ~42-61% vertically. Frame crops to the lockup region;
   filter inverts so the wordmark renders white and the original white
   background turns black, merging with the pure-black hero. The red accent
   blocks lift to white via the brightness boost. Frame is sized to match
   IHC's 38px visual height with generous horizontal margin so no edge clips. */
.hero-logo-frame {
  height: 38px;
  width: 140px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
}

.hero-logo-judan {
  height: 190px;
  width: 190px;
  max-width: none;
  flex-shrink: 0;
  margin-top: -79px;
  margin-left: -25px;
  filter: invert(1) grayscale(1) brightness(2);
  opacity: 0.78;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Right column — visual */
.hero-right {
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.hero-right:active { cursor: grabbing; }

/* Subtle CRT scanline texture */
.hero-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent        0px,
    transparent        2px,
    rgba(0,0,0,0.055)  2px,
    rgba(0,0,0,0.055)  3px
  );
  pointer-events: none;
  z-index: 5;
}

/* Vignette — focuses eye on centre of visual */
.hero-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 52% 50%,
    transparent 28%,
    rgba(0,0,0,0.52) 100%
  );
  pointer-events: none;
  z-index: 4;
}

/* Ecosystem stage — 3D spoke-and-wheel */
.ecosystem-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#ecosystem-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

/* Concentric ring guides — faint background reference */
.hero-right .ecosystem-stage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 720px;
  height: 720px;
  margin: -360px 0 0 -360px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
  z-index: 0;
}

/* --- Section label -------------------------------------------------------- */
.section-label { margin-bottom: 28px; }

/* --- Section lead --------------------------------------------------------- */
.section-lead {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
  max-width: 680px;
  margin-bottom: 64px;
}

/* --- What We Do ----------------------------------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-1);
  padding-top: 48px;
}

.text-block { padding-right: 64px; position: relative; }

.text-block + .text-block {
  padding-right: 0;
  padding-left: 64px;
  border-left: 1px solid var(--border-1);
}

.block-marker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  color: var(--fg-3);
}

.block-num {
  font-family: var(--font-display);
  font-weight: var(--fw-thin);
  font-size: var(--text-3xl);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--fw-haze);
}

.block-glyph {
  color: var(--fg-2);
  flex-shrink: 0;
}

.block-heading {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-2xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
  margin-bottom: 16px;
}

.text-block .fw-body {
  color: var(--fg-2);
  line-height: var(--lh-relaxed);
}

/* --- How We Work ---------------------------------------------------------- */
/* Tighter section padding for How We Work specifically */
.section-tight { padding: 80px 0; }

.section-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
}

.scroll-hint {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: var(--text-xs);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--fg-4);
}

/* Horizontal scrolling card row */
.process-steps {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--fw-mist) transparent;
}

.process-steps::-webkit-scrollbar {
  height: 4px;
}
.process-steps::-webkit-scrollbar-track {
  background: transparent;
}
.process-steps::-webkit-scrollbar-thumb {
  background: var(--fw-mist);
  border-radius: 2px;
}

.process-step {
  flex: 0 0 320px;
  scroll-snap-align: start;
  background: var(--fw-white);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s var(--ease-emphatic),
    transform 0.6s var(--ease-emphatic),
    border-color var(--dur-fast) var(--ease-standard);
}

.process-step:hover {
  border-color: var(--fw-mist);
}

.process-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.process-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.step-number {
  font-family: var(--font-display);
  font-weight: var(--fw-thin);
  font-size: var(--text-2xl);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fw-mist);
  user-select: none;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-heading {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
}

.step-content .fw-body {
  color: var(--fg-2);
  line-height: var(--lh-relaxed);
  font-size: var(--text-sm);
}

/* --- Thesis --------------------------------------------------------------- */
.thesis-lead { max-width: 760px; }

.thesis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--border-1);
}

.thesis-glyph {
  height: 88px;
  margin-bottom: 32px;
  color: var(--fg-2);
  display: flex;
  align-items: center;
}

.thesis-item {
  padding: 48px 48px 48px 0;
  border-right: 1px solid var(--border-1);
}

.thesis-item:nth-child(2) { padding-left: 48px; }

.thesis-item:last-child {
  padding-left: 48px;
  padding-right: 0;
  border-right: none;
}

.thesis-heading {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
  margin-bottom: 16px;
}

.thesis-item .fw-body {
  color: var(--fg-2);
  line-height: var(--lh-relaxed);
}

/* --- Backed By: Stats Strip ---------------------------------------------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 80px;
}

.stat {
  padding: 40px 48px 40px 0;
  border-right: 1px solid var(--border-1);
}
.stat:nth-child(2) { padding-left: 48px; }
.stat:last-child   { padding-left: 48px; padding-right: 0; border-right: none; }

.stat-figure {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-5xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.stat-plus {
  color: var(--fw-accent);
  font-weight: var(--fw-bold);
  margin-left: 2px;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  color: var(--fg-3);
  max-width: 240px;
}

.stat-label sup {
  font-size: 0.65em;
  color: var(--fg-4);
}

/* --- Contact -------------------------------------------------------------- */
.contact-framing { color: var(--fg-2); }

.contact-body {
  display: grid;
  grid-template-columns: 5fr 4fr;
  gap: 64px;
  align-items: stretch;
  border-top: 1px solid var(--border-1);
  padding-top: 48px;
  margin-top: 40px;
}

.contact-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.contact-email {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-3xl);
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
  text-decoration: none;
  display: inline-block;
  width: max-content;
  transition: color var(--dur-fast) var(--ease-standard);
}

.contact-email:hover { color: var(--fw-accent); }

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-location {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-loc-name {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-md);
  color: var(--fg-1);
  letter-spacing: var(--tr-heading);
}

.contact-coords {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-4);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.contact-right {
  position: relative;
  min-height: 240px;
}

.coord-grid {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--fg-3);
  background: var(--fw-canvas);
}

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--fw-ink);
  padding: 64px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-wordmark  {
  height: 22px;
  width: auto;
  align-self: flex-start;   /* prevent flex stretch */
  flex-shrink: 0;
  margin-bottom: 4px;
}

.footer-lineage {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.35);
  line-height: var(--lh-body);
}

.footer-copy {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.2);
}

/* --- Responsive: 1280px --------------------------------------------------- */
@media (max-width: 1280px) {
  .hero-left { padding: 44px 56px 64px 96px; }
}

/* --- Responsive: 1024px --------------------------------------------------- */
@media (max-width: 1024px) {
  .container    { padding: 0 48px; }
  .site-header  { padding: 0 48px; }
  .hero-left    { padding: 36px 40px 56px 64px; }

  .hero-headline { font-size: var(--text-3xl); }

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

  .thesis-item:last-child {
    grid-column: 1 / -1;
    border-right: none;
    border-top: 1px solid var(--border-1);
    padding: 40px 0 0;
  }
  .thesis-item:nth-child(2) { border-right: none; }
}

/* --- Responsive: 768px ---------------------------------------------------- */
@media (max-width: 768px) {
  .container   {
    padding: 0 24px;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  .section     { padding: 80px 0; }
  .site-header {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }

  /* Stack hero vertically on mobile */
  .section-hero { grid-template-columns: 1fr; grid-template-rows: auto 56vw; }

  .hero-left {
    padding: 28px 24px 48px;
    border-right: none;
  }
  .hero-left::after { display: none; }

  .hero-headline { font-size: var(--text-2xl); }

  .section-lead {
    font-size: var(--text-md);
    margin-bottom: 40px;
  }

  .two-col { grid-template-columns: 1fr; padding-top: 40px; }
  .text-block { padding-right: 0; padding-bottom: 40px; }
  .text-block + .text-block {
    padding-left: 0;
    padding-bottom: 0;
    border-left: none;
    border-top: 1px solid var(--border-1);
    padding-top: 40px;
  }

  .thesis-grid { grid-template-columns: 1fr; }
  .thesis-item,
  .thesis-item:nth-child(2),
  .thesis-item:last-child {
    border-right: none;
    border-top: 1px solid var(--border-1);
    padding: 32px 0;
    grid-column: auto;
  }
  .thesis-item:first-child { border-top: none; padding-top: 32px; }

  .process-step  { flex: 0 0 280px; padding: 24px 24px 28px; }

  .stats-strip   { grid-template-columns: 1fr; }
  .stat          { padding: 28px 0; border-right: none; border-bottom: 1px solid var(--border-1); }
  .stat:nth-child(2),
  .stat:last-child { padding-left: 0; padding-right: 0; }
  .stat:last-child { border-bottom: none; }
  .stat-figure   { font-size: var(--text-4xl); }

  .contact-body  { grid-template-columns: 1fr; gap: 32px; }
  .contact-right { min-height: 200px; }

  .contact-email { font-size: var(--text-2xl); }

  .hero-logos    { gap: 24px; margin-top: 36px; padding-top: 20px; }
  .hero-logo-ihc { height: 32px; }
  .hero-logo-frame { height: 32px; width: 116px; }
  .hero-logo-judan {
    height: 160px;
    width: 160px;
    margin-top: -66px;
    margin-left: -21px;
  }
}

/* --- Responsive: 480px (small phones) ------------------------------------ */
@media (max-width: 480px) {
  .container   {
    padding: 0 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .section     { padding: 64px 0; }
  .section-tight { padding: 56px 0; }

  .section-hero { grid-template-rows: auto 68vw; }
  .hero-left   { padding: 24px 20px 40px; }
  .hero-headline { font-size: var(--text-xl); }

  .stat-figure   { font-size: var(--text-3xl); }
  .contact-email { font-size: var(--text-xl); }

  .process-step  { flex: 0 0 260px; padding: 22px; }
  .footer-inner  { padding-left: 0; padding-right: 0; }
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .process-step { opacity: 1; transform: none; }
  .hero-headline,
  .hero-lineage,
  .hero-logos { animation: none; opacity: 1; transform: none; }
}

/* --- Touch / coarse-pointer devices -------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  .hero-right,
  .hero-right:active,
  #ecosystem-canvas { cursor: default; }
}
