/* ============================================================
   ALDOCHANDRA.COM — igloo.inc-inspired dark ice aesthetic
   ============================================================ */

:root {
  --bg: #050609;
  --bg-soft: #0b0a08;
  --txt: #eef4fa;
  --dim: rgba(255, 240, 220, 0.68);
  --faint: rgba(255, 240, 220, 0.45);
  --ice: #ffb454;
  --line: rgba(255, 180, 84, 0.18);
  --font-sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

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

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

body.loading { overflow: hidden; height: 100vh; }
body.menu-open { overflow: hidden; }

/* Vendor-script failure fallback: static but fully readable page */
body.no-anim [data-fade] { opacity: 1; transform: none; filter: none; }
body.no-anim .split-chars .char { transform: none; }
body.no-anim .hud { opacity: 1; }
body.no-anim .big-lines .line { transform: none; }

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor { display: none; }
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(255, 180, 84, 0.25); color: var(--txt); }

/* ===== Canvas ===== */
.scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

body.no-webgl .scene-canvas { display: none; }
body.no-webgl {
  background:
    radial-gradient(120% 90% at 50% 0%, #161009 0%, var(--bg) 60%),
    var(--bg);
}

/* ===== Vignette ===== */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ===== Grain ===== */
.grain {
  position: fixed;
  inset: -100%;
  width: 300%;
  height: 300%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.4%); }
  50% { transform: translate(1.2%, -1.8%); }
  75% { transform: translate(-1.6%, -0.8%); }
  100% { transform: translate(0.8%, 1.2%); }
}

/* ===== Loader ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background: #030509;
}
.loader-half--top { top: 0; }
.loader-half--bottom { bottom: 0; }

.loader-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.loader-label { color: var(--dim); }

.loader-count {
  font-size: clamp(64px, 10vw, 120px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.loader-bar {
  width: min(280px, 60vw);
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--ice);
  transform: scaleX(0);
  transform-origin: left;
}

/* ===== HUD ===== */
/* HUD sits above the menu overlay so the MENU button stays clickable when open */
.hud { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; }

.hud-item { position: absolute; color: var(--dim); }
.hud-item a, .hud-item button { pointer-events: auto; }

.hud-tl { top: 24px; left: 28px; }
.hud-tl a { color: var(--txt); }
.hud-tr { top: 24px; right: 28px; }
.hud-bl { bottom: 24px; left: 28px; }
.hud-br { bottom: 24px; right: 28px; display: flex; align-items: center; gap: 10px; }

.menu-btn {
  background: none;
  border: none;
  color: var(--txt);
  cursor: none;
  padding: 6px 2px;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 34px;
  background: var(--faint);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ice);
  animation: scroll-drip 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes scroll-drip {
  0% { top: -100%; }
  55% { top: 0; }
  100% { top: 100%; }
}

.hud-bc { bottom: 24px; left: 50%; transform: translateX(-50%); }

.sound-btn {
  background: none;
  border: none;
  color: var(--dim);
  cursor: none;
  padding: 6px 4px;
  transition: color 0.3s;
}
.sound-btn:hover { color: var(--txt); }
.sound-btn[aria-pressed="true"] { color: var(--ice); }

.hud-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: transparent;
}
.hud-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--ice));
  transform: scaleY(0);
  transform-origin: top;
  opacity: 0.6;
}

/* ===== Menu ===== */
.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(3, 6, 10, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
  visibility: hidden;
}

.menu.open { pointer-events: auto; }

.menu-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(28px, 8vw, 120px);
  gap: 8vh;
}

.menu-links { display: flex; flex-direction: column; }

.menu-links a {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 1.4vh 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.menu-num { color: var(--faint); }

.menu-word {
  display: inline-block;
  font-size: clamp(34px, 6.5vw, 84px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--txt);
  transition: color 0.3s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-links a:hover .menu-word { color: var(--ice); transform: translateX(14px); }

.menu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  color: var(--dim);
}

/* ===== Sections (content flows over fixed canvas) ===== */
main { position: relative; z-index: 2; }

.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(24px, 7vw, 110px);
}

.label { color: var(--faint); margin-bottom: 28px; }

.kicker { color: var(--dim); margin-bottom: 24px; }

/* — Hero — */
.hero { min-height: 100vh; align-items: center; text-align: center; }

.hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(58px, 13.5vw, 190px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.92;
  text-transform: uppercase;
}

.hero-sub {
  margin-top: 34px;
  font-size: clamp(15px, 1.6vw, 20px);
  font-weight: 300;
  line-height: 1.55;
  color: var(--dim);
}

.hero-coords { margin-top: 26px; color: var(--faint); }

/* — Split chars — */
.split-chars .word { display: inline-block; white-space: nowrap; }
.split-chars .char {
  display: inline-block;
  transform: translateY(115%);
  will-change: transform;
}
.split-chars .char.space { width: 0.35em; }

/* — Big lines — */
.big-lines {
  font-size: clamp(30px, 5.4vw, 74px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
}

.big-lines .line-mask { overflow: hidden; display: block; }
.big-lines .line { display: block; }
.big-lines .line.accent { color: var(--ice); }
.big-lines .line em {
  font-style: normal;
  color: var(--faint);
  font-size: 0.4em;
  vertical-align: super;
  margin-right: 0.6em;
}

/* — Manifesto — */
.manifesto { min-height: 160vh; }
.manifesto-inner { max-width: 1000px; }

.body-copy {
  margin-top: 42px;
  max-width: 480px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--dim);
}

/* — Ventures — */
.venture { min-height: 130vh; }
.venture-inner { max-width: 760px; }
.venture--right { align-items: flex-end; }
.venture--right .venture-inner { text-align: right; }
.venture--right .venture-meta { justify-content: flex-end; }

.venture-num { color: var(--faint); margin-bottom: 22px; }

.venture-name {
  font-size: clamp(44px, 8.5vw, 124px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}

.venture-desc {
  margin-top: 30px;
  max-width: 460px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--dim);
}
.venture--right .venture-desc { margin-left: auto; }

.venture-meta {
  margin-top: 34px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 42px;
  color: var(--txt);
}
.venture-meta li { display: flex; flex-direction: column; gap: 6px; }
.venture-meta li span { color: var(--faint); }

/* — Principles / Now — */
.principles { min-height: 140vh; }
.now { min-height: 120vh; }

.now-list {
  margin-top: 40px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}
.now-list li {
  display: flex;
  gap: 16px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.now-list li .mono { color: var(--ice); }

/* — Contact — */
.contact { min-height: 100vh; align-items: center; text-align: center; }

.contact-title {
  font-size: clamp(52px, 11vw, 160px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}

.contact-email {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.6vw, 18px);
  letter-spacing: 0.12em;
  color: var(--ice);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  transition: border-color 0.3s, color 0.3s;
}
.contact-email:hover { border-color: var(--ice); color: var(--txt); }

.socials {
  margin-top: 44px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 34px;
  color: var(--dim);
}
.socials a { transition: color 0.3s; }
.socials a:hover { color: var(--ice); }

.footer-bar {
  position: absolute;
  bottom: 22px;
  left: 0;
  width: 100%;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
}

/* ===== Cursor ===== */
.cursor { position: fixed; top: 0; left: 0; z-index: 30; pointer-events: none; }

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--ice);
}

.cursor-ring {
  position: fixed;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 1px solid rgba(159, 208, 255, 0.4);
  /* transform is JS-driven per frame (position + hover scale) — no transition */
  transition: border-color 0.25s ease;
}

.cursor.is-hover .cursor-ring {
  border-color: rgba(159, 208, 255, 0.9);
}

/* ===== Fades ===== */
[data-fade] { opacity: 0; transform: translateY(26px); filter: blur(6px); will-change: opacity, transform; }

/* Grain lives in the post-processing shader when WebGL is active */
body.post-fx .grain { display: none; }

/* Magnetic-hover targets need a transformable box */
[data-hover] { display: inline-block; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .grain, .scroll-line::after { animation: none; }
  [data-fade] { opacity: 1; transform: none; filter: none; }
  .split-chars .char { transform: none; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .hud-tl { left: 18px; top: 18px; }
  .hud-tr { right: 18px; top: 18px; }
  .hud-bl { left: 18px; bottom: 18px; }
  .hud-br { right: 18px; bottom: 18px; }
  .section { padding: 0 20px; }
  .venture--right .venture-inner { text-align: left; }
  .venture--right { align-items: flex-start; }
  .venture--right .venture-desc { margin-left: 0; }
  .venture--right .venture-meta { justify-content: flex-start; }
  .footer-bar { flex-direction: column; align-items: center; gap: 6px; text-align: center; }
  .menu-foot { flex-direction: column; gap: 10px; }
  .hero-coords { font-size: 9.5px; letter-spacing: 0.08em; }
}

/* ===== Portfolio district (aldo-city only) ===== */
.portfolio-inner {
  width: min(1080px, 88vw);
  margin: 0 auto;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.portfolio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 10, 8, 0.72);
  backdrop-filter: blur(6px);
  color: var(--txt);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.portfolio-card:hover,
.portfolio-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--pc, var(--ice));
  background: rgba(16, 14, 10, 0.85);
}
.pc-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--pc, var(--ice));
  box-shadow: 0 0 12px var(--pc, var(--ice));
}
.pc-name {
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.pc-beta {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--pc, var(--ice));
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 2px 6px;
  font-style: normal;
}
.pc-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--dim);
}
.pc-link {
  margin-top: auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--pc, var(--ice));
}
@media (max-width: 900px) {
  .portfolio-grid { grid-template-columns: 1fr; }
}
