/* ==========================================================================
   BASE — shared by every layout.
   Look: cream ink on black, BARNEGAT display, Silka Mono text,
   grainy aurora glow, isometric Lottie objects, hairline rules.
   ========================================================================== */

/* ---------- Fonts ---------- */

@font-face {
    font-family: "Barnegat";
    src: url("../Assets/Fonts/BARNEGAT-Regular.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Silka Mono";
    src: url("../Assets/Fonts/SilkaMono-ExtraLight.otf") format("opentype");
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: "Silka Mono";
    src: url("../Assets/Fonts/SilkaMono-Light.otf") format("opentype");
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: "Silka Mono";
    src: url("../Assets/Fonts/SilkaMono-Regular.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Silka Mono";
    src: url("../Assets/Fonts/SilkaMono-Black.otf") format("opentype");
    font-weight: 900;
    font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
    --ground: #000000;
    --ink: #fffee9;
    --ink-2: rgba(255, 254, 233, 0.72);
    --ink-3: rgba(255, 254, 233, 0.5);
    --rule: rgba(255, 254, 233, 0.22);
    --rule-strong: rgba(255, 254, 233, 0.55);
    --signal: #d9a6f2;          /* lilac from the aurora / CV labels */
    --indigo: #1d2a72;
    --magenta: #b8578f;

    --font-display: "Barnegat", "Arial Narrow", sans-serif;
    --font-mono: "Silka Mono", ui-monospace, "Cascadia Mono", monospace;

    /* type scale */
    --t-xs: 0.75rem;
    --t-sm: 0.875rem;
    --t-md: 1rem;
    --t-lg: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
    --t-xl: clamp(2.25rem, 1.4rem + 3.2vw, 4rem);
    --t-giant: clamp(5.5rem, 1rem + 17vw, 23rem);

    /* spacing */
    --gutter: clamp(1rem, 0.4rem + 3.2vw, 8rem);
    /* side padding that also clears a phone notch in landscape */
    --pad-l: max(var(--gutter), env(safe-area-inset-left, 0px));
    --pad-r: max(var(--gutter), env(safe-area-inset-right, 0px));
    --s-1: 0.5rem;
    --s-2: 1rem;
    --s-3: 1.5rem;
    --s-4: 2.5rem;
    --s-5: 4rem;
    --s-6: clamp(5rem, 3rem + 7vw, 10rem);

    --nav-h: 88px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: dark;
}

/* ---------- Reset ---------- */

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

html {
    scroll-behavior: smooth;
    overflow-x: clip; /* no sideways wiggle on phones; clip keeps sticky working */
    scroll-padding-top: 1.5rem;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--rule-strong) var(--ground);
    scrollbar-width: thin;
}

body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: var(--t-md);
    line-height: 1.55;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
}

ul,
ol {
    list-style: none;
}

a {
    color: inherit;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 0.3em;
    text-decoration-thickness: 1px;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

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

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

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ground);
}

::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--ink);
    color: var(--ground);
    font-size: var(--t-sm);
    text-transform: uppercase;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* ---------- Type ---------- */

.display {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 0.8;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.giant {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--t-giant);
    line-height: 0.8;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.h-xl {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--t-xl);
    line-height: 0.92;
    text-transform: uppercase;
}

.h-lg {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--t-lg);
    line-height: 0.95;
    text-transform: uppercase;
}

/* small mono caps, the "ARGENTINA" voice */
.label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: var(--t-xs);
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.label--signal {
    color: var(--signal);
}

.prose {
    font-size: var(--t-md);
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 62ch;
    text-wrap: pretty;
}

.prose strong {
    color: var(--ink);
    font-weight: 400;
}

.prose + .prose {
    margin-top: 1em;
}

.tabular {
    font-variant-numeric: tabular-nums;
}

/* ---------- Layout helpers ---------- */

.wrap {
    padding-inline: var(--pad-l) var(--pad-r);
}

.section {
    position: relative;
    padding-block: var(--s-6);
}

.rule {
    border: 0;
    border-top: 1px solid var(--rule);
}

/* ---------- Aurora glow behind the whole page ---------- */
/* js/base.js stacks the aurora tiles (Assets/Backgrounds/web) down the full page,
   overlapping them so a glow is always in view. Without JS one tile stays fixed. */

body {
    position: relative;
}

.page-glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.page-glow:empty {
    position: fixed;
    background: url("../Assets/Backgrounds/web/aurora-2.webp") center / cover no-repeat;
    opacity: 0.6;
}

.page-glow__tile {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--tile-h);
    object-fit: cover;
    opacity: 0.85;
    user-select: none;
}

.page-glow__tile--flip {
    transform: scaleX(-1);
}

/* ---------- Lottie ---------- */

.lottie {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    pointer-events: none;
}

.lottie lottie-player {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------- Bottom nav (kept from the original site) ---------- */

.site-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    background: var(--ground);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-inline: var(--pad-l) var(--pad-r);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.site-nav__list {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
    overflow-x: auto;
    scrollbar-width: none;
}

.site-nav__list::-webkit-scrollbar {
    display: none;
}

.site-nav__link {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--ink-2);
    padding: 0.25rem 0;
    transition: color 200ms var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link[aria-current="true"] {
    color: var(--ink);
}

.site-nav__link[aria-current="true"] {
    text-decoration: underline;
    text-decoration-color: var(--signal);
}

.site-nav__bar {
    height: 44px;
    width: 100%;
}

.site-nav__bar lottie-player {
    width: 100%;
    height: 100%;
}

/* ---------- Buttons & links ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    min-height: 44px;
    padding: 0.65rem 1.1rem;
    border: 1px solid var(--rule-strong);
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: var(--t-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out), border-color 220ms var(--ease-out);
}

.btn--solid {
    background: var(--ink);
    color: var(--ground);
    border-color: var(--ink);
}

/* hover effects only where there is a mouse; on touch they would stick after a tap */
@media (hover: hover) {
    .btn:hover {
        background: var(--ink);
        color: var(--ground);
        border-color: var(--ink);
    }

    .btn--solid:hover {
        background: transparent;
        color: var(--ink);
    }
}

.btn:active {
    opacity: 0.75;
}

.btn svg {
    width: 1em;
    height: 1em;
    flex: none;
}

/* "VISIT ↗" style text link with a drawn arrow */
.link-out {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    white-space: nowrap;
}

.link-out svg {
    width: 0.9em;
    height: 0.9em;
    transition: transform 220ms var(--ease-out);
}

.link-out:hover {
    color: var(--signal);
}

.link-out:hover svg {
    transform: translate(2px, -2px);
}

/* Social icon row (the circled icons from the original) */
.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.socials a {
    display: block;
    border-radius: 50%;
    transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}

@media (hover: hover) {
    .socials a:hover {
        transform: translateY(-3px);
    }
}

.socials img {
    width: 44px;
    height: 44px;
}

/* ---------- Expandable entry (jobs, projects) ---------- */
/* <details class="entry"> <summary class="entry__summary">…</summary> <div class="entry__body">…</div> </details>
   Entries with no extra detail yet use <div class="entry entry--static"> with the same summary markup. */

.entry {
    border-top: 1px solid var(--rule);
}

.entry:last-child {
    border-bottom: 1px solid var(--rule);
}

.entry__summary {
    list-style: none;
    cursor: pointer;
    position: relative;
}

.entry__summary::-webkit-details-marker {
    display: none;
}

.entry--static .entry__summary {
    cursor: default;
}

/* plus / minus toggle drawn with two lines */
.entry__toggle {
    position: relative;
    width: 18px;
    height: 18px;
    flex: none;
}

.entry__toggle::before,
.entry__toggle::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform 300ms var(--ease-out);
}

.entry__toggle::after {
    transform: rotate(90deg);
}

.entry[open] .entry__toggle::after {
    transform: rotate(0deg);
}

.entry__summary:hover .entry__toggle {
    color: var(--signal);
}

.entry__body {
    overflow: hidden;
}

.entry[open] .entry__body {
    animation: entry-open 420ms var(--ease-out);
}

@keyframes entry-open {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

/* tag list: "UNITY · C# · ZENJECT" */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tags li {
    font-size: var(--t-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--rule);
    color: var(--ink-2);
}

/* ---------- Reveal motion: giant titles rise out of a mask ---------- */
/* Content is visible by default; JS adds .js to <html> to arm the effect. */

.js .reveal {
    clip-path: inset(0 0 100% 0);
    transform: translateY(0.18em);
    transition: clip-path 1100ms var(--ease-out), transform 1100ms var(--ease-out);
}

.js .reveal.is-in {
    clip-path: inset(-0.2em -0.2em -0.2em -0.2em);
    transform: none;
}

/* ---------- Footer ---------- */

.site-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-3);
    padding: var(--s-4) var(--pad-r) var(--s-4) var(--pad-l);
    border-top: 1px solid var(--rule);
    text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    :root {
        --nav-h: 64px;
    }

    .site-nav__bar {
        display: none;
    }

    /* phones: the links become a swipeable strip; js/base.js keeps the current
       section in view and sets data-more so the edges fade where links continue */
    .site-nav__list {
        justify-content: flex-start;
        gap: var(--s-3);
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
    }

    .site-nav__list[data-more="right"] {
        mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
    }

    .site-nav__list[data-more="left"] {
        mask-image: linear-gradient(to left, #000 calc(100% - 3rem), transparent);
    }

    .site-nav__list[data-more="both"] {
        mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
    }

    .site-nav__list li {
        scroll-snap-align: start;
    }

    .site-nav__link {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 1.05rem;
    }

    .site-footer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }

    .js .reveal {
        clip-path: none;
        transform: none;
    }
}
