@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500&display=swap');

:root {
    --bg-color: hsl(50, 8%, 85%);
    --ink: hsl(50, 10%, 14%);
    --ink-soft: hsl(50, 6%, 40%);
    --line: hsl(50, 8%, 66%);
    --pad: clamp(1.5rem, 6vw, 6rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--ink);
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    line-height: 1.7;
    position: relative;
}

/* the noise — unchanged */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
}

/* ---------- hero ---------- */

.hero {
    min-height: 78svh;
    padding: 5rem var(--pad) 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.name {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

h1 {
    margin: 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.75rem, 7vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.sub {
    margin: 0;
    max-width: 38ch;
    font-size: 1.15rem;
    text-wrap: balance;
    color: var(--ink-soft);
}

/* shadcn-style button */
.button {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    height: 2.75rem;
    padding: 0 1.4rem;
    border: 1px solid var(--ink);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.button:hover {
    background: var(--ink);
    color: var(--bg-color);
}

/* ---------- alternating rows ---------- */

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    padding: clamp(4rem, 12vh, 8rem) var(--pad);
}

.row.flip .art { order: -1; }

.text { max-width: 46ch; }

h2 {
    margin: 0 0 1rem;
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.9rem, 3vw, 2.75rem);
    line-height: 1.1;
}

.text p { margin: 0 0 1rem; }

.text b { font-weight: 500; }

.link {
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: border-color 0.2s;
}

.link:hover { border-bottom-color: var(--ink); }

/* ---------- sketches ---------- */

.art {
    margin: 0;
    color: var(--ink);
}

.art svg {
    width: 100%;
    max-width: 26rem;
    height: auto;
}

footer {
    padding: 3rem var(--pad);
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

footer p { margin: 0; }

/* ---------- animation ---------- */

@media (prefers-reduced-motion: no-preference) {

    /* draw the sketch as it scrolls into view */
    @supports (animation-timeline: view()) {
        .art [pathLength] {
            stroke-dasharray: 1;
            stroke-dashoffset: 1;
            animation: draw linear both;
            animation-timeline: view();
            animation-range: entry 15% cover 40%;
        }
    }

    @keyframes draw {
        to { stroke-dashoffset: 0; }
    }

    .blink { animation: blink 1.2s steps(1) infinite; }
    .note  { animation: float 4s ease-in-out infinite; }
    .note:nth-of-type(2) { animation-delay: 0.9s; }
    .eye   { animation: wink 5s ease-in-out infinite; }
    .dot   { animation: typing 1.4s ease-in-out infinite; }
    .dot:nth-of-type(2) { animation-delay: 0.2s; }
    .dot:nth-of-type(3) { animation-delay: 0.4s; }

    @keyframes blink  { 50% { opacity: 0; } }
    @keyframes float  { 50% { transform: translateY(-6px); } }
    @keyframes wink   { 48%, 52% { transform: scaleY(0.15); } }
    @keyframes typing { 40% { transform: translateY(-5px); } }
}

.eye, .dot { transform-box: fill-box; transform-origin: center; }

/* ---------- narrow screens ---------- */

@media (max-width: 760px) {
    .row {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .row.flip .art { order: 0; }

    .art svg { max-width: 18rem; }
}
