/* ============================================================
   DayForge Studios — homepage
   linen · terracotta · sage · warm ink — stone & bronze, editorial
   ============================================================ */

:root {
  --linen: #F1ECE2;
  --linen-deep: #E8E1D2;
  --terracotta: #C06B4B;
  --terracotta-deep: #A5522F;
  --bronze: #A8613C;
  --sand: #E3D2AC;
  --sage: #8A9A7B;
  --sage-deep: #5B6B54;
  --sage-mist: #E9ECE2;
  --ink: #33302A;
  --ink-soft: #6D665A;
  --line: rgba(51, 48, 42, 0.14);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --wrap: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--linen);
  padding: 10px 18px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--terracotta-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* ---------- type ---------- */

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3rem); }
h1 em, h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--terracotta-deep);
}
h3 { font-family: var(--serif); font-weight: 600; font-size: 1.18rem; line-height: 1.3; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
}
.eyebrow.light { color: var(--sage); }

.eyebrow-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}

p + p { margin-top: 1em; }

/* ---------- the four-petal glyph (stone + bronze) ---------- */

.glyph { width: 26px; height: 26px; flex: none; }
.glyph .gp { fill: var(--sand); opacity: 0.65; }
.glyph .gp.on { fill: var(--terracotta); opacity: 1; }
.glyph .gc { fill: var(--bronze); opacity: 0.8; }

/* bronze hairline motif */
.rule {
  height: 2px;
  width: 120px;
  background: linear-gradient(90deg, var(--bronze), rgba(168, 97, 60, 0));
  transform-origin: left center;
}
.reveal-line { transform: scaleX(0); transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s; }
.reveal-line.in { transform: scaleX(1); }

/* ---------- top nav (always visible) ---------- */

.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.top.scrolled {
  background: rgba(241, 236, 226, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.nav {
  max-width: var(--wrap); margin: 0 auto;
  padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { width: 30px; height: 30px; }
/* the real mark: sand petals, terracotta border + Y-linework, terracotta core */
.brand-logo .bp {
  fill: var(--sand);
  stroke: var(--bronze);
  stroke-width: 9;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.brand-logo .bc { fill: var(--terracotta-deep); }
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.14rem;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; align-items: center; gap: 4px 26px; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  position: relative;
  transition: color 0.25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 1px;
  height: 1.5px; background: var(--bronze);
  transition: right 0.3s ease;
}
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a.lit { color: var(--ink); }
.nav-links a:hover::after, .nav-links a:focus-visible::after, .nav-links a.lit::after { right: 0; }
.nav-links .nav-cta {
  color: var(--terracotta-deep);
  font-weight: 600;
  border: 1.5px solid rgba(165, 82, 47, 0.45);
  border-radius: 999px;
  padding: 8px 19px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.nav-links .nav-cta::after { display: none; }
.nav-links .nav-cta:hover { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 92px 24px 40px;
  text-align: center;
  overflow: hidden;
}

/* ---------- the clearing: warm shadow pool + canopy light ----------
   Atmosphere only — everything is pointer-events:none and masked so it
   dissolves back into plain linen before the next section. */

.clearing {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, #000 56%, transparent 90%);
}

/* shadowed edges of the clearing — deep warm umber with a breath of sage
   at the forest floor, never cold or black. The bright core is small: the
   relic emerges from genuine dimness. */
.clearing .pool {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 14% 92%,
      rgba(64, 74, 52, 0.30) 0%, rgba(64, 74, 52, 0) 52%),
    radial-gradient(ellipse 110% 80% at 90% 4%,
      rgba(70, 48, 30, 0.32) 0%, rgba(70, 48, 30, 0) 46%),
    radial-gradient(ellipse 105% 90% at 50% 42%,
      rgba(98, 66, 40, 0) 13%,
      rgba(96, 64, 38, 0.16) 30%,
      rgba(84, 54, 30, 0.38) 55%,
      rgba(66, 42, 22, 0.60) 78%,
      rgba(54, 34, 17, 0.76) 100%);
  mix-blend-mode: multiply;
}

/* the god-ray: a defined warm beam breaking through the canopy from the
   upper right, angling down onto the relic */
.clearing .shaft {
  position: absolute;
  left: 53%; top: -7%;
  width: min(29vw, 340px);
  height: 96%;
  transform: translateX(-50%) rotate(-12deg);
  transform-origin: 50% 0;
  background: linear-gradient(180deg,
    rgba(255, 214, 138, 0.62) 0%,
    rgba(255, 220, 152, 0.42) 38%,
    rgba(255, 228, 172, 0.18) 62%,
    rgba(255, 233, 188, 0) 80%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  filter: blur(9px);
  animation: shaft-breathe 14s ease-in-out infinite;
}

/* a slender parallel ray beside the main beam — canopy gaps, not one spotlight */
.clearing .shaft.thin {
  left: 62.5%;
  width: min(8vw, 92px);
  background: linear-gradient(180deg,
    rgba(255, 218, 146, 0.55) 0%,
    rgba(255, 224, 160, 0.30) 46%,
    rgba(255, 232, 184, 0) 72%);
  filter: blur(6px);
  animation: shaft-breathe-thin 19s ease-in-out infinite;
}

/* wide faint halo of the same light, breathing out of phase */
.clearing .shaft.soft {
  width: min(60vw, 700px);
  background: linear-gradient(180deg,
    rgba(255, 222, 158, 0.30) 0%,
    rgba(255, 230, 178, 0.15) 48%,
    rgba(255, 236, 196, 0) 80%);
  filter: blur(30px);
  animation: shaft-breathe-soft 23s ease-in-out infinite;
}

@keyframes shaft-breathe {
  0%, 100% { opacity: 0.62; transform: translateX(-50%) rotate(-12.6deg); }
  50%      { opacity: 1;    transform: translateX(-46%) rotate(-10.2deg); }
}
@keyframes shaft-breathe-thin {
  0%, 100% { opacity: 0.35; transform: translateX(-50%) rotate(-12deg); }
  55%      { opacity: 0.9;  transform: translateX(-58%) rotate(-13.2deg); }
}
@keyframes shaft-breathe-soft {
  0%, 100% { opacity: 1;    transform: translateX(-50%) rotate(-12deg); }
  50%      { opacity: 0.55; transform: translateX(-53%) rotate(-13deg); }
}

.hero-stage {
  position: relative;
  width: min(66vh, 90vw, 650px);
  aspect-ratio: 1;
}

/* the pool of light where the beam lands — the relic sits spotlit in it */
.stage-glow {
  position: absolute; inset: -16%;
  background: radial-gradient(circle at 52% 44%,
    rgba(255, 246, 220, 0.95) 0%,
    rgba(250, 236, 205, 0.5) 38%,
    rgba(244, 232, 208, 0) 68%);
  pointer-events: none;
}

/* soft grounding shadow beneath the relic */
.ground-shadow {
  position: absolute;
  left: 50%; bottom: 2.5%;
  width: 56%; height: 10%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(58, 41, 28, 0.34) 0%,
    rgba(58, 41, 28, 0.13) 48%,
    rgba(58, 41, 28, 0) 72%);
  filter: blur(7px);
  pointer-events: none;
  animation: ground-breathe 11.4s ease-in-out infinite;
}
@keyframes ground-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.92; }
  50%      { transform: translateX(-50%) scale(1.06, 0.94); opacity: 0.7; }
}

/* drifting dust motes (drawn by hero3d.js) */
#dustLayer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .clearing .shaft, .clearing .shaft.soft, .ground-shadow { animation: none; }
}

#logo3d {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: none;
  touch-action: pan-y;
}
.hero-stage.gl #logo3d { display: block; opacity: 0; }
/* seamless handoff: the 2D mark stays up until the first WebGL frame has
   rendered (.ready), then the two layers cross-fade in place — no blank gap */
.hero-stage.gl .logo-fallback { pointer-events: none; }
.hero-stage.gl #logo3d,
.hero-stage.gl .logo-fallback { transition: opacity 0.9s ease; }
.hero-stage.gl.ready #logo3d { opacity: 1; }
.hero-stage.gl.ready .logo-fallback { opacity: 0; }

/* floating petal label */
.petal-tag {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(251, 248, 241, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(51, 48, 42, 0.1);
  border-radius: 999px;
  font-size: 0.86rem; font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 22px rgba(51, 48, 42, 0.1);
  opacity: 0;
  transform: translate(-50%, -50%) translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
  z-index: 3;
}
.petal-tag.show { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bronze); flex: none; }

/* interaction cue */
.hero-hint {
  position: absolute; left: 50%; bottom: 1.5%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  opacity: 0;
  animation: hint-in 0.8s ease 2.2s forwards;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 3;
}
.hero-hint.gone { opacity: 0 !important; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bronze); flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes hint-in { to { opacity: 1; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 97, 60, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(168, 97, 60, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-hint { animation: none; opacity: 1; }
  .pulse { animation: none; }
}

/* fallback (no WebGL / no JS): stone petals, bronze edge */
.logo-fallback {
  position: absolute; inset: 7%;
  animation: fb-breathe 7s ease-in-out infinite;
}
.logo-fallback svg { width: 100%; height: 100%; }
.fb-petal {
  fill: var(--sand);
  stroke: var(--bronze);
  stroke-width: 7;
  transition: fill 0.3s ease;
  cursor: pointer;
}
.logo-fallback a:hover .fb-petal,
.logo-fallback a:focus-visible .fb-petal { fill: var(--terracotta); }
.fb-core { fill: var(--bronze); }
@keyframes fb-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.6%); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-fallback { animation: none; }
}

.hero-copy { max-width: 780px; margin-top: 30px; }
.hero-sub {
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 18px auto 0;
}

/* ---------- bridge statement ---------- */

.bridge { padding: 130px 0 110px; }
.bridge .rule { margin-bottom: 40px; }
.bridge p {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -0.01em;
  max-width: 21em;
}
.bridge em { font-style: italic; color: var(--terracotta-deep); }

/* ---------- service sections: asymmetric 12-col grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 28px;
}

.svc { padding: 120px 0; }
.svc.band {
  background: var(--linen-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.svc.sage-band { background: var(--sage-mist); }

.svc h2 { margin-bottom: 0.5em; }
.svc-lede { max-width: 34em; }

.c-head { grid-column: 1 / 9; }
.c-head-right { grid-column: 5 / 13; }
.c-copy { grid-column: 1 / 7; }
.c-fig { grid-column: 8 / 13; }
.c-ledger { grid-column: 5 / 13; margin-top: 56px; }
.c-quote { grid-column: 8 / 13; align-self: start; }

/* websites: image hangs to the right, offset upward */
.svc-fig { margin-top: -30px; align-self: start; }
.svc-fig img {
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -22px rgba(51, 48, 42, 0.32);
}
.svc-fig figcaption {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ledger rows / lists — hairline editorial lists, not cards */
.ledger-list { list-style: none; margin-top: 28px; }
.ledger-list li {
  padding: 12px 0 12px 26px;
  position: relative;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}
.ledger-list li:last-child { border-bottom: 1px solid var(--line); }
.ledger-list li::before {
  content: "";
  position: absolute; left: 2px; top: 1.32em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sand);
  box-shadow: inset 0 0 0 1.5px var(--bronze);
}

.ledger { border-top: 1px solid var(--line); }
.ledger-row {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.ledger-row h3 { color: var(--ink); }
.ledger-row p { color: var(--ink-soft); font-size: 0.98rem; }

/* marketing pull quote */
.pull-quote {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.015em;
  padding-top: 10px;
  border-top: 2px solid var(--bronze);
}
.pull-quote em { font-style: italic; font-weight: 400; color: var(--sage-deep); }

/* consulting takeaway column */
.takeaway { padding-top: 8px; }
.takeaway-label {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--sage-deep);
}
.takeaway .ledger-list { margin-top: 14px; }
.takeaway .ledger-list li { border-color: rgba(91, 107, 84, 0.28); }
.sage-band .ledger-list li::before { box-shadow: inset 0 0 0 1.5px var(--sage-deep); }

.btn {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 14px 32px;
  border-radius: 999px;
  margin-top: 30px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.btn:hover { background: var(--terracotta-deep); transform: translateY(-1px); }

/* ---------- about (dark, warm) ---------- */

.about {
  background: var(--ink);
  color: var(--linen);
  padding: 150px 0;
}
.c-about-head { grid-column: 1 / 8; }
.c-about-body { grid-column: 8 / 13; padding-top: 96px; }
.about h2 { font-size: clamp(2.6rem, 5vw, 4.2rem); margin-top: 16px; }
.about h2 em { color: var(--terracotta); }
.about-body p {
  font-size: 1.1rem;
  line-height: 1.75;
  color: rgba(241, 236, 226, 0.86);
}
.about-body p + p { margin-top: 1.3em; }

/* ---------- contact ---------- */

.contact { padding: 140px 0 120px; }
.contact .rule { margin-bottom: 40px; }
.contact .eyebrow { display: block; margin-bottom: 18px; }
.contact h2 { max-width: 13em; }
.big-mail {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 4.6vw, 3.2rem);
  letter-spacing: -0.01em;
  color: var(--terracotta-deep);
  text-decoration: none;
  border-bottom: 2px solid rgba(168, 97, 60, 0.4);
  padding-bottom: 8px;
  margin: 40px 0 36px;
  transition: border-color 0.25s ease, color 0.25s ease;
  overflow-wrap: anywhere;
}
.big-mail:hover { color: var(--terracotta); border-color: var(--bronze); }
.contact-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.contact-meta p { color: var(--ink-soft); font-size: 1rem; }
.ig {
  font-size: 0.92rem; font-weight: 600;
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(91, 107, 84, 0.4);
  padding-bottom: 2px;
}
.ig:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 40px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}
footer a { color: inherit; }

/* ---------- reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }
.grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.grid .reveal:nth-child(3) { transition-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-line { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .grid { display: block; }
  .svc { padding: 84px 0; }
  .svc-fig { margin-top: 40px; max-width: 520px; }
  .c-ledger { margin-top: 40px; }
  .pull-quote { margin-bottom: 36px; max-width: 12em; }
  .c-about-body { padding-top: 40px; }
  .about { padding: 100px 0; }
  .takeaway { margin-top: 40px; max-width: 460px; }
  .svc-copy .btn { margin-bottom: 8px; }
  .contact { padding: 96px 0 84px; }
}

@media (max-width: 700px) {
  /* narrower screens: beam stays a beam but hazier; drop the extra ray */
  .clearing .shaft { width: 46vw; filter: blur(14px); }
  .clearing .shaft.thin { display: none; }
  .clearing .shaft.soft { width: 100vw; filter: blur(34px); }
  .nav { padding: 14px 20px; row-gap: 2px; }
  .brand-name { font-size: 1rem; }
  .nav-links { gap: 2px 16px; }
  .nav-links a { font-size: 0.8rem; padding: 5px 0; }
  .nav-links .nav-cta { padding: 6px 14px; }
  .hero { padding-top: 118px; }
  .hero-stage { width: min(52vh, 94vw); }
  .hero-copy { margin-top: 18px; }
  .hero-sub { font-size: 1.03rem; }
  .hero-hint { bottom: 3%; font-size: 0.78rem; }
  .bridge { padding: 90px 0 72px; }
  .ledger-row { grid-template-columns: 1fr; gap: 4px; padding: 20px 0; }
  .contact-meta { flex-direction: column; align-items: flex-start; }
}
