/* Geometry Lab home — kraft / die-cut editorial (not purple-glass AI default) */
:root {
  --home-paper: #f3ebe0;
  --home-paper-deep: #e6d9c8;
  --home-ink: #1a1612;
  --home-muted: #5c5348;
  --home-cut: #b83228;
  --home-crease: #2a6f7f;
  /* Screen px (with non-scaling-stroke) — same dash/gap on every crease */
  --home-crease-dash: 8;
  --home-crease-gap: 6;
  --home-accent: #c45c26;
  --home-panel: rgba(255, 252, 247, 0.88);
  --font-display: "Syne", "Noto Serif SC", "Songti SC", serif;
  --font-body: "DM Sans", "Noto Sans SC", "PingFang SC", sans-serif;
}

html.home,
html.home body {
  background: var(--home-paper);
  color: var(--home-ink);
  font-family: var(--font-body);
}

html.home body {
  min-height: 100%;
  overflow-x: hidden;
}

/* —— Top bar on home —— */
html.home .top.home-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 235, 224, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26, 22, 18, 0.08);
}

html.home .top.home-top h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

html.home .top.home-top .brand-text {
  line-height: 22px;
  height: 22px;
}

html.home .top .nav-link.is-active {
  background: rgba(26, 22, 18, 0.1);
  color: var(--home-ink);
}

/* Match Library / Studio header badge (styles.css .badge) — no home-theme override */
html.home .badge {
  font-family: var(--font);
  border-color: var(--line-strong);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 8px;
  font-weight: 500;
  padding: 0 4px;
  border-radius: 2px;
}

/* —— Hero: one composition —— */
.home-hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: end;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px) clamp(40px, 7vw, 80px);
  overflow: hidden;
  isolation: isolate;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 85% 20%, rgba(196, 92, 38, 0.18), transparent 55%),
    radial-gradient(90% 70% at 10% 90%, rgba(42, 111, 127, 0.14), transparent 50%),
    linear-gradient(165deg, #f7f1e8 0%, var(--home-paper) 42%, var(--home-paper-deep) 100%);
}

.home-hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.home-blank-host {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4% 2% 8% 28%;
}

/* SVG + caption: caption anchors to the graphic box, not the hero */
.home-blank-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.home-blank {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
  filter: drop-shadow(0 12px 28px rgba(26, 22, 18, 0.08));
}

.home-blank .cut,
.home-blank .crease,
.home-blank .aux {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.home-blank .cut {
  stroke: var(--home-cut);
  stroke-width: 1.35;
  opacity: 0.92;
}

.home-blank .crease {
  stroke: var(--home-crease);
  stroke-width: 1.05;
  opacity: 0.8;
  /* Uniform dash set in JS (pathLength removed); fallback if JS skipped */
  stroke-dasharray: var(--home-crease-dash) var(--home-crease-gap);
}

.home-blank .aux {
  stroke: #8a7260;
  stroke-width: 0.9;
  opacity: 0.55;
}

/* Cut only: pathLength="1" solid reveal. Crease draw is driven in home.js */
.home-blank .cut.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: homeDraw 1.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homeDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.home-blank-cap {
  position: absolute;
  z-index: 2;
  right: 2px;
  bottom: 2px;
  margin: 0;
  max-width: calc(100% - 8px);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--home-muted);
  text-align: right;
  line-height: 1.3;
  opacity: 0;
  animation: homeRise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.1s forwards;
  pointer-events: none;
}

.home-blank-fallback {
  margin: auto;
  padding: 16px;
  color: var(--home-muted);
  font-size: 13px;
}

@keyframes homeDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  max-width: min(720px, 92vw);
}

.home-brand {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 9vw, 92px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--home-ink);
  opacity: 0;
  transform: translateY(18px);
  animation: homeRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.home-headline {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.6vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--home-ink);
  max-width: 18em;
  opacity: 0;
  transform: translateY(18px);
  animation: homeRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

.home-lead {
  margin: 0 0 28px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  color: var(--home-muted);
  max-width: 36em;
  opacity: 0;
  transform: translateY(14px);
  animation: homeRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  animation: homeRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards;
}

.home-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.home-cta a:hover {
  transform: translateY(-1px);
}

.home-cta-primary {
  background: var(--home-ink);
  color: #f7f1e8;
}

.home-cta-primary:hover {
  background: #000;
  color: #fff;
}

.home-cta-secondary {
  background: transparent;
  color: var(--home-ink);
  border: 1.5px solid rgba(26, 22, 18, 0.35);
}

.home-cta-secondary:hover {
  border-color: var(--home-ink);
  background: rgba(26, 22, 18, 0.04);
  color: var(--home-ink);
}

@keyframes homeRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Sections —— */
.home-main {
  position: relative;
  z-index: 2;
}

.home-section {
  padding: clamp(56px, 9vw, 100px) clamp(20px, 5vw, 64px);
  border-top: 1px solid rgba(26, 22, 18, 0.1);
}

.home-section h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.home-section .home-sec-lead {
  margin: 0 0 36px;
  max-width: 40em;
  color: var(--home-muted);
  font-size: 16px;
  line-height: 1.55;
}

.home-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-pillars li {
  margin: 0;
  padding: 0;
}

.home-pillars h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-pillars p {
  margin: 0;
  color: var(--home-muted);
  font-size: 14px;
  line-height: 1.55;
}

.home-pillars .home-idx {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--home-accent);
}

.home-mission {
  background:
    linear-gradient(120deg, rgba(26, 22, 18, 0.94), rgba(42, 111, 127, 0.88)),
    var(--home-ink);
  color: #f3ebe0;
  border-top: none;
}

.home-mission h2 {
  color: #f7f1e8;
  max-width: 14em;
}

.home-mission .home-sec-lead {
  color: rgba(243, 235, 224, 0.78);
}

.home-mission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f7f1e8;
}

.home-mission-tags li {
  position: relative;
}

.home-mission-tags li + li::before {
  content: "·";
  margin-right: 28px;
  color: rgba(243, 235, 224, 0.4);
}

.home-footer {
  padding: 28px clamp(20px, 5vw, 64px) 40px;
  border-top: 1px solid rgba(26, 22, 18, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--home-muted);
  font-size: 13px;
}

.home-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-footer a {
  color: var(--home-ink);
  font-weight: 600;
  text-decoration: none;
}

.home-footer a:hover {
  text-decoration: underline;
}

.home-footer-credits {
  margin: 0;
  max-width: 52em;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(92, 83, 72, 0.85);
}

@media (max-width: 820px) {
  .home-pillars {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .home-blank-host {
    align-items: flex-start;
    justify-content: center;
    padding: 12% 4% 32% 4%;
    opacity: 0.42;
  }

  .home-blank-cap {
    opacity: 0.7;
    font-size: 11px;
  }
}

.home-mission-link {
  display: inline-block;
  margin-top: 28px;
  color: #f7f1e8;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 241, 232, 0.45);
  padding-bottom: 2px;
}

.home-mission-link:hover {
  border-bottom-color: #f7f1e8;
}

@media (prefers-reduced-motion: reduce) {
  .home-blank .draw,
  .home-brand,
  .home-headline,
  .home-lead,
  .home-cta,
  .home-blank-cap {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }

  .home-blank .crease {
    stroke-dasharray: var(--home-crease-dash) var(--home-crease-gap) !important;
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  .home-hero {
    min-height: calc(100svh - var(--header-h));
    padding: 28px max(16px, env(safe-area-inset-right)) 36px
      max(16px, env(safe-area-inset-left));
    align-items: end;
  }

  .home-headline {
    font-size: clamp(26px, 8vw, 34px);
  }

  .home-lead {
    font-size: 15px;
    max-width: none;
  }

  .home-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 20rem;
  }

  .home-cta-primary,
  .home-cta-secondary {
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .home-main {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .home-section {
    padding-left: 0;
    padding-right: 0;
  }

  /* Park die-cut in the upper half; leave lower band for copy */
  .home-blank-host {
    align-items: flex-start;
    justify-content: center;
    padding: 14% 8% 46% 8%;
    opacity: 0.5;
  }

  .home-blank-frame {
    width: min(100%, 420px);
    height: auto;
    max-height: 46%;
    margin-inline: auto;
  }

  .home-blank {
    width: 100%;
    height: auto;
    max-height: 46vh;
  }

  .home-blank-cap {
    right: 4px;
    bottom: 4px;
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  html.home .top.home-top .nav-toggle {
    border-color: rgba(26, 22, 18, 0.18);
    background: rgba(255, 252, 247, 0.7);
  }
}
