/* FudliCraft landing page — a voxel world you scroll through.
 *
 * The whole scene hangs off one custom property, --t, which world.js sets from
 * scroll position: 0 is midday, 1 is night. Everything that changes with the
 * time of day reads that number and nothing else, so there is exactly one thing
 * to reason about when the lighting looks wrong.
 *
 * Deliberately its own stylesheet: login.html and set-password.html still use
 * styles.css, and a landing page rewrite has no business breaking the login.
 */

:root {
  --t: 0;                    /* 0 = midday, 1 = night. Set by world.js. */

  --ink: #f5f0e1;
  --ink-soft: #b9b6a6;
  --ink-dim: #86887a;
  --lime: #c4f53b;
  --lime-deep: #aee227;
  --orange: #f0883e;

  --panel: rgba(14, 18, 11, 0.72);
  --panel-solid: #12160e;
  --line: rgba(245, 240, 222, 0.10);
  --line-strong: rgba(245, 240, 222, 0.20);

  --maxw: 1180px;
  --radius: 14px;
  --radius-lg: 22px;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: #0b0f08;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.wrap { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

/* ==========================================================================
   Sky — two stacked gradients rather than a colour interpolation. Crossfading
   opacity is cheap, works everywhere, and never produces the muddy grey that
   mixing a warm day into a cold night tends to give you.
   ========================================================================== */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky-day, .sky-night { position: absolute; inset: 0; }
.sky-day {
  background: linear-gradient(180deg, #7ec8f0 0%, #a8ddf2 38%, #dcefc0 72%, #cfe08f 100%);
}
.sky-night {
  opacity: var(--t);
  background: linear-gradient(180deg, #060b18 0%, #0d1730 42%, #16243f 74%, #1b2a33 100%);
}

.stars { position: absolute; inset: 0; opacity: var(--t); }
.stars i {
  position: absolute; width: 2px; height: 2px; background: #fff; border-radius: 0;
  opacity: 0.85; animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.95; } }

/* The sun sinks and the moon rises on the same rail, so they read as one arc
   rather than two unrelated discs. */
.sun, .moon {
  position: absolute; left: 50%; width: 74px; height: 74px;
  margin-left: -37px; border-radius: 0;
}
.sun {
  top: 12%;
  background: #ffe9a8;
  box-shadow: 0 0 60px 18px rgba(255, 224, 130, 0.55);
  transform: translateY(calc(var(--t) * 62vh));
  opacity: calc(1 - var(--t));
}
.moon {
  top: 96%;
  width: 58px; height: 58px; margin-left: -29px;
  background: #dfe7f2;
  box-shadow: 0 0 46px 12px rgba(190, 214, 245, 0.35);
  transform: translateY(calc(var(--t) * -78vh));
  opacity: var(--t);
}

/* ==========================================================================
   Horizon — blocky ridges, parallaxed. These are CSS gradients cut into steps,
   not cubes: a full voxel terrain would be hundreds of composited layers for a
   silhouette nobody looks at directly.
   ========================================================================== */
.horizon { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.ridge {
  position: absolute; left: -10%; right: -10%; bottom: 0;
  background-repeat: repeat-x;
  will-change: transform;
}
.ridge-far {
  height: 26vh;
  --c: #2c3f22;
  background-image:
    linear-gradient(to right,
      transparent 0 2%, var(--c) 2% 9%, transparent 9% 12%,
      var(--c) 12% 22%, transparent 22% 25%, var(--c) 25% 34%,
      transparent 34% 39%, var(--c) 39% 51%, transparent 51% 55%,
      var(--c) 55% 63%, transparent 63% 68%, var(--c) 68% 79%,
      transparent 79% 83%, var(--c) 83% 94%, transparent 94% 100%);
  background-size: 100% 60%;
  background-position: 0 100%;
  filter: brightness(calc(1 - var(--t) * 0.62));
  opacity: 0.75;
}
.ridge-mid {
  height: 20vh;
  --c: #24361c;
  background-image:
    linear-gradient(to right,
      var(--c) 0 8%, transparent 8% 13%, var(--c) 13% 27%,
      transparent 27% 31%, var(--c) 31% 46%, transparent 46% 52%,
      var(--c) 52% 66%, transparent 66% 71%, var(--c) 71% 88%,
      transparent 88% 93%, var(--c) 93% 100%);
  background-size: 100% 72%;
  background-position: 0 100%;
  filter: brightness(calc(1 - var(--t) * 0.68));
}
.ridge-near {
  height: 13vh;
  background: linear-gradient(180deg, #1b2916, #131d10);
  filter: brightness(calc(1 - var(--t) * 0.55));
}

/* ==========================================================================
   Chrome
   ========================================================================== */
.scroll-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--lime), var(--orange));
  pointer-events: none;
}

.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 8, 0.5);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav.is-condensed { background: rgba(10, 14, 8, 0.86); border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 30px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand .logo { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 24px; font-size: 14.5px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--lime); }
.nav-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-right .txt-link { font-size: 14.5px; color: var(--ink-soft); }
.nav-right .txt-link:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 18px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 650; font-size: 14.5px; cursor: pointer; font-family: inherit;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn-lime { background: var(--lime); color: #1a2305; box-shadow: 0 14px 34px -16px rgba(196, 245, 59, 0.8); }
.btn-lime:hover { background: var(--lime-deep); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: rgba(10, 14, 8, 0.35); }
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }
.btn-lg { padding: 14px 24px; font-size: 15.5px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

.kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lime); display: block; }
.h-display { font-weight: 900; letter-spacing: -0.035em; line-height: 0.95; font-size: clamp(40px, 7.6vw, 88px); margin: 20px 0 22px; }
.h-2 { font-weight: 800; letter-spacing: -0.028em; line-height: 1.02; font-size: clamp(30px, 5vw, 54px); margin: 14px 0 20px; }
.hl { color: var(--lime); }
.lead { color: var(--ink-soft); font-size: clamp(15.5px, 1.7vw, 18px); max-width: 58ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.chapter { position: relative; z-index: 2; padding: clamp(72px, 11vw, 150px) 0; }
.chapter-head { max-width: 760px; margin-bottom: 54px; }

/* Text needs to stay readable against a sky that goes from pale blue to near
   black, so the night chapters carry their own scrim rather than relying on the
   sky happening to be dark enough. */
.chapter-night::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(6, 10, 5, 0.72) 18%, rgba(6, 10, 5, 0.72) 82%, transparent);
}
.hero .lead, .hero .h-display, .hero .kicker { text-shadow: 0 2px 22px rgba(6, 12, 4, 0.5); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(40px, 7vw, 84px); }
.hero-inner { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(28px, 5vw, 64px); align-items: center; min-height: 74vh; }
.hero-hint { margin-top: 34px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-dim); }
.hero-stage { position: relative; height: clamp(280px, 40vw, 440px); perspective: 900px; }

/* ==========================================================================
   Voxels — cubes are generated by world.js, so the markup here stays about
   content. Sizes come from --s on each cube.
   ========================================================================== */
.cube { position: absolute; transform-style: preserve-3d; width: var(--s); height: var(--s); }
.cube .f { position: absolute; width: var(--s); height: var(--s); border: 1px solid rgba(0,0,0,0.34); }
.cube .f-t { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f-b { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.cube .f-n { transform: translateZ(calc(var(--s) / 2)); }
.cube .f-s { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube .f-e { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f-w { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }

/* Materials. The 4px speckle is what makes a flat gradient read as a block
   texture without shipping an image. Everything dims with --t so the whole
   world loses its light together instead of the sky going dark alone. */
.m-grass .f-t {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 4px, transparent 4px 8px),
    linear-gradient(150deg, #b7ea36, #86bb25);
}
.m-grass .f-n, .m-grass .f-s, .m-grass .f-e, .m-grass .f-w {
  background:
    linear-gradient(180deg, #7ea82a 0 14%, rgba(0,0,0,0) 14%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, #6b4b2f, #4b3320);
}
.m-dirt .f {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.13) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, #6b4b2f, #45301c);
}
.m-stone .f {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, #6e7166, #4a4d45);
}
.m-lime .f {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 3px, transparent 3px 6px),
    linear-gradient(160deg, rgba(196,245,59,.92), rgba(140,168,50,.78));
  box-shadow: inset 0 0 14px rgba(196, 245, 59, 0.5);
}
.m-ember .f {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 3px, transparent 3px 6px),
    linear-gradient(160deg, rgba(240,136,62,.92), rgba(168,88,34,.75));
  box-shadow: inset 0 0 14px rgba(240, 136, 62, 0.45);
}

/* One filter on the container beats one filter per cube: it is a single
   composited pass instead of dozens. */
.voxels { position: absolute; inset: 0; transform-style: preserve-3d; filter: brightness(calc(1 - var(--t) * 0.42)); }
.voxels-spin { animation: spin-y 26s linear infinite; }
.voxels-bob { animation: bob 8s ease-in-out infinite; }
@keyframes spin-y { to { transform: rotateX(-22deg) rotateY(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(-10px); } 50% { transform: translateY(12px); } }

/* A lit window on the awake island. This is the whole night story in one dot. */
.isle-lamp {
  position: absolute; width: 9px; height: 9px; background: var(--lime);
  box-shadow: 0 0 16px 4px rgba(196, 245, 59, 0.75);
  opacity: var(--t);
}

/* ==========================================================================
   Calculator, sitting on a floating island
   ========================================================================== */
.calc-island { position: relative; }
.island-edge {
  position: absolute; inset: 14px -10px -22px 10px; z-index: -1;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(150, 200, 40, 0.13), rgba(80, 56, 32, 0.22));
  border: 1px solid rgba(196, 245, 59, 0.2);
}
.calc { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 18px; align-items: start; }
.calc-controls, .calc-out {
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}
.calc-controls {
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex; flex-direction: column; gap: 26px;
}
.calc-out {
  border: 1px solid rgba(196, 245, 59, 0.26);
  background: linear-gradient(180deg, rgba(196, 245, 59, 0.07), rgba(10, 14, 8, 0.82));
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 92px;
}

.calc-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-tier {
  position: relative; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  padding: 16px 16px 16px 46px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(245, 240, 222, 0.03);
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.calc-tier:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.calc-tier.is-active { border-color: rgba(196, 245, 59, 0.5); background: rgba(196, 245, 59, 0.08); }
.calc-tier b { display: block; font-size: 16px; margin-bottom: 4px; }
.calc-tier.is-active b { color: var(--lime); }
.tier-note { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.tier-icon { position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; }
.tier-sun { background: #ffe9a8; box-shadow: 0 0 12px 3px rgba(255, 224, 130, 0.6); }
.tier-moon { background: #dfe7f2; box-shadow: 0 0 12px 3px rgba(190, 214, 245, 0.45); }

.calc-field { display: flex; flex-direction: column; gap: 9px; }
.calc-field[hidden] { display: none; }
.calc-field label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-family: var(--mono); font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-soft);
}
.calc-val { font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--lime); font-weight: 700; }
.calc-field small { font-size: 12.5px; color: var(--ink-dim); }
.calc-field input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 999px; outline: none;
  background: rgba(245, 240, 222, 0.14); cursor: pointer;
}
.calc-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; background: var(--lime);
  border: 3px solid var(--panel-solid); box-shadow: 0 0 0 1px rgba(196, 245, 59, 0.55);
}
.calc-field input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; background: var(--lime);
  border: 3px solid var(--panel-solid); box-shadow: 0 0 0 1px rgba(196, 245, 59, 0.55);
}

.calc-price { display: flex; align-items: baseline; gap: 8px; }
.calc-price b { display: inline-block; font-size: clamp(32px, 4.4vw, 46px); font-weight: 900; letter-spacing: -0.035em; line-height: 1; }
.calc-price span { font-size: 14px; color: var(--ink-soft); }
.calc-price.is-bumped b { animation: bump 0.42s cubic-bezier(.34,1.56,.64,1); }
@keyframes bump { 0% { transform: scale(1); } 38% { transform: scale(1.075); } 100% { transform: scale(1); } }
.calc-rate { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }

.calc-break { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.calc-break li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-soft); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.calc-break li:last-child { border-bottom: none; padding-bottom: 0; }
.calc-break b { color: var(--ink); font-family: var(--mono); font-size: 13px; }

.calc-hint { font-size: 13px; line-height: 1.5; color: var(--ink-soft); padding: 12px 14px; border-radius: 10px; background: rgba(240, 136, 62, 0.1); border: 1px solid rgba(240, 136, 62, 0.24); }
.calc-hint:empty { display: none; }

.calc-compare { display: flex; flex-direction: column; gap: 9px; }
.calc-compare-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); }
.calc-compare ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.calc-compare li { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-soft); }
.calc-compare b { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.calc-compare .is-us span, .calc-compare .is-us b { color: var(--lime); font-weight: 700; }
.calc-compare small { font-size: 11.5px; color: var(--ink-dim); line-height: 1.45; }

/* ==========================================================================
   Islands (nodes)
   ========================================================================== */
.isles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.isle {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: rgba(10, 14, 8, 0.6); backdrop-filter: blur(8px);
  overflow: hidden; will-change: transform;
}
.isle.is-awake { border-color: rgba(196, 245, 59, 0.3); }
.isle-stage { position: relative; height: 168px; perspective: 800px; }
.isle-body { padding: 0 24px 26px; }
.isle-tag { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-soft); margin-bottom: 14px; }
.isle h3 { font-size: 19px; font-weight: 750; margin-bottom: 8px; }
.isle p { font-size: 14px; color: var(--ink-soft); margin-bottom: 15px; }
.isle ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.isle li { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
.dot { width: 8px; height: 8px; flex: none; display: inline-block; }
.dot.on { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.dot.off { background: var(--ink-dim); }

/* ==========================================================================
   Features
   ========================================================================== */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 14, 8, 0.55); backdrop-filter: blur(8px); transition: border-color 0.18s, transform 0.18s; }
.feat:hover { border-color: rgba(196, 245, 59, 0.3); transform: translateY(-3px); }
.feat-block {
  display: block; width: 22px; height: 22px; margin-bottom: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 3px, transparent 3px 6px),
    linear-gradient(150deg, #b7ea36, #86bb25);
}
.feat h3 { font-size: 17.5px; font-weight: 700; margin-bottom: 8px; }
.feat p { font-size: 14.5px; color: var(--ink-soft); }

/* ==========================================================================
   Marquee, CTA, footer
   ========================================================================== */
.marquee { position: relative; z-index: 2; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 15px 0; background: rgba(8, 12, 6, 0.7); backdrop-filter: blur(8px); }
.marquee-track { display: inline-flex; gap: 40px; white-space: nowrap; animation: slide 30s linear infinite; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-dim); }
.marquee-track b { color: var(--lime); font-weight: 500; }
@keyframes slide { to { transform: translateX(-50%); } }

.cta { text-align: center; padding: clamp(40px, 6vw, 70px) clamp(20px, 5vw, 60px); border: 1px solid rgba(196, 245, 59, 0.24); border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(196, 245, 59, 0.08), rgba(10, 14, 8, 0.8)); backdrop-filter: blur(10px); }
.cta .lead { margin: 0 auto; }
.cta .actions { justify-content: center; }

.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 34px 0 46px; background: rgba(6, 10, 5, 0.85); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.footer-brand { font-weight: 800; letter-spacing: -0.02em; }
.footer p { font-size: 13px; color: var(--ink-dim); flex: 1 1 340px; }
.footer-links { display: flex; gap: 18px; font-size: 13.5px; color: var(--ink-soft); }
.footer-links a:hover { color: var(--lime); }

/* ==========================================================================
   Motion, and its off switch
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  html.fx-armed [data-reveal],
  html.fx-armed [data-reveal-group] > * { opacity: 0; }
}
[data-magnetic], [data-tilt] { will-change: transform; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; min-height: auto; }
  .hero-stage { height: 260px; order: -1; }
  .calc { grid-template-columns: 1fr; }
  .calc-out { position: static; }
  .isles, .feats { grid-template-columns: 1fr; }
  .calc-tiers { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .h-display { font-size: clamp(34px, 11vw, 52px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .voxels-spin, .voxels-bob, .marquee-track, .stars i, .calc-price.is-bumped b { animation: none !important; }
  html.fx-armed [data-reveal],
  html.fx-armed [data-reveal-group] > * { opacity: 1 !important; }
  .scroll-rail { display: none; }
}
