/* ==========================================================================
   Gentium Labs — "precision atelier"
   A dark, warm, editorial identity: near-black canvas with fine grain and a
   slow warm glow, a high-contrast serif (Fraunces) against a clean grotesque
   (Hanken Grotesk), technical mono labels (JetBrains Mono), and a single
   restrained brass accent. Motion is deliberate and disabled under
   prefers-reduced-motion.
   ========================================================================== */

:root {
    /* surfaces */
    --ink:        #0b0c0f;   /* canvas */
    --ink-2:      #101216;   /* raised */
    --ink-3:      #14161c;   /* cards */
    --hair:       rgba(240, 236, 226, .10);
    --hair-2:     rgba(240, 236, 226, .18);

    /* type */
    --ivory:      #f2efe8;
    --muted:      #9c988c;
    --muted-2:    #6a675e;

    /* accent — brass */
    --brass:      #d7a54e;
    --brass-hi:   #f0cf92;
    --brass-deep: #a97c34;
    --brass-glow: rgba(215, 165, 78, .22);

    --serif: "Fraunces", Georgia, "Times New Roman", serif;
    --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --maxw: 1180px;
    --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--ivory);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: .002em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

::selection { background: var(--brass); color: var(--ink); }

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

/* ---------- boot / noscript ---------- */
.boot-screen {
    position: fixed; inset: 0; display: grid; place-items: center;
    background: var(--ink); z-index: 60;
}
.boot-mark {
    width: 26px; height: 26px; border: 1.5px solid var(--brass);
    transform: rotate(45deg); animation: boot 1.3s ease-in-out infinite;
}
.noscript-note {
    max-width: 620px; margin: 80px auto; padding: 26px 28px;
    border: 1px solid var(--hair); border-radius: 4px; text-align: center;
    color: var(--muted); font-size: 15px;
}

/* ==========================================================================
   Atmosphere — warm glow + drifting aurora + film grain
   ========================================================================== */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.bg::before {
    /* warm top glow anchored off the upper-left */
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(80vw 60vh at 18% -10%, rgba(215,165,78,.14), transparent 60%),
        radial-gradient(70vw 55vh at 100% 8%, rgba(120,110,90,.10), transparent 55%),
        radial-gradient(90vw 70vh at 50% 120%, rgba(30,32,40,.9), transparent 60%);
}
.aurora {
    position: absolute; width: 60vw; height: 60vw; border-radius: 50%;
    top: -20vw; left: -10vw; filter: blur(90px); opacity: .10;
    background: conic-gradient(from 90deg, var(--brass), transparent 45%, var(--brass-deep), transparent 80%, var(--brass));
    animation: drift 40s linear infinite;
}
/* film grain via inline SVG turbulence — adds analog depth to flat black */
.grain {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
    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.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Layout
   ========================================================================== */
.wrap { width: min(100% - calc(var(--gutter) * 2), var(--maxw)); margin-inline: auto; }
section { position: relative; }

.kicker {
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    letter-spacing: .28em; text-transform: uppercase; color: var(--brass);
    display: inline-flex; align-items: center; gap: 12px;
}
.kicker::before {
    content: ""; width: 26px; height: 1px; background: var(--brass); opacity: .7;
}

/* scroll-reveal */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.in {
    opacity: 1; transform: none;
    transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1);
    transition-delay: var(--d, 0ms);
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    transition: background .4s ease, border-color .4s ease, backdrop-filter .4s ease;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: rgba(11, 12, 15, .72);
    backdrop-filter: saturate(1.2) blur(14px);
    border-bottom-color: var(--hair);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand .mark {
    width: 16px; height: 16px; border: 1.5px solid var(--brass);
    transform: rotate(45deg); flex: none;
    transition: transform .5s cubic-bezier(.22,.61,.36,1);
}
.brand:hover .mark { transform: rotate(135deg); }
.brand .name {
    font-family: var(--sans); font-weight: 600; font-size: 16px;
    letter-spacing: .14em; text-transform: uppercase;
}
.brand .name b { font-weight: 600; color: var(--ivory); }
.brand .name span { color: var(--muted); }

.nav-link {
    font-family: var(--mono); font-size: 12.5px; letter-spacing: .18em;
    text-transform: uppercase; color: var(--muted);
    display: inline-flex; align-items: center; gap: 9px; padding: 6px 0;
    position: relative; transition: color .3s;
}
.nav-link::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: var(--brass); transition: width .35s cubic-bezier(.22,.61,.36,1);
}
.nav-link:hover { color: var(--ivory); }
.nav-link:hover::after { width: 100%; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(150px, 22vh, 260px); padding-bottom: clamp(80px, 12vh, 150px); }
.hero .wrap { max-width: 1000px; }

.hero .kicker { opacity: 0; animation: rise .9s cubic-bezier(.22,.61,.36,1) .1s forwards; }

.hero h1 {
    font-family: var(--serif); font-weight: 300;
    font-size: clamp(44px, 8.2vw, 104px); line-height: .98;
    letter-spacing: -.02em; margin: 30px 0 0; max-width: 15ch;
    font-optical-sizing: auto;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span {
    display: block; transform: translateY(105%);
    animation: unveil 1s cubic-bezier(.22,.61,.36,1) forwards;
}
.hero h1 .line:nth-child(1) > span { animation-delay: .18s; }
.hero h1 .line:nth-child(2) > span { animation-delay: .30s; }
.hero h1 em {
    font-style: italic; font-weight: 400;
    color: transparent; background: linear-gradient(100deg, var(--brass-hi), var(--brass) 60%, var(--brass-deep));
    -webkit-background-clip: text; background-clip: text;
}

.hero .lede {
    margin: 34px 0 0; max-width: 52ch; font-size: clamp(17px, 2vw, 21px);
    color: var(--muted); line-height: 1.6;
    opacity: 0; animation: rise .9s cubic-bezier(.22,.61,.36,1) .55s forwards;
}

.hero-actions {
    margin-top: 44px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
    opacity: 0; animation: rise .9s cubic-bezier(.22,.61,.36,1) .7s forwards;
}

.btn {
    font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: .01em;
    cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 10px;
    padding: 15px 26px; border-radius: 2px; transition: transform .25s, box-shadow .25s, background .25s, color .25s;
}
.btn-primary {
    background: var(--brass); color: #16130c;
    box-shadow: 0 0 0 1px var(--brass), 0 14px 40px -14px var(--brass-glow);
}
.btn-primary:hover {
    background: var(--brass-hi); transform: translateY(-2px);
    box-shadow: 0 0 0 1px var(--brass-hi), 0 22px 50px -16px var(--brass-glow);
}
.btn .arrow { transition: transform .3s; }
.btn:hover .arrow { transform: translateX(4px); }

.text-link {
    font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--ivory); display: inline-flex; align-items: center; gap: 10px;
    position: relative; padding-bottom: 3px;
}
.text-link::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
    background: var(--hair-2); transition: background .3s;
}
.text-link:hover::after { background: var(--brass); }

/* corner meta — the small "lab notation" flourish */
.hero-meta {
    margin-top: clamp(70px, 12vh, 130px); padding-top: 22px; border-top: 1px solid var(--hair);
    display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--muted-2);
    opacity: 0; animation: rise .9s cubic-bezier(.22,.61,.36,1) .85s forwards;
}
.hero-meta span { color: var(--muted); }

/* ==========================================================================
   Approach — principles, not portfolio
   ========================================================================== */
.approach { padding: clamp(70px, 12vh, 150px) 0; }
.approach-head { max-width: 640px; }
.approach h2 {
    font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 4.4vw, 48px);
    line-height: 1.08; letter-spacing: -.015em; margin: 22px 0 0;
}
.approach h2 em { font-style: italic; color: var(--brass); }

.principles {
    margin-top: clamp(48px, 7vw, 80px);
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    border-top: 1px solid var(--hair);
}
.principle {
    padding: 38px 34px 44px; border-bottom: 1px solid var(--hair);
    border-right: 1px solid var(--hair); position: relative;
}
.principle:nth-child(3n) { border-right: none; }
.principle .idx {
    font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--brass);
}
.principle h3 {
    font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2;
    margin: 22px 0 12px; letter-spacing: -.01em;
}
.principle p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.62; }
.principle::after {
    content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
    background: var(--brass); transition: width .5s cubic-bezier(.22,.61,.36,1);
}
.principle:hover::after { width: 100%; }

/* ==========================================================================
   Contact — form logic unchanged, re-skinned
   ========================================================================== */
.contact { padding: clamp(70px, 12vh, 150px) 0 clamp(90px, 14vh, 170px); }
.contact-card {
    display: grid; grid-template-columns: .85fr 1.15fr;
    border: 1px solid var(--hair); border-radius: 4px; overflow: hidden;
    background: linear-gradient(180deg, var(--ink-2), var(--ink));
}
.contact-aside {
    padding: clamp(38px, 4vw, 56px); border-right: 1px solid var(--hair);
    display: flex; flex-direction: column;
}
.contact-aside h2 {
    font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1.05; letter-spacing: -.015em; margin: 20px 0 18px;
}
.contact-aside p { color: var(--muted); font-size: 16px; margin: 0; max-width: 34ch; }
.aside-meta {
    margin-top: auto; padding-top: 34px; display: grid; gap: 14px;
    font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted-2);
}
.aside-meta .row { display: flex; gap: 14px; align-items: baseline; }
.aside-meta .row b { color: var(--muted); font-weight: 500; min-width: 88px; }
.aside-meta .mail { color: var(--ivory); text-transform: none; letter-spacing: .02em; }

.contact-form { padding: clamp(38px, 4vw, 56px); }
.field { margin-bottom: 22px; }
.field label {
    display: flex; justify-content: space-between; align-items: baseline;
    font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 12px;
}
.field .counter { color: var(--muted-2); letter-spacing: .1em; }
.field input, .field textarea {
    width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ivory);
    background: rgba(240, 236, 226, .025); border: 1px solid var(--hair);
    border-radius: 2px; padding: 15px 16px; resize: vertical;
    transition: border-color .25s, box-shadow .25s, background .25s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field textarea { min-height: 150px; line-height: 1.55; }
.field input:focus, .field textarea:focus {
    outline: none; border-color: var(--brass); background: rgba(240, 236, 226, .04);
    box-shadow: 0 0 0 3px var(--brass-glow);
}
.field.err input, .field.err textarea { border-color: #c96f5a; }
.field .hint { font-size: 13px; color: #d98a76; margin-top: 8px; min-height: 1px; font-family: var(--sans); }

/* honeypot */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.submit { width: 100%; justify-content: center; margin-top: 4px; padding: 17px 26px; font-size: 15px; }
.submit[disabled] { opacity: .7; cursor: progress; }
.form-status { margin-top: 16px; font-size: 14px; min-height: 20px; text-align: center; }
.form-status.bad { color: #d98a76; }

.spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(22,19,12,.35); border-top-color: #16130c;
    animation: boot-spin .7s linear infinite;
}

/* success state */
.sent { text-align: center; padding: 34px 8px; animation: rise .6s cubic-bezier(.22,.61,.36,1) both; }
.sent .check {
    width: 66px; height: 66px; margin: 0 auto 22px; border-radius: 50%;
    display: grid; place-items: center; color: #16130c; font-size: 30px;
    background: linear-gradient(135deg, var(--brass-hi), var(--brass));
    box-shadow: 0 0 0 1px var(--brass), 0 18px 44px -16px var(--brass-glow);
    animation: seal .7s cubic-bezier(.2,1.3,.35,1) both;
}
.sent h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0 0 10px; letter-spacing: -.01em; }
.sent p { color: var(--muted); margin: 0 auto; max-width: 36ch; }
.sent button {
    margin-top: 24px; background: none; border: none; cursor: pointer;
    font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--brass); position: relative; padding-bottom: 3px;
}
.sent button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: var(--hair-2); transition: background .3s; }
.sent button:hover::after { background: var(--brass); }

/* confetti (kept from the working form, re-toned to brass/ivory) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 7px; height: 11px; animation: fall linear forwards; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--hair); padding: 46px 0; }
.footer-inner {
    display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
    font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2);
}
.footer .brand .name { font-size: 14px; }

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes boot { 0%,100% { transform: rotate(45deg) scale(1); opacity: 1; } 50% { transform: rotate(45deg) scale(.6); opacity: .4; } }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes unveil { to { transform: translateY(0); } }
@keyframes drift { to { transform: rotate(360deg); } }
@keyframes seal { 0% { transform: scale(0) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes fall { to { transform: translateY(106vh) rotate(680deg); opacity: .85; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .principles { grid-template-columns: 1fr; }
    .principle { border-right: none; }
    .contact-card { grid-template-columns: 1fr; }
    .contact-aside { border-right: none; border-bottom: 1px solid var(--hair); }
}
@media (max-width: 560px) {
    body { font-size: 16px; }
    .brand .name span { display: none; }
    .hero h1 { max-width: 100%; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
    .hero h1 .line > span, .hero .kicker, .hero .lede, .hero-actions, .hero-meta { opacity: 1; transform: none; animation: none; }
    .aurora { animation: none; }
}
