/* Dark theme; brand colours sampled from the logo gradient (blue -> violet). */
:root {
  --bg: #060a14; --bg-2: #0b1222; --panel: rgba(13, 20, 38, .78); --line: rgba(255, 255, 255, .09);
  --text: #dbe3f0; --muted: #8d99b0; --white: #fff;
  --blue: #2f7bff; --violet: #8b5cf6; --grad: linear-gradient(90deg, var(--blue), var(--violet));
  --display: Bahnschrift, "DIN Alternate", "Arial Narrow", system-ui, sans-serif;   /* Bahnschrift ships with Windows 10+ */
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: system-ui, Segoe UI, Roboto, sans-serif; color: var(--text); line-height: 1.6; background: var(--bg); }
a { color: #7fa8ff; }
a:hover { color: #b39bff; }

.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
       flex-wrap: wrap; gap: 1rem; padding: .75rem 5vw; background: rgba(6, 10, 20, .72);
       backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { height: 34px; display: block; }
.top nav a { margin-left: 1.25rem; color: var(--muted); text-decoration: none; font-weight: 600; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--white); }

section { padding: 4rem 5vw; max-width: 1200px; margin: 0 auto; scroll-margin-top: 70px; }
h1, h2, h3 { color: var(--white); }
h2 { font-size: 1.8rem; margin-top: 0; line-height: 1.2; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker { letter-spacing: .2em; font-size: .78rem; font-weight: 700; color: #9db8ff; margin: 0; }

.btn { display: inline-flex; align-items: center; gap: .8rem; margin-top: 1.1rem; padding: .7rem 1.1rem; color: #fff; text-decoration: none;
       font: 600 .78rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--blue);
       background: linear-gradient(var(--blue), var(--violet)) no-repeat 0 0 / 0 100%; transition: background-size .35s ease, border-color .35s; }
.btn::after { content: "→"; transition: transform .35s; }
.btn:hover { color: #fff; background-size: 100% 100%; border-color: var(--violet); }
.btn:hover::after { transform: translateX(4px); }
.btn.ghost { border-color: rgba(255, 255, 255, .25); margin-left: .5rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.cards article { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding-bottom: 1rem; position: relative; }
.cards article::before { content: ""; display: block; height: 3px; background: var(--grad); }
.cards img { width: 100%; height: 180px; object-fit: cover; display: block; opacity: .85; }
.cards h3, .cards p { padding: 0 1rem; }
.cards h3 { font-size: 1.1rem; }
.cards a.more { padding: 0 1rem; font-weight: 600; text-decoration: none; }

.contact ul { list-style: none; padding: 0; }
.contact li { margin: .4rem 0; }

/* inner pages */
.page-hero { max-width: none; padding: 5rem 5vw 3.5rem;
  background: radial-gradient(circle at 85% 20%, rgba(139, 92, 246, .35), transparent 45%),
              radial-gradient(circle at 10% 90%, rgba(47, 123, 255, .3), transparent 45%), var(--bg-2); }
.page-hero h1 { margin: .3rem 0 .8rem; font-size: clamp(1.6rem, 3.5vw, 2.6rem); }
.page-hero p { max-width: 760px; font-size: 1.1rem; margin: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1rem 1rem 3.2rem; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 1rem; top: 1rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
                    background: var(--grad); color: #fff; font-weight: 700; text-align: center; line-height: 1.6rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.tags li { border: 1px solid rgba(127, 211, 255, .35); color: #c5e6ff; padding: .2rem .6rem; font: .78rem/1.6 var(--mono); letter-spacing: .06em; }
.cta { background: var(--bg-2); border-top: 1px solid var(--line); text-align: center; max-width: none; }

footer { background: #03060d; border-top: 1px solid var(--line); color: var(--muted); text-align: center; padding: 1.5rem; font-size: .9rem; position: relative; z-index: 1; }

/* ---------- home: scroll story over a fixed 3D canvas ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
         background: radial-gradient(circle at 70% 50%, #10183a 0%, var(--bg) 60%); }
.story { position: relative; z-index: 1; }
.chapter { min-height: 100vh; display: flex; align-items: center; max-width: none; padding: 6rem 6vw; }
/* text panels: navigation-HUD look (corner brackets, mono labels, outlined chapter number), no glass card */
.story { counter-reset: ch; }
.chapter:not(.intro) { counter-increment: ch; }
.chapter .panel { position: relative; max-width: 560px; padding: 2.4rem 2.4rem 2rem;
                  --c: rgba(157, 184, 255, .7);   /* corner brackets drawn with 8 gradients */
                  background-image: linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
                                    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
                                    linear-gradient(135deg, rgba(6, 10, 20, .85), rgba(6, 10, 20, .5));
                  background-size: 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px, 100% 100%;
                  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%, 0 0;
                  background-repeat: no-repeat;
                  opacity: .3; transform: translateX(-30px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.chapter:nth-child(even) .panel { transform: translateX(30px); }
.chapter.active .panel { opacity: 1; transform: none; }
.chapter .panel::after { content: counter(ch, decimal-leading-zero); position: absolute; top: -3.2rem; right: 1rem; font: 700 6.5rem/1 var(--display);
                         color: transparent; -webkit-text-stroke: 1px rgba(139, 92, 246, .45); pointer-events: none; }
.chapter.intro .panel::after { display: none; }
.chapter .panel h2 { font: 700 clamp(1.7rem, 3vw, 2.4rem)/1.08 var(--display); letter-spacing: -.01em; margin: .7rem 0 1rem; }
.chapter.intro .panel { background: none; max-width: 660px; padding: 0; }
.chapter.intro h1 { font: 700 clamp(2.4rem, 5.4vw, 4.2rem)/1.02 var(--display); letter-spacing: -.02em; margin: .8rem 0 1.2rem; }
.chapter.intro p { font-size: 1.12rem; }
.chapter ul.tags { margin: 1rem 0 0; }
.muted { color: var(--muted); }
.kicker { font-family: var(--mono); font-weight: 500; letter-spacing: .14em; color: #7fd3ff; display: flex; align-items: center; gap: .7rem; }
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.feat { list-style: none; padding: 0; margin: 1.3rem 0 .6rem; counter-reset: f; border-top: 1px dashed rgba(157, 184, 255, .25); }
.feat li { counter-increment: f; display: grid; grid-template-columns: 2.6rem 1fr; padding: .55rem 0; border-bottom: 1px dashed rgba(157, 184, 255, .25); font-size: .95rem; }
.feat li::before { content: "/" counter(f, decimal-leading-zero); font: .75rem/1.9 var(--mono); color: #7fd3ff; }
.stats { display: flex; flex-wrap: wrap; gap: 1rem 2.2rem; margin: 1.6rem 0 .6rem; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats b { display: block; font-size: 1.25rem; color: var(--white); }
.stats span { font-size: .85rem; color: var(--muted); }

.dots { position: fixed; right: 2vw; top: 50%; transform: translateY(-50%); z-index: 5; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.dots a { display: block; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: transform .3s, background .3s; }
.dots a[aria-current="true"] { background: var(--grad); transform: scale(1.5); }
.scene-label { position: fixed; left: 50%; transform: translateX(-50%); bottom: 4vh; z-index: 1; color: var(--muted); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; }

/* alternate sides: even chapters put the text on the right, scene3d.js moves the figure left */
@media (min-width: 901px) { .chapter:nth-child(even) { justify-content: flex-end; padding-right: 8vw; } }
@media (max-width: 900px) {
  .chapter { align-items: flex-end; padding: 5rem 5vw 3rem; }
  .chapter .panel { background-color: rgba(8, 13, 26, .7); }   /* keep the bracket images, just darken for legibility */
  .chapter .panel::after { font-size: 4.5rem; top: -2.4rem; }
  .dots, .scene-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .chapter .panel { transition: none; opacity: 1; transform: none; } }
