/* Product pages (/work/*) — shares the portfolio's tokens, type and colour. */
:root {
    --bg: #06060A; --bg-2: #0A0A12; --raised: #141425;
    --line: rgba(255,255,255,0.07); --line-2: rgba(255,255,255,0.12);
    --text: #F0F0F8; --text-2: #A3A3BF; --muted: #85859E; --heading: #FFFFFF;
    --accent: #7C3AED; --accent-text: #A78BFA; --accent-rgb: 124, 58, 237;
    --g1: #5B5BD6; --g2: #7C3AED; --g3: #EC4899;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}
html.light {
    --bg: #F4F3FA; --bg-2: #EEEDF6; --raised: #FFFFFF;
    --line: rgba(79,70,229,0.08); --line-2: rgba(79,70,229,0.16);
    --text: #0D0C1F; --text-2: #4F4C6B; --muted: #67647F; --heading: #07061A;
    --accent: #4F46E5; --accent-text: #4F46E5; --accent-rgb: 79, 70, 229;
    --g1: #4F46E5; --g2: #7C3AED; --g3: #DB2777;
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 400 1rem/1.7 'Space Grotesk', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(60rem 30rem at 85% -10%, rgba(var(--accent-rgb), 0.14), transparent 60%);
    background-repeat: no-repeat;
}
a { color: inherit; }
::selection { background: rgba(var(--accent-rgb), 0.35); }
.w-skip { position: absolute; left: -999px; top: 0; }
.w-skip:focus { left: 1rem; top: 1rem; z-index: 100; padding: 0.5rem 0.8rem; background: var(--raised); border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }

/* ---- Top bar ---- */
.w-bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--line);
}
.w-back { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 600; font-size: 0.88rem; color: var(--text); white-space: nowrap; }
.w-back svg { transition: transform 0.3s var(--ease); }
.w-back:hover svg { transform: translateX(-3px); }
.w-switch { display: flex; gap: 0.2rem; padding: 0.25rem; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 60%, transparent); }
.w-switch a { padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.76rem; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; transition: color 0.2s, background 0.2s; }
.w-switch a:hover { color: var(--text); }
.w-switch a.is-viewed::after { content: '✓'; margin-left: 0.3rem; font-size: 0.66rem; color: var(--accent-text); opacity: 0.8; }
.w-next-slot > [hidden] { display: none !important; }
.w-switch a[aria-current="page"] { color: var(--heading); background: rgba(var(--accent-rgb), 0.18); }
.w-bar-end { display: flex; align-items: center; gap: 0.5rem; }
.w-theme { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--text-2); border: 1px solid var(--line); cursor: pointer; }
.w-theme:hover { color: var(--text); border-color: var(--line-2); }
.w-live-sm { font-size: 0.8rem; font-weight: 600; text-decoration: none; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid rgba(var(--accent-rgb), 0.4); color: var(--accent-text); white-space: nowrap; }
.w-resume-sm { font-size: 0.8rem; font-weight: 600; text-decoration: none; padding: 0.45rem 0.85rem; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); white-space: nowrap; }
.w-resume-sm:hover { filter: brightness(1.08); }
.w-live-sm:hover { background: rgba(var(--accent-rgb), 0.12); }
@media (max-width: 1023px) { .w-switch { display: none; } }

/* ---- Hero ---- */
main { overflow-x: clip; max-width: 1120px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.w-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.w-eyebrow { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1.1rem; font: 500 0.72rem 'JetBrains Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.w-eyebrow span:first-child { color: var(--accent-text); }
.w-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
h1 { margin: 0 0 1.25rem; font: 800 clamp(2.6rem, 6.4vw, 5rem)/1 'Syne', sans-serif; letter-spacing: -0.035em; color: var(--heading); text-wrap: balance; }
body[data-product="vidyarambham"] h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.04; }
.w-lede { margin: 0 0 2rem; font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.6; color: var(--text-2); max-width: 34rem; text-wrap: pretty; }
.w-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.w-btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.8rem 1.35rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.w-btn-primary { color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), 0.7); }
.w-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(var(--accent-rgb), 0.8); }
.w-status { display: inline-flex; align-items: center; gap: 0.45rem; font: 500 0.7rem 'JetBrains Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.w-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.w-status[data-s="live"]::before { background: #22C55E; box-shadow: 0 0 10px rgba(34,197,94,0.6); }
.w-status[data-s="preview"]::before { background: #F59E0B; box-shadow: 0 0 10px rgba(245,158,11,0.5); }
.w-status[data-s="seasonal"]::before { background: #38BDF8; }

.w-hero-art {
    position: relative; aspect-ratio: 4 / 3; border-radius: 24px; display: grid; place-items: center;
    color: var(--accent-text); border: 1px solid var(--line-2);
    background:
        radial-gradient(80% 70% at 30% 10%, rgba(var(--accent-rgb), 0.22), transparent 60%),
        radial-gradient(60% 60% at 90% 100%, rgba(236, 72, 153, 0.12), transparent 60%),
        var(--raised);
    overflow: hidden;
}
.w-hero-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); pointer-events: none; }
.w-hero-art svg { position: relative; z-index: 1; width: 70%; height: auto; }
.w-soft { fill: currentColor; opacity: 0.25; }
.w-bg { fill: var(--raised); }
.w-node { fill: var(--raised); stroke: currentColor; stroke-width: 2.2; }
.w-mode { font: 600 7px 'JetBrains Mono', monospace; letter-spacing: 0.08em; fill: currentColor; opacity: 0.6; }
.w-glyph { font: 700 16px 'Space Grotesk', sans-serif; fill: currentColor; }
.w-route { stroke-dasharray: 6 7; animation: w-dash 2.6s linear infinite; }
@keyframes w-dash { to { stroke-dashoffset: -52; } }

/* ---- Facts ---- */
.w-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 clamp(3rem, 7vw, 5rem); border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--raised) 55%, transparent); overflow: hidden; }
.w-fact { padding: 1.1rem 1.25rem; border-left: 1px solid var(--line); }
.w-fact:first-child { border-left: none; }
.w-fact dt { font: 500 0.66rem 'JetBrains Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.w-fact dd { margin: 0; font-weight: 600; font-size: 0.92rem; line-height: 1.4; color: var(--heading); }

/* ---- Body + TOC ---- */
.w-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.w-toc { position: sticky; top: 5.5rem; display: flex; flex-direction: column; gap: 0.15rem; }
.w-toc-h { margin: 0 0 0.6rem; font: 500 0.66rem 'JetBrains Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.w-toc a { display: flex; gap: 0.6rem; padding: 0.3rem 0 0.3rem 0.75rem; font-size: 0.82rem; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); transition: color 0.2s, border-color 0.2s; }
.w-toc a span { font: 500 0.68rem 'JetBrains Mono', monospace; padding-top: 0.15rem; opacity: 0.7; }
.w-toc a:hover { color: var(--text); }
.w-toc a.is-on { color: var(--heading); border-left-color: var(--accent-text); }
.w-body { max-width: 680px; }
.w-sec { padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.w-sec-n { margin: 0 0 0.35rem; font: 500 0.7rem 'JetBrains Mono', monospace; letter-spacing: 0.1em; color: var(--accent-text); }
.w-sec h2 { margin: 0 0 1rem; font: 700 clamp(1.45rem, 2.6vw, 1.85rem)/1.2 'Syne', sans-serif; letter-spacing: -0.02em; color: var(--heading); }
.w-sec p { margin: 0 0 1rem; color: var(--text-2); font-size: 1.04rem; }
.w-sec strong { color: var(--text); font-weight: 600; }
.w-sec ul { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: 0.7rem; }
.w-sec ul li { position: relative; padding-left: 1.4rem; color: var(--text-2); font-size: 1.02rem; }
.w-sec ul li::before { content: ''; position: absolute; left: 0.2rem; top: 0.72em; width: 6px; height: 6px; border-radius: 2px; transform: rotate(45deg); background: var(--accent-text); opacity: 0.8; }

.w-quote { position: relative; margin: 0.25rem 0 1rem; padding: 1.5rem 1.6rem; border-radius: 16px; border: 1px solid rgba(var(--accent-rgb), 0.28); background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(236, 72, 153, 0.05)); }
.w-quote p { margin: 0; font: 600 clamp(1.1rem, 2vw, 1.3rem)/1.5 'Space Grotesk', sans-serif; color: var(--heading); }
.w-quote::before { content: ''; position: absolute; left: 0; top: 1.2rem; bottom: 1.2rem; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--g1), var(--g3)); }

.w-sec ul.w-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.w-sec ul.w-tags li { padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--line-2); font: 500 0.78rem 'JetBrains Mono', monospace; color: var(--text); }
.w-sec ul.w-tags li::before { display: none; }

.w-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; counter-reset: s; }
.w-steps li { position: relative; display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 60%, transparent); }
.w-steps li:not(:last-child)::after { content: '→'; position: absolute; right: -0.65rem; top: 1rem; z-index: 1; font-size: 0.85rem; color: var(--accent-text); }
.w-step-n { font: 500 0.66rem 'JetBrains Mono', monospace; color: var(--accent-text); }
.w-steps strong { color: var(--heading); font-size: 0.98rem; }
.w-steps span:last-child { font-size: 0.86rem; line-height: 1.5; color: var(--text-2); }

/* ---- Next product ---- */
.w-next { display: grid; grid-template-columns: 1fr 220px; gap: 2rem; align-items: center; margin: clamp(2rem, 5vw, 3rem) 0 0; padding: clamp(1.5rem, 4vw, 2.25rem); border-radius: 22px; border: 1px solid var(--line-2); text-decoration: none; background: radial-gradient(70% 100% at 100% 0%, rgba(var(--accent-rgb), 0.16), transparent 60%), var(--raised); transition: border-color 0.3s, transform 0.3s var(--ease); }
.w-next:hover { border-color: rgba(var(--accent-rgb), 0.5); transform: translateY(-3px); }
.w-next-text { display: flex; flex-direction: column; gap: 0.4rem; }
.w-next-label { font: 500 0.68rem 'JetBrains Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.w-next-name { font: 800 clamp(1.6rem, 3.4vw, 2.4rem)/1.1 'Syne', sans-serif; letter-spacing: -0.02em; color: var(--heading); }
.w-next-lede { color: var(--text-2); font-size: 0.95rem; max-width: 34rem; }
.w-next-art { color: var(--accent-text); }
.w-next-art svg { width: 100%; height: auto; }
.w-next-art .w-route { animation: none; }

.w-end { margin: clamp(2rem, 5vw, 3rem) 0 0; padding: clamp(1.75rem, 5vw, 3rem); border-radius: 22px; text-align: center; border: 1px solid rgba(var(--accent-rgb), 0.3); background: radial-gradient(70% 120% at 50% 0%, rgba(var(--accent-rgb), 0.2), transparent 65%), var(--raised); }
.w-end-title { margin: 0.5rem 0 0.75rem; font: 800 clamp(1.7rem, 4vw, 2.6rem)/1.1 'Syne', sans-serif; letter-spacing: -0.02em; color: var(--heading); }
.w-end-text { margin: 0 auto 1.75rem; max-width: 34rem; color: var(--text-2); font-size: 1.02rem; text-wrap: pretty; }
.w-end-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.25rem; }
.w-end-link { font-size: 0.9rem; color: var(--accent-text); text-decoration: none; }
.w-end-link:hover { text-decoration: underline; }

.w-hire { max-width: 1120px; margin: clamp(2.5rem, 6vw, 4rem) auto 0; padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2.5rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.w-hire-k { margin: 0 0 0.35rem; font: 800 clamp(1.25rem, 2.6vw, 1.6rem)/1.2 'Syne', sans-serif; color: var(--heading); }
.w-hire-t { margin: 0; color: var(--text-2); max-width: 36rem; font-size: 0.95rem; }
.w-hire-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.w-btn-ghost { color: var(--accent-text); border: 1px solid rgba(var(--accent-rgb), 0.4); }
.w-btn-ghost:hover { background: rgba(var(--accent-rgb), 0.1); }

.w-foot { max-width: 1120px; margin: 0 auto; padding: 3rem clamp(1.25rem, 4vw, 2.5rem) 3.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.88rem; color: var(--muted); }
.w-foot p { margin: 0; }
.w-foot .w-privacy { flex-basis: 100%; font-size: 0.75rem; color: var(--muted); }
.w-foot .w-privacy a { color: inherit; text-decoration: underline; }
.w-foot a { color: var(--accent-text); text-decoration: none; }
.w-foot a:hover { text-decoration: underline; }

/* ---- Entrance ---- */
@media (prefers-reduced-motion: no-preference) {
    .w-hero-text > *, .w-hero-art, .w-facts { animation: w-in 0.8s var(--ease) both; }
    .w-hero-text > :nth-child(2) { animation-delay: 0.06s; }
    .w-hero-text > :nth-child(3) { animation-delay: 0.12s; }
    .w-hero-text > :nth-child(4) { animation-delay: 0.18s; }
    .w-hero-art { animation-delay: 0.12s; }
    .w-facts { animation-delay: 0.24s; }
}
@keyframes w-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .w-route { animation: none; } html { scroll-behavior: auto; } }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .w-hero { grid-template-columns: 1fr; padding-top: 2rem; gap: 1.75rem; }
    .w-hero-art { order: -1; aspect-ratio: auto; height: clamp(150px, 30vw, 220px); border-radius: 18px; }
    .w-hero-art svg { width: auto; height: 78%; max-width: 80%; }
    .w-facts { grid-template-columns: repeat(2, 1fr); }
    .w-fact:nth-child(3) { border-left: none; }
    .w-fact:nth-child(n+3) { border-top: 1px solid var(--line); }
    .w-layout { grid-template-columns: 1fr; }
    .w-toc { display: none; }
    .w-steps { grid-template-columns: repeat(2, 1fr); }
    .w-steps li:nth-child(2)::after { display: none; }
    .w-next { grid-template-columns: 1fr; }
    .w-next-art { display: none; }
}
@media (max-width: 520px) {
    h1 { font-size: clamp(1.8rem, 9vw, 2.6rem); }
    body[data-product="vidyarambham"] h1 { font-size: clamp(1.5rem, 7.2vw, 2.2rem); }
    .w-back span { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
    .w-live-sm { display: none; }
    .w-hire-actions, .w-hire-actions .w-btn { width: 100%; justify-content: center; }
    .w-steps { grid-template-columns: 1fr; }
    .w-steps li::after { display: none !important; }
    .w-fact { padding: 0.9rem 1rem; }
}
