/* ============================================================
   CRUXWORX - "Celestial navigation instrument"
   Deep indigo night / brass-sextant gold / real stellar light
   Fraunces (display), Instrument Sans (body), Space Mono (labels)
   ============================================================ */

:root {
    --void:        #05070f;
    --night:       #0a0e1c;
    --night-2:     #0f1530;
    --night-3:     #161e42;
    --line:        rgba(217, 181, 107, 0.16);
    --line-soft:   rgba(220, 228, 255, 0.08);

    --star:        #f5f2e9;
    --star-dim:    #aab4d2;
    --muted:       #6f7aa0;

    --brass:       #d9b56b;
    --brass-bright:#f0d59c;
    --brass-deep:  #b88f44;

    --hot:         #bcd6ff;
    --cool:        #ffd2a6;

    --maxw: 1240px;
    --ease: cubic-bezier(.22, 1, .36, 1);

    --f-display: "Fraunces", Georgia, serif;
    --f-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
    --f-mono: "Space Mono", "Consolas", monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--f-body);
    background: var(--void);
    color: var(--star-dim);
    line-height: 1.6;
    font-size: 17px;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.035;
    mix-blend-mode: screen;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(217,181,107,0.28); color: var(--star); }

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

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

.mono {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--brass);
}

/* ---------- NAV ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 32px;
    transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s var(--ease);
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(7, 9, 18, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 14px 32px;
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .glyph { width: 22px; height: 30px; flex: none; }
.brand .word {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.32rem;
    letter-spacing: 0.04em;
    color: var(--star);
}
.brand .word b { color: var(--brass-bright); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a {
    font-size: 0.82rem; letter-spacing: 0.04em; color: var(--star-dim);
    transition: color .25s; position: relative;
}
.nav-links a:hover { color: var(--star); }
.nav-links a:not(.btn)::after {
    content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
    background: var(--brass); transition: width .3s var(--ease);
}
.nav-links a:not(.btn):hover::after { width: 100%; }
.btn {
    border: 1px solid var(--brass); color: var(--brass-bright);
    padding: 9px 18px; border-radius: 2px; font-size: 0.78rem; letter-spacing: 0.06em;
    transition: background .3s, color .3s, box-shadow .3s;
}
.btn:hover { background: var(--brass); color: var(--void); box-shadow: 0 0 28px rgba(217,181,107,0.35); }

/* ---------- HERO ---------- */
.hero {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    background:
        radial-gradient(140% 90% at 78% 18%, rgba(22,30,66,0.85) 0%, transparent 55%),
        radial-gradient(120% 100% at 12% 100%, rgba(15,21,48,0.7) 0%, transparent 60%),
        linear-gradient(180deg, var(--void) 0%, var(--night) 60%, var(--void) 100%);
    overflow: hidden;
}
#starfield { position: absolute; inset: 0; z-index: 1; }
.hero-glow {
    position: absolute; z-index: 1; top: 6%; right: 4%;
    width: 620px; height: 620px; max-width: 70vw; max-height: 70vw;
    background: radial-gradient(circle, rgba(188,214,255,0.10) 0%, rgba(217,181,107,0.05) 35%, transparent 68%);
    filter: blur(8px); pointer-events: none;
}

.hero .wrap { position: relative; z-index: 3; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; padding-top: 90px; padding-bottom: 60px; }

.hero-copy { max-width: 620px; }
.hero-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.hero-eyebrow .tick { width: 38px; height: 1px; background: var(--brass); opacity: .6; }

.hero h1 {
    font-family: var(--f-display);
    font-weight: 340;
    font-size: clamp(3.1rem, 7.4vw, 6.2rem);
    line-height: 0.96;
    letter-spacing: -0.02em;
    color: var(--star);
    margin-bottom: 28px;
    font-optical-sizing: auto;
}
.hero h1 em { font-style: italic; font-weight: 340; color: var(--brass-bright); position: relative; }
.hero h1 .find { display: block; color: var(--star-dim); font-size: 0.42em; letter-spacing: 0.02em; font-weight: 400; margin-bottom: 0.1em; }

.lede { font-size: 1.12rem; color: var(--star-dim); max-width: 520px; margin-bottom: 38px; }
.lede b { color: var(--star); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.product-chip {
    display: flex; flex-direction: column; gap: 3px;
    border: 1px solid var(--line); border-radius: 3px;
    padding: 14px 22px 15px;
    background: rgba(15,21,48,0.4); transition: border-color .3s, transform .3s, background .3s;
}
.product-chip:hover { border-color: var(--brass); transform: translateY(-3px); background: rgba(22,30,66,0.55); }
.product-chip .pc-name { color: var(--star); font-size: 1.02rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.product-chip .pc-url { font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--muted); }
.product-chip .arr { color: var(--brass); transition: transform .3s; }
.product-chip:hover .arr { transform: translate(4px,-4px); }
.chip-note { font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; max-width: 190px; line-height: 1.7; }

.hero-crux { position: relative; display: flex; justify-content: center; align-items: center; }
.crux-svg { width: 100%; max-width: 460px; height: auto; overflow: visible; }

.scroll-cue {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 4;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.3em; color: var(--muted);
}
.scroll-cue .bar { width: 1px; height: 46px; background: linear-gradient(var(--brass), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0%,100%{transform:scaleY(.3);opacity:.4} 50%{transform:scaleY(1);opacity:1} }

/* ---------- CONSTELLATION ---------- */
.crux-line { stroke: var(--brass); stroke-width: 1; opacity: 0.5; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.6s var(--ease) .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.crux-star { transform-box: fill-box; transform-origin: center; }
.crux-star circle.core { animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%,100%{opacity:.85} 50%{opacity:1} }
.crux-label { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.14em; fill: var(--star-dim); opacity: 0; animation: fadein 1s ease 2.4s forwards; }
.crux-mag { font-family: var(--f-mono); font-size: 6.5px; fill: var(--muted); opacity: 0; animation: fadein 1s ease 2.7s forwards; }
@keyframes fadein { to { opacity: .85; } }

/* ---------- SECTIONS ---------- */
section { position: relative; }
.section-pad { padding: 130px 0; }

.kicker { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.kicker .num { font-family: var(--f-mono); font-size: 0.7rem; color: var(--brass); letter-spacing: 0.2em; }
.kicker .rule { flex: 1; height: 1px; background: var(--line); max-width: 120px; }

.h2 {
    font-family: var(--f-display); font-weight: 360;
    font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -0.015em;
    color: var(--star);
}
.h2 em { font-style: italic; color: var(--brass-bright); }

/* ---------- THE CRUX ---------- */
.crux-section { background: linear-gradient(180deg, var(--void), var(--night) 50%, var(--void)); }
.crux-intro { max-width: 720px; margin-bottom: 70px; }
.crux-intro .h2 { margin-bottom: 24px; }
.crux-intro p { font-size: 1.12rem; color: var(--star-dim); }

.triad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.triad .cell { background: var(--night); padding: 44px 36px 48px; position: relative; transition: background .4s var(--ease); }
.triad .cell:hover { background: var(--night-2); }
.triad .cell .ico { height: 52px; margin-bottom: 28px; color: var(--brass); }
.triad .cell h3 { font-family: var(--f-display); font-weight: 460; font-style: italic; font-size: 1.5rem; color: var(--star); margin-bottom: 6px; }
.triad .cell .tag { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.2em; color: var(--brass-deep); text-transform: uppercase; margin-bottom: 16px; display: block; }
.triad .cell p { font-size: 0.97rem; color: var(--star-dim); }

/* ---------- PINLY (single product) ---------- */
.pinly { background: var(--void); }
.pinly-head { max-width: 780px; margin-bottom: 60px; }
.pinly-head .h2 { margin-bottom: 24px; }
.pinly-head p { font-size: 1.1rem; }

.pinly-main { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 26px; align-items: stretch; }

.pinly-card {
    position: relative; overflow: hidden;
    border: 1px solid var(--line); border-radius: 4px;
    padding: 48px 46px 42px;
    background: radial-gradient(120% 80% at 100% 0%, rgba(22,30,66,0.6), transparent 60%), var(--night);
    transition: border-color .5s, box-shadow .5s, transform .5s var(--ease);
    display: flex; flex-direction: column;
}
.pinly-card::before {
    content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .5s;
    background: radial-gradient(90% 60% at 100% 0%, rgba(217,181,107,0.10), transparent 55%);
}
.pinly-card:hover { transform: translateY(-5px); border-color: var(--brass); box-shadow: 0 24px 60px -28px rgba(0,0,0,0.85), 0 0 40px -18px rgba(217,181,107,0.4); }
.pinly-card:hover::before { opacity: 1; }
.pinly-card .pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; position: relative; }
.pinly-card .prod-mark { width: 50px; height: 50px; color: var(--brass); }
.pinly-card .stage { font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--brass-deep); border: 1px solid var(--line); padding: 5px 10px; border-radius: 100px; text-transform: uppercase; }
.pinly-card h3 { font-family: var(--f-display); font-weight: 420; font-size: 2.4rem; color: var(--star); letter-spacing: -0.01em; margin-bottom: 6px; position: relative; }
.pinly-card .motto { font-style: italic; font-family: var(--f-display); color: var(--brass-bright); font-size: 1.14rem; margin-bottom: 22px; position: relative; }
.pinly-card p { color: var(--star-dim); font-size: 1.01rem; margin-bottom: 16px; position: relative; }
.prod-link {
    display: inline-flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 26px;
    font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--brass-bright);
    transition: gap .3s; position: relative;
}
.pinly-card:hover .prod-link { gap: 16px; }
.prod-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 10px var(--brass); }

/* refusals panel */
.refuse { border: 1px solid var(--line); border-radius: 4px; background: var(--night); padding: 40px 36px 34px; display: flex; flex-direction: column; }
.refuse h4 { font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.2em; color: var(--brass); text-transform: uppercase; margin-bottom: 8px; }
.refuse .sub { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; }
.refuse ul { list-style: none; }
.refuse li { position: relative; padding: 11px 0; font-size: 1.02rem; color: var(--star-dim); border-bottom: 1px solid var(--line-soft); }
.refuse li:last-child { border-bottom: 0; }
.refuse li span { position: relative; display: inline-block; }
.refuse li span::after {
    content: ""; position: absolute; left: -2px; top: 52%; height: 1px; width: 0;
    background: var(--brass); box-shadow: 0 0 8px rgba(217,181,107,0.7);
    transition: width .7s var(--ease);
}
.refuse.in li:nth-child(1) span::after { width: calc(100% + 4px); transition-delay: .10s; }
.refuse.in li:nth-child(2) span::after { width: calc(100% + 4px); transition-delay: .22s; }
.refuse.in li:nth-child(3) span::after { width: calc(100% + 4px); transition-delay: .34s; }
.refuse.in li:nth-child(4) span::after { width: calc(100% + 4px); transition-delay: .46s; }
.refuse.in li:nth-child(5) span::after { width: calc(100% + 4px); transition-delay: .58s; }
.refuse.in li:nth-child(6) span::after { width: calc(100% + 4px); transition-delay: .70s; }
.refuse .foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 1rem; color: var(--star); font-family: var(--f-display); font-style: italic; }

/* what it does instead */
.instead { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 26px; }
.instead .ic { background: var(--night); padding: 30px 26px 32px; }
.instead .ic .k { font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--brass-deep); text-transform: uppercase; margin-bottom: 12px; }
.instead .ic h5 { font-family: var(--f-display); font-weight: 440; font-size: 1.16rem; color: var(--star); margin-bottom: 8px; }
.instead .ic p { font-size: 0.9rem; color: var(--star-dim); }

/* ---------- GLOBAL / ONE SKY ---------- */
.global { background: linear-gradient(180deg, var(--void), var(--night) 45%, var(--void)); overflow: hidden; }
.global-head { max-width: 800px; margin-bottom: 50px; }
.global-head .h2 { margin-bottom: 26px; }
.global-head p { font-size: 1.12rem; }

.sky-wrap { position: relative; margin: 0 0 58px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, rgba(15,21,48,0.55), rgba(5,7,15,0.25)); padding: 16px 10px 6px; }
.sky-svg { width: 100%; height: auto; display: block; overflow: visible; }
.sky-school { opacity: 0; animation: skyin 1.2s var(--ease) forwards; animation-delay: var(--d); }
@keyframes skyin { to { opacity: var(--o, 1); } }
.sky-cap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 10px 20px 8px; }
.sky-cap span { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.sky-cap span b { color: var(--brass); font-weight: 400; }

.gcols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; }
.gcol { border-top: 1px solid var(--line); padding-top: 26px; }
.gcol .gn { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.2em; color: var(--brass); text-transform: uppercase; margin-bottom: 14px; display: block; }
.gcol h4 { font-family: var(--f-display); font-style: italic; font-weight: 440; font-size: 1.42rem; color: var(--star); margin-bottom: 12px; }
.gcol p { font-size: 0.98rem; color: var(--star-dim); }

.global-note {
    margin-top: 60px; border-left: 2px solid var(--brass); padding: 6px 0 6px 26px;
    font-family: var(--f-display); font-style: italic; color: var(--star); font-size: 1.22rem; max-width: 740px;
}

/* ---------- PRINCIPLES ---------- */
.principles { background: linear-gradient(180deg, var(--void), var(--night-2) 120%); }
.prin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 50px 44px; margin-top: 60px; }
.prin { border-top: 1px solid var(--line); padding-top: 24px; }
.prin .pn { font-family: var(--f-mono); font-size: 0.7rem; color: var(--brass); letter-spacing: 0.18em; margin-bottom: 16px; display:block; }
.prin h4 { font-family: var(--f-display); font-style: italic; font-weight: 440; font-size: 1.4rem; color: var(--star); margin-bottom: 10px; }
.prin p { font-size: 0.95rem; color: var(--star-dim); }

/* ---------- STORY ---------- */
.company { background: var(--void); overflow: hidden; }
.company .wrap { display: grid; grid-template-columns: 1fr 0.85fr; gap: 70px; align-items: center; }
.company .h2 { margin-bottom: 26px; }
.company p { color: var(--star-dim); font-size: 1.06rem; margin-bottom: 22px; max-width: 540px; }
.company .note {
    border-left: 2px solid var(--brass); padding: 4px 0 4px 22px; margin-top: 34px;
    font-style: italic; font-family: var(--f-display); color: var(--star); font-size: 1.12rem; max-width: 520px;
}
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.fact { background: var(--night); padding: 30px 28px; }
.fact .fk { font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.2em; color: var(--brass-deep); text-transform: uppercase; margin-bottom: 12px; }
.fact .fv { font-family: var(--f-display); font-size: 1.5rem; color: var(--star); font-weight: 380; }
.fact .fv small { display:block; font-family: var(--f-body); font-size: 0.82rem; color: var(--star-dim); margin-top: 4px; letter-spacing: 0; }

/* ---------- FOOTER ---------- */
footer { background: var(--night); border-top: 1px solid var(--line); padding: 80px 0 40px; position: relative; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 60px; }
.foot-brand .word { font-family: var(--f-display); font-size: 1.6rem; color: var(--star); display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.foot-brand p { max-width: 340px; font-size: 0.95rem; color: var(--star-dim); }
.foot-col h5 { font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.2em; color: var(--brass); text-transform: uppercase; margin-bottom: 20px; }
.foot-col a { display: block; color: var(--star-dim); font-size: 0.92rem; margin-bottom: 12px; transition: color .25s; }
.foot-col a:hover { color: var(--brass-bright); }
.foot-col a .u { display:block; font-family: var(--f-mono); font-size: 0.62rem; color: var(--muted); letter-spacing: 0.06em; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid var(--line); }
.foot-bottom span { font-size: 0.78rem; color: var(--muted); }
.foot-bottom .mono { color: var(--muted); }

/* reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1040px) {
    .instead { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
    .hero .wrap { grid-template-columns: 1fr; gap: 10px; }
    .hero-crux { order: -1; max-width: 360px; margin: 0 auto; }
    .crux-svg { max-width: 320px; }
    .company .wrap { grid-template-columns: 1fr; gap: 44px; }
    .triad { grid-template-columns: 1fr; }
    .pinly-main { grid-template-columns: 1fr; }
    .gcols { grid-template-columns: 1fr; gap: 34px; }
    .prin-grid { grid-template-columns: 1fr 1fr; }
    .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    body { font-size: 16px; }
    .wrap { padding: 0 22px; }
    .nav { padding: 16px 22px; }
    .nav-links { display: none; }
    .section-pad { padding: 90px 0; }
    .prin-grid, .foot-grid, .facts, .instead { grid-template-columns: 1fr; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .chip-note { max-width: none; }
    .pinly-card { padding: 36px 26px 32px; }
    .refuse { padding: 32px 24px 28px; }
    .sky-wrap { padding: 10px 4px 4px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
    .crux-line { stroke-dashoffset: 0; }
    .crux-label, .crux-mag { opacity: .85; }
    .sky-school { opacity: var(--o, 1); }
    .refuse li span::after { width: calc(100% + 4px); }
}
