/* Castilloworks — the living wall.
   One dark gallery. A generative canvas of drifting light behind every page,
   tinted to whichever room you're standing in. No stock photography.
   Division pages set a body theme class (t-iron, t-cfmmw, t-bro, t-prod). */

:root {
  --paper: #14110d;
  --ink: #ece7da;
  --soft: #a29a87;
  --line: rgba(236, 231, 218, 0.1);
  --accent: #94ab70;
  --max: 1060px;
  --sans: "Inter", -apple-system, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Fraunces", Georgia, serif;
}

/* ---- division worlds: same wall, different light ---- */
.t-iron { --accent: #d9a441; }
.t-cfmmw { --accent: #cfa96e; }
.t-bro { --accent: #3ddc84; }
.t-prod { --accent: #7fc2b1; }

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

html { scroll-behavior: smooth; }

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

/* the living wall canvas (inserted by motion.js) */
#wall { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* film grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 40;
  pointer-events: none; opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, footer { position: relative; z-index: 1; }

a { color: inherit; }

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

/* ---------- header ---------- */

header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: linear-gradient(rgba(20, 17, 13, 0.85), rgba(20, 17, 13, 0));
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.wordmark {
  font-family: var(--mono);
  font-weight: 600; font-size: 14px; letter-spacing: 0.1em;
  text-decoration: none;
  display: flex; align-items: center;
}
.wordmark span { color: var(--accent); }
.wordmark .rook { height: 20px; width: auto; color: var(--accent); flex: none; margin-right: 9px; }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 14px; text-decoration: none; color: var(--soft); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }

@media (max-width: 760px) {
  .nav-links { gap: 14px; }
  .nav-links a:nth-child(n+4) { display: none; }
}

/* live studio clock */
.clock {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.08em; color: var(--soft);
  white-space: nowrap;
}
@media (max-width: 900px) { .clock { display: none; } }

/* per-brand headers: each room owns its door */
.brandmark {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; font-size: 16px;
}
.home-rook { display: flex; align-items: center; text-decoration: none; }
.home-rook .rook { height: 18px; width: auto; color: var(--soft); }
.home-rook:hover .rook { color: var(--accent); }

.bm-iron { font-family: var(--mono); letter-spacing: 0.28em; }
.bm-iron .bm-star { color: var(--accent); font-size: 20px; }

.bm-cfmmw { font-family: var(--serif); font-style: italic; font-size: 19px; letter-spacing: 0.01em; }
.bm-cfmmw .bm-mark { height: 40px; width: auto; }

.bm-bro { font-family: var(--mono); color: var(--accent); font-size: 15px; }
.bm-bro .bcaret {
  display: inline-block; width: 8px; height: 15px;
  background: var(--accent); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.bm-prod { font-family: var(--serif); font-size: 18px; }
.bm-prod .bm-dot {
  width: 13px; height: 13px; border: 2px solid var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ---------- the living hero: centered, type is the art ---------- */

.hero-live {
  position: relative; z-index: 1;
  min-height: 96vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 3vh; padding: 96px 20px 60px;
}
.hero-live .kicker { margin-bottom: 0; }
.hero-live h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: 1.04; letter-spacing: -0.03em;
  max-width: 16ch;
}
.hero-live h1 em { font-style: italic; }
.hero-live .lede {
  color: var(--soft); max-width: 52ch;
  font-size: clamp(0.98rem, 1.7vw, 1.12rem);
}
.hero-live .actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-live .hero-mark { height: clamp(84px, 14vh, 130px); width: auto; }
.hero-live.short { min-height: 52vh; padding-top: 130px; }

.kicker {
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}

/* scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--soft);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }

/* ---------- the rooms (hub): centered worlds, the wall changes color ---------- */

.room-live {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 3.2vh; padding: 40px 20px;
}
.room-live .no {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(1rem, 2vw, 1.4rem); color: var(--acc, var(--accent)); opacity: 0.9;
}
.room-live h2 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.6rem, 7.5vw, 7rem);
  line-height: 1.02; letter-spacing: -0.03em; max-width: 15ch;
  margin: 0;
}
.room-live h2 em { font-style: italic; }
.room-live .sub { color: var(--soft); max-width: 46ch; font-size: clamp(0.95rem, 1.6vw, 1.1rem); }
.room-live .go {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--acc, var(--accent)); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--acc, var(--accent)) 40%, transparent);
  border-radius: 999px; padding: 13px 30px;
  transition: border-color 0.4s ease, background 0.4s ease;
}
.room-live .go:hover { border-color: var(--acc, var(--accent)); background: color-mix(in srgb, var(--acc, var(--accent)) 10%, transparent); }

.s-iron { --acc: #d9a441; }
.s-cfmmw { --acc: #cfa96e; }
.s-bro { --acc: #3ddc84; }
.s-prod { --acc: #7fc2b1; }

/* ---------- content sections ---------- */

section { padding: 72px 0; }
.rule { border-top: 1px solid var(--line); }

h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.01em; margin-bottom: 26px; }
h3 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 8px; }

.prose { max-width: 62ch; color: var(--soft); }
.prose + .prose { margin-top: 16px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); }

/* quiet centered statement (hub) */
.statement { padding: 16vh 0; }
.statement h2 { text-align: center; }
.statement .prose { text-align: center; margin-left: auto; margin-right: auto; }
.statement .prose + .prose { margin-top: 16px; }

/* ---------- panels / pricing / stats: glass on the dark wall ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.split.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 760px) { .split, .split.three { grid-template-columns: 1fr; } }

.panel {
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  padding: 28px;
}
.panel .kicker { margin-bottom: 10px; }
a.panel { display: block; text-decoration: none; color: inherit; transition: border-color 0.35s ease, background 0.35s ease; }
a.panel:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
a.panel .go-line {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
  display: inline-block; margin-top: 14px;
}
a.panel:hover .go-line { text-decoration: underline; text-underline-offset: 4px; }
.panel .price { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; margin-bottom: 10px; }
.panel p { color: var(--soft); font-size: 15.5px; }
.panel h3 + p { margin-top: 4px; }
.panel ul { margin: 12px 0 0 18px; color: var(--soft); font-size: 15.5px; }
.panel li { margin-top: 6px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin: 8px 0 24px;
}
.stat {
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  padding: 20px;
}
.stat .n { font-family: var(--serif); font-weight: 300; font-size: 2rem; display: block; color: var(--accent); }
.stat .l { font-size: 13px; color: var(--soft); margin-top: 4px; display: block; }

/* ---------- buttons: gallery pills ---------- */

.btn {
  display: inline-block;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none;
  padding: 13px 28px; border-radius: 999px;
  color: var(--paper); background: var(--accent);
  border: 1px solid var(--accent);
  margin-top: 26px;
  transition: filter 0.3s ease;
}
.btn:hover { filter: brightness(1.12); }

.btn.ghost {
  background: transparent; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  margin-left: 10px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.btn.ghost:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); filter: none; }

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- founder portrait: the one real photograph ---------- */

.founder { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
@media (max-width: 720px) { .founder { grid-template-columns: 1fr; } }

.portrait {
  width: 100%; display: block;
  filter: saturate(0.9) contrast(1.03);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

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

.rv {
  opacity: 0; transform: translateY(32px); filter: blur(8px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s ease;
}
.rv.in { opacity: 1; transform: none; filter: none; }

/* ---------- the entrance: doors part, the gallery opens ---------- */

.entry { display: none; }

.entry-hold body { overflow: hidden; }
.entry-hold .entry {
  display: flex;
  align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 1000;
}
.entry-door {
  position: absolute; top: 0; bottom: 0; width: 50.05%;
  background: #100d0a;
  transition: transform 1.15s cubic-bezier(0.7, 0, 0.2, 1);
}
.entry-door.l { left: 0; border-right: 1px solid rgba(236, 231, 218, 0.12); }
.entry-door.r { right: 0; border-left: 1px solid rgba(236, 231, 218, 0.12); }
.entry-center {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  transition: opacity 0.5s ease;
}
.entry-center .rook { height: 44px; width: auto; color: #94ab70; }
.entry-mark {
  font-family: var(--mono); font-weight: 600;
  font-size: 15px; letter-spacing: 0.55em; text-indent: 0.55em;
  color: #ece7da;
}
.entry-enter {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
  color: #94ab70;
  background: none; border: 1px solid rgba(236, 231, 218, 0.18); border-radius: 999px;
  padding: 12px 30px; cursor: pointer;
  transition: border-color 0.3s ease;
}
.entry-enter:hover { border-color: #94ab70; }
.entry.open .entry-center { opacity: 0; }
.entry.open .entry-door.l { transform: translateX(-101%); }
.entry.open .entry-door.r { transform: translateX(101%); }

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

footer {
  background: rgba(16, 13, 10, 0.72);
  border-top: 1px solid var(--line);
  margin-top: 48px;
  color: var(--soft);
  backdrop-filter: blur(6px);
}

.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 56px 24px 40px;
}

@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }

.f-brand .wordmark { color: var(--ink); margin-bottom: 14px; }
.f-brand .wordmark .rook { color: #94ab70; }
.f-brand p {
  font-family: var(--mono); font-size: 12.5px;
  max-width: 34ch; color: var(--soft);
}

.f-col h4 {
  font-family: var(--mono); font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.f-col a, .f-col span {
  display: block; font-size: 14.5px; color: var(--soft);
  text-decoration: none; margin-bottom: 9px;
}
.f-col a:hover { color: var(--ink); }

.f-bottom {
  border-top: 1px solid var(--line);
  padding: 20px 24px 28px;
  font-size: 12.5px; color: var(--soft);
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; filter: none; }
  .scroll-cue, .bm-bro .bcaret { animation: none; }
  #wall { display: none; }
  html { scroll-behavior: auto; }
  .entry { display: none; }
}
