/* =============================================================
   Anandhu Krishna — black velvet, violet neon
   Adapted from the Resend design system. Flat #000 canvas,
   graphite hairlines, one iris-violet accent, terminal aesthetic.
   ============================================================= */

:root {
    /* colors */
    --void:        #000000;
    --graphite:    #292d30;   /* hairline borders — every layer separation */
    --white:       #ffffff;   /* headings, hero */
    --bone:        #f0f0f0;   /* primary reading text */
    --ash:         #a1a4a5;   /* muted / metadata */
    --smoke:       #abafb4;   /* links, captions */
    --iron:        #6e727a;   /* low-emphasis strokes */
    --charcoal:    #464a4d;   /* text that disappears */
    --violet:      #9281f7;   /* the one brand accent — code/identifiers/emphasis */
    --violet-glow: #baa7ff;
    --blue:        #3b9eff;   /* signal / filenames */
    --sky:         #70b8ff;   /* strings */
    --green:       #3ad389;   /* success / booleans */
    --amber:       #ffca16;   /* numbers */
    --red:         #ff9592;
    --lift:        #0b0e14;   /* elevated panel */

    /* fonts (Google substitutes for Domaine / aBC Favorit / Commit Mono) */
    --serif:   'Instrument Serif', Georgia, 'Times New Roman', serif;
    --display: 'Inter Tight', 'Inter', -apple-system, sans-serif;
    --sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* radius */
    --r-6: 6px;    /* buttons, badges, inputs */
    --r-16: 16px;  /* cards, code windows */
    --r-24: 24px;  /* large panels */

    --maxw: 1180px;
    --pad: clamp(20px, 5vw, 48px);
}

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

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

body {
    background: var(--void);
    color: var(--bone);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--violet); color: var(--void); }

/* ---- helpers ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ash); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ash); }
.eyebrow .v { color: var(--violet); }
.hr { height: 1px; background: var(--graphite); border: 0; }

/* ---- nav ---- */
.nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; padding: 16px var(--pad);
    transition: background .3s, border-color .3s;
    border-bottom: 1px solid transparent;
}
.nav.stuck { background: rgba(0,0,0,0.72); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border-bottom-color: var(--graphite); }
.nav-brand { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; color: var(--white); display: inline-flex; align-items: center; gap: 9px; }
.nav-brand .mk { width: 9px; height: 9px; border-radius: 2px; background: linear-gradient(to bottom right in oklab, #9281f7, #9a54dc); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 14px; color: var(--bone); transition: color .15s; }
.nav-links a:hover { color: var(--white); }
@media (max-width: 680px) { .nav-links a:not(.btn) { display: none; } }

/* ---- buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--sans); font-size: 14px; font-weight: 500;
    padding: 9px 16px; border-radius: var(--r-6);
    border: 1px solid var(--graphite); color: var(--white); background: transparent;
    cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--white); }
.btn .chev { transition: transform .15s; }
.btn:hover .chev { transform: translateX(3px); }
.link {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 15px; color: var(--bone); transition: color .15s;
}
.link:hover { color: var(--white); }
.link .chev { color: var(--violet); transition: transform .15s; }
.link:hover .chev { transform: translateX(3px); }

/* ---- pill ---- */
.pill {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 6px 12px; border: 1px solid var(--graphite); border-radius: 999px;
    font-size: 13px; color: var(--bone); transition: border-color .15s;
}
.pill:hover { border-color: var(--iron); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px 1px rgba(58,211,137,0.6); }
.pill .chev { color: var(--ash); }

/* ---- hero ---- */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(56px, 9vw, 104px); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 56px; } }
.hero h1 {
    font-family: var(--serif); font-weight: 400;
    font-size: clamp(48px, 8.5vw, 104px); line-height: 0.98; letter-spacing: -0.01em;
    color: var(--white); margin: 26px 0 0; max-width: 15ch;
}
.hero h1 .it { font-style: italic; color: var(--violet-glow); }
.hero-sub { margin-top: 28px; max-width: 52ch; font-size: 18px; line-height: 1.55; color: var(--ash); }
.hero-sub b { color: var(--bone); font-weight: 500; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---- 3D cube (hero anchor) ---- */
.stage { display: flex; justify-content: center; align-items: center; perspective: 900px; }
.cube { position: relative; width: 190px; height: 190px; transform-style: preserve-3d; animation: spin 22s linear infinite; }
.cube .face {
    position: absolute; inset: 0;
    background: linear-gradient(160deg, #0b0e14, #000);
    border: 1px solid var(--graphite);
    box-shadow: inset 0 0 60px rgba(146,129,247,0.06);
}
.cube .f  { transform: translateZ(95px); }
.cube .b  { transform: rotateY(180deg) translateZ(95px); }
.cube .r  { transform: rotateY(90deg) translateZ(95px); }
.cube .l  { transform: rotateY(-90deg) translateZ(95px); }
.cube .t  { transform: rotateX(90deg) translateZ(95px); }
.cube .d  { transform: rotateX(-90deg) translateZ(95px); }
.cube::after { /* violet core glow */
    content: ""; position: absolute; inset: 40px; border-radius: 50%;
    background: radial-gradient(circle, rgba(146,129,247,0.5), transparent 70%);
    filter: blur(14px); transform: translateZ(0);
}
@keyframes spin { from { transform: rotateX(-24deg) rotateY(0); } to { transform: rotateX(-24deg) rotateY(360deg); } }

/* ---- metrics strip ---- */
.strip { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 22px 0; border-top: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); }
.strip span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ash); display: inline-flex; align-items: center; gap: 10px; }
.strip .b { color: var(--iron); }

/* ---- sections ---- */
.sec { padding: clamp(72px, 11vw, 128px) 0; }
.sec + .sec { border-top: 1px solid var(--graphite); }
.sec-head { margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head .eyebrow { display: block; margin-bottom: 18px; }
.sec-head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.04em; color: var(--white); max-width: 20ch; }
.sec-head .note { margin-top: 16px; font-size: 17px; color: var(--ash); max-width: 54ch; }

/* prose */
.prose { max-width: 60ch; }
.prose p { font-size: 18px; line-height: 1.6; color: var(--bone); }
.prose p + p { margin-top: 1.1em; }
.prose .muted { color: var(--ash); }
.split { display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 64px); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 20px; } }

/* ---- cards (work) ---- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }
.card {
    display: flex; flex-direction: column; gap: 14px;
    padding: 28px; background: var(--void); border: 1px solid var(--graphite); border-radius: var(--r-16);
    transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--iron); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-idx { font-family: var(--mono); font-size: 12px; color: var(--charcoal); }
.badge { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ash); border: 1px solid var(--graphite); border-radius: var(--r-6); padding: 3px 9px; display: inline-flex; align-items: center; gap: 7px; }
.badge .lock { color: var(--violet); }
.card h3 { font-family: var(--display); font-weight: 500; font-size: 24px; letter-spacing: -0.02em; color: var(--white); }
.card p { font-size: 15px; color: var(--ash); line-height: 1.55; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--smoke); border: 1px solid var(--graphite); border-radius: var(--r-6); padding: 3px 8px; }
.card-foot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ash); }
.card:hover .card-foot { color: var(--violet-glow); }

/* ---- list rows (writing) ---- */
.rows { border-top: 1px solid var(--graphite); }
.row { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 20px; padding: 24px 8px; border-bottom: 1px solid var(--graphite); transition: background .18s, padding .18s; }
.row:hover { background: var(--lift); padding-left: 16px; padding-right: 16px; }
.row-idx { font-family: var(--mono); font-size: 12px; color: var(--charcoal); }
.row h3 { font-family: var(--display); font-weight: 500; font-size: clamp(18px, 2.4vw, 24px); letter-spacing: -0.02em; color: var(--white); }
.row p { margin-top: 5px; font-size: 14px; color: var(--ash); max-width: 60ch; }
.row-meta { font-family: var(--mono); font-size: 12px; color: var(--ash); white-space: nowrap; }
@media (max-width: 620px) { .row { grid-template-columns: 34px 1fr; } .row-meta { grid-column: 2; margin-top: 8px; } }

/* ---- terminal / code window ---- */
.term { border: 1px solid var(--graphite); border-radius: var(--r-16); background: linear-gradient(180deg, #060708, #000); overflow: hidden; max-width: 640px; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--graphite); }
.term-bar .tl { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--graphite); }
.term-bar .name { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--ash); }
.term-body { padding: 22px 24px; font-family: var(--mono); font-size: 14px; line-height: 1.75; overflow-x: auto; }
.term-body .ln { white-space: pre; }
.c-key { color: var(--sky); }         /* const, keys */
.c-str { color: var(--violet-glow); } /* strings */
.c-bool{ color: var(--amber); }        /* booleans / numbers */
.c-com { color: var(--iron); font-style: italic; }
.c-punc{ color: var(--charcoal); }
.c-fn  { color: var(--blue); }
.email { font-family: var(--mono); color: var(--violet); }

/* ---- statement ---- */
.statement { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.04em; color: var(--white); max-width: 24ch; }
.statement .dim { color: var(--ash); }

/* ---- contact / footer ---- */
.contact { text-align: left; }
.contact .statement { margin-bottom: 26px; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.footer { border-top: 1px solid var(--graphite); padding: 40px 0; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.footer .cols { display: flex; gap: 22px; }
.footer a, .footer span { font-size: 13px; color: var(--ash); }
.footer a:hover { color: var(--white); }
.footer .mono { font-family: var(--mono); }

/* ---- gate (work access) ---- */
.gate { min-height: calc(100vh - 130px); display: flex; flex-direction: column; justify-content: center; padding: 80px 0; }
.gate .code { font-family: var(--mono); font-size: 13px; color: var(--violet); letter-spacing: 0.06em; margin-bottom: 22px; }
.gate h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 12vw, 128px); line-height: 0.94; letter-spacing: -0.01em; color: var(--white); }
.gate p { margin-top: 24px; max-width: 50ch; font-size: 18px; line-height: 1.6; color: var(--ash); }
.gate p b { color: var(--bone); font-weight: 500; }
.gate .hero-actions { margin-top: 36px; }

/* ---- article / posts ---- */
.article { padding: clamp(48px, 8vw, 96px) 0; }
.article-wrap { max-width: 680px; margin: 0 auto; }
.back { font-family: var(--mono); font-size: 12px; color: var(--ash); display: inline-flex; gap: 8px; margin-bottom: clamp(32px, 5vw, 52px); }
.back:hover { color: var(--violet); }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; font-family: var(--mono); font-size: 12px; color: var(--charcoal); }
.article h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.01em; color: var(--white); max-width: 20ch; }
.article-standfirst { margin-top: 20px; font-size: 20px; line-height: 1.5; color: var(--ash); max-width: 54ch; }
.article-body { margin-top: clamp(36px, 6vw, 56px); font-size: 18px; line-height: 1.7; color: var(--bone); }
.article-body > * { max-width: 66ch; }
.article-body p { margin-bottom: 22px; color: #cfd0ce; }
.article-body h2 { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.03em; color: var(--white); margin: 44px 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 22px 1.1em; }
.article-body li { margin-bottom: 10px; color: #cfd0ce; }
.article-body li::marker { color: var(--violet); }
.article-body strong { color: var(--white); font-weight: 600; }
.article-body a { color: var(--violet-glow); box-shadow: inset 0 -1px 0 var(--graphite); }
.article-body a:hover { box-shadow: inset 0 -1px 0 var(--violet); }
.article-body blockquote { border-left: 1px solid var(--violet); padding-left: 22px; margin: 30px 0; color: var(--white); font-size: 22px; line-height: 1.4; }
.article-body code { font-family: var(--mono); font-size: .86em; color: var(--violet); background: var(--lift); border: 1px solid var(--graphite); border-radius: var(--r-6); padding: 1px 6px; }

/* ---- scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---- a11y / motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    .cube { transform: rotateX(-24deg) rotateY(-32deg); }
}
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 3px; }
