/* BASE: fonts, colors, sizes, reset, icons, buttons, scroll animations.
   Index: fonts | variables (colors, sizes, timings) | reset | icons | button | motion
   To restyle the site, start with the variables block. */

/* ===== FONTS ===== */
@font-face {
    font-family: "Manrope";
    font-weight: 300;
    font-display: swap;
    src: url("../fonts/manrope-latin-300-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Manrope";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Manrope";
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Manrope";
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Manrope";
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Karla";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/karla-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Karla";
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/karla-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Karla";
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/karla-latin-700-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Pinyon Script";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/pinyon-script-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Caveat";
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/caveat-latin-700-normal.woff2") format("woff2");
}

/* ===== VARIABLES (light theme; dark overrides below) ===== */
:root {
    /* colors */
    --ink: #0e0e10; /* main text */
    --paper: #fff6f9; /* page background */
    --card: #fbe4ec; /* card background */
    --mute: #161616; /* secondary text */
    --rule: rgba(14, 14, 16, 0.14); /* thin divider lines */
    --hl: #f6d0de; /* pink highlight */
    --panel-bg: #a8486f; /* dark buttons / panels */
    --panel-fg: #f4f2ef; /* text on dark panels and buttons */
    --header-bg: rgba(255, 246, 249, 0.85); /* header glass colour */
    --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.4); /* card shadow */
    --icon-filter: brightness(0); /* makes icons black (white in dark mode) */
    --accent: #d9648f; /* theme colour, change this first */
    --accent-soft: #bd4676; /* softer partner of the accent */
    --icon-filter-panel: brightness(0) invert(1); /* icons on dark buttons */
    --divider: rgba(127, 127, 127, 0.25); /* faint line */
    --divider-strong: rgba(127, 127, 127, 0.35); /* stronger line */
    --about-card-bg: var(--card); /* about card background */
    --about-card-fg: var(--ink); /* about card text */

    /* fonts */
    --font-display: "Manrope", "Segoe UI", system-ui, sans-serif; /* headings and labels */
    --font-body: "Karla", "Segoe UI", system-ui, sans-serif; /* paragraph text */
    /* handwriting font */
    --font-script:
        "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
    --font-script-im:
        "Caveat", "Comic Sans MS", cursive; /* only the "i'm" in the greeting */

    /* corner radii */
    --r-lg: 28px; /* big card corners */
    --r-md: 18px; /* medium corners */
    --r-img: 22px; /* image corners */
    --pill: 999px; /* fully round */

    /* spacing */
    --header-h: 72px; /* header height */
    --gutter: clamp(22px, 5.5vw, 44px); /* side padding of the page */
    --pad: max(
        var(--gutter),
        env(safe-area-inset-left, 0px),
        env(safe-area-inset-right, 0px)
    );
    --pad-l: var(--pad);
    --pad-r: var(--pad);
    --inset: clamp(18px, 2.4vw, 24px); /* padding inside big cards */
    --inset-text: clamp(6px, 1.4vw, 14px); /* extra padding around text in cards */
    --glass-bg: var(--header-bg); /* glass colour (header) */
    --glass-blur: 14px; /* how blurry the header glass is */
    --gap: clamp(12px, 1.8vw, 20px); /* space between cards */
    --spacer-h: clamp(24px, 4vw, 52px); /* default height of a .spacer */
    --head-gap: clamp(20px, 3vw, 32px); /* space under section headings */
    --card-pad: clamp(22px, 2.6vw, 28px); /* padding inside cards */
    --wrap-max: 1180px; /* widest the page gets */

    /* animation */
    --ease: cubic-bezier(0.22, 1, 0.36, 1); /* the smooth easing used almost everywhere */
    --t-press: 0.12s; /* press squish */
    --t-short: 0.3s; /* quick fades */
    --t-quick: 0.35s; /* button hover */
    --t-fade: 0.4s; /* medium fades */
    --t-base: 0.45s; /* default transition */
    --t-long: 0.5s; /* header glass fade */
    --t-slow: 0.7s; /* big morphs (games, shows) */
    --hover-lift: -2px; /* how far things rise on hover */
}
@media (prefers-color-scheme: dark) { /* dark mode colours, same names as above */
    :root {
        --ink: #f4f2ef;
        --paper: #1e1519;
        --card: #2b1f25;
        --mute: #f4f2ef;
        --rule: rgba(244, 242, 239, 0.2);
        --hl: #402c36;
        --panel-bg: #f4f2ef;
        --panel-fg: #161616;
        --header-bg: rgba(30, 21, 25, 0.85);
        --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.7);
        --icon-filter: brightness(0) invert(1);
        --icon-filter-panel: brightness(0);
        --accent: #f3b3cb;
        --accent-soft: #f8cddd;
    }
}

/* ===== RESET & TEXT ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
html {
    -webkit-text-size-adjust: 100%;
    scrollbar-width: none;
    scroll-padding-top: calc(
        var(--header-h) + env(safe-area-inset-top, 0px) + 8px
    );
}
html:not(.js) {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    min-height: 100dvh;
    background: var(--paper);
    color: var(--ink);
    font: 400 clamp(16px, 0.4vw + 15px, 18px) / 1.65 var(--font-body); /* page text size + line height */
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* text selection: off by default, on when config.js has allowCopy: true */
body {
    -webkit-user-select: none;
    user-select: none;
}
body.can-copy {
    -webkit-user-select: text;
    user-select: text;
}
/* these stay unselectable even when allowCopy is true */
.site-header,
.site-header *,
.tilt-card,
.tilt-card *,
.btn,
.foot-hint {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.035em;
}
h2 {
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
}
h3 {
    font-size: clamp(1.35rem, 2.1vw, 1.7rem);
    font-weight: 500;
    letter-spacing: -0.02em;
}
p {
    margin: 0;
}
ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}
a {
    color: inherit;
}
button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
img {
    display: block;
    max-width: 100%;
    -webkit-user-drag: none;
}
/* image missing or not added: shows icons/image-missing.svg (see core.js markMissing) */
body img.is-missing {
    /* icon is drawn as a background so it scales with the box: 30% wide, between 72px and 150px */
    background: var(--hl) url("../icons/image-missing.svg") center /
        clamp(72px, 30%, 150px) no-repeat !important;
}
@media (prefers-color-scheme: dark) {
    body img.is-missing {
        filter: invert(1);
        background-color: #bfd3c9 !important; /* inverted --hl, so the filter turns it back */
    }
}
:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

/* ===== SMALL PIECES ===== */
/* "Skip to content" link: only visible when focused with the keyboard */
.skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 12px;
    border-radius: var(--pill);
    background: var(--panel-bg);
    color: var(--panel-fg);
    transition: top var(--t-short) var(--ease);
}
.skip:focus {
    top: 12px;
}
/* centered content column */
.wrap {
    width: 100%;
    max-width: var(--wrap-max);
    margin-inline: auto;
    padding-inline: var(--pad-l) var(--pad-r);
}
/* small uppercase label above headings */
.eyebrow {
    margin-bottom: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.6;
}
/* grey text under headings */
.sub {
    margin-top: 12px;
    color: var(--mute);
    opacity: 0.75;
}
/* handwritten font */
.script {
    font-family: var(--font-script);
    font-weight: 400;
    letter-spacing: 0;
}

/* ===== ICONS (svg files in /icons, colored by filter) ===== */
.icon-svg {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    flex: none;
    vertical-align: middle;
    background: center / contain no-repeat;
    filter: var(--icon-filter);
}
.btn .icon-svg,
.to-top .icon-svg {
    filter: var(--icon-filter-panel);
}
.icon-clock {
    background-image: url("../icons/clock.svg");
    width: 18px;
    height: 18px;
}
.icon-link {
    background-image: url("../icons/link.svg");
}
.icon-backtop {
    background-image: url("../icons/backTop.svg");
    width: 24px;
    height: 24px;
}

/* ===== BUTTON ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1.5px solid var(--panel-bg);
    border-radius: var(--pill);
    background: var(--panel-bg);
    color: var(--panel-fg);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: transform var(--t-quick) var(--ease);
}
.btn:hover {
    transform: translateY(var(--hover-lift));
}
.btn:active {
    transform: scale(0.96);
    transition-duration: var(--t-press);
}

/* ===== MOTION (classes added by effects.js) ===== */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(28px); /* how far things rise in */
    }
}
@keyframes zoom {
    from {
        transform: scale(1.18); /* photos start this zoomed and settle */
    }
}
/* .reveal: hidden until scrolled into view (.in), then rises */
.js .reveal {
    opacity: 0;
}
.js .reveal.in {
    opacity: 1;
    animation: rise 900ms var(--ease) backwards; /* rise time */
    animation-delay: var(--d, 300ms);
}
.js .reveal.in img[data-parallax] {
    animation: zoom 1600ms var(--ease) backwards; /* photo settle time */
    animation-delay: var(--d, 300ms);
}
/* .words: headings whose words slide up out of a mask */
.words .w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0.1em 0.06em 0.18em;
    margin: -0.1em -0.06em -0.18em;
}
.words .wi {
    display: inline-block;
}
.js .words:not(.in) .wi {
    transform: translateY(115%);
}
.js .words.in .wi {
    transition: transform 1100ms var(--ease); /* heading word slide time */
    transition-delay: calc(var(--i, 0) * 70ms); /* gap between heading words */
}

.id-info h1 {
    font-weight: 600;
    letter-spacing: -0.04em;
}
.brand {
    font-weight: 700;
}
