/* Codex Foundry: the type, grid, nav and footer every page shares.
   Page-specific sections stay inline in each page. */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }

/* Black ground, one family, one weight. Hierarchy comes from size and
   gray, never from bold, rules or boxes. There are no dividers here.

   The grid: 12 columns. Columns 1-3 are a rail that holds the wordmark
   and each section's label; content starts on column 4. The only other
   start points are 7 and 10, so every edge on the page is 1, 4, 7 or 10. */
:root {
    --bg:   #000000;
    --fg:   #ffffff;
    --dim:  #8c8c8c;   /* 6.9:1 on black */

    --f-caption: 0.75rem;                        /* 12 */
    --f-body:    clamp(0.875rem, 0.6rem + 0.3vw, 1rem); /* 14-16 */
    --f-h3:      clamp(1.25rem, 1.8vw, 2.25rem); /* 20-36 */
    --f-h2:      clamp(1.75rem, 3.2vw, 3rem);    /* 28-48 */

    --outer: 24px;
    --inner: 16px;
    --sec:   120px;
    --font: "Geist", "Helvetica Neue", Arial, sans-serif;
}
@media (max-width: 799px) { :root { --outer: 16px; --inner: 12px; --sec: 80px; } }
@media (min-width: 1800px) { :root { --outer: 32px; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); color-scheme: dark; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-weight: 300;
       font-size: var(--f-body); line-height: 1.3;
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--inner); padding: 0 var(--outer);
        container-type: inline-size; }
/* one column's width, measured against the grid it sits in (cqw is
   its content box), so a span can be sized outside the grid itself:
   span n = n * var(--col) + (n - 1) * var(--inner) */
.grid > * { --col: calc((100cqw - 11 * var(--inner)) / 12); }
.rail { grid-column: 1 / span 3; }
.body { grid-column: 4 / -1; }
@media (max-width: 799px) { .rail, .body { grid-column: 1 / -1; } }

.dim { color: var(--dim); }
.h2 { font-size: var(--f-h2); line-height: 1.08; letter-spacing: -0.02em; font-weight: 300; }
.h3 { font-size: var(--f-h3); line-height: 1.2;  letter-spacing: -0.02em; font-weight: 300; }
.caption { font-size: var(--f-caption); line-height: 1.3; }
.measure { max-width: 52ch; }

/* section label: sits in the rail, level with the section's first line */
.label { color: var(--dim); font-size: var(--f-body); font-weight: 300; line-height: 1.3; }
@media (max-width: 799px) { .label { margin-bottom: 24px; } }
/* where the first line is text, sit the label on its baseline; the
   larger type beside it would otherwise drop below the label */
#about, #contact > .grid:first-child { align-items: baseline; }

/* ── nav: pinned to the top of the screen. Wordmark left, the
   sections in a pill at the center with the current one in white.
   A black fade under it lets content dissolve
   as it scrolls past rather than collide with the controls. Its
   wordmark waits until the hero's wordmark has scrolled away, so the
   logo is never on screen twice. */
:root { --nav-h: 34px; --nav-gap: 16px; }
.nav { position: fixed; left: 0; right: 0; top: var(--nav-gap); z-index: 10; height: var(--nav-h);
       display: flex; align-items: center; justify-content: space-between; padding: 0 var(--outer);
       font-size: 13px; line-height: 1; }
.nav::before { content: ""; position: absolute; inset: calc(var(--nav-gap) * -1) 0 -96px 0; z-index: -1; pointer-events: none;
               background: linear-gradient(180deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.25) 75%, rgba(0,0,0,0) 100%); }
/* once the nav carries the wordmark, the band behind it goes solid so
   nothing reads through the logo; the fade still runs below the box */
.nav::after { content: ""; position: absolute; inset: calc(var(--nav-gap) * -1) 0 -72px 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s ease;
              background: linear-gradient(180deg, #000 0, #000 calc(var(--nav-h) + var(--nav-gap) + 8px), rgba(0,0,0,.6) calc(var(--nav-h) + var(--nav-gap) + 32px), rgba(0,0,0,0) 100%); }
.past-hero .nav::after { opacity: 1; }
/* hidden, not just transparent, so Tab skips it while it is invisible;
   visibility flips after the fade out and at once on the way in */
.nav .home { transition: opacity .3s ease, visibility 0s linear .3s; }
.js .nav .home { opacity: 0; visibility: hidden; }
.js.past-hero .nav .home { opacity: 1; visibility: visible; transition-delay: 0s; }
.nav .home img { height: 18px; width: auto; }
.nav .home .star { display: none; }
/* the pill sits on the page's center line whatever the sides measure.
   No overflow clip on it, which would cut the focus ring and hit areas */
.nav .links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; height: 100%;
              background: rgba(255,255,255,.08); border-radius: 8px;
              -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.nav .links a { display: flex; align-items: center; padding: 0 12px; color: var(--dim); transition: color .18s ease; }
.nav .links a:hover, .nav .links a[aria-current] { color: var(--fg); }
/* 44px hit areas without changing what is drawn */
.nav a, .f-links a { position: relative; }
.f-links a::after { content: ""; position: absolute; inset: -2px -8px; }
.nav a::after { content: ""; position: absolute; inset: -5px 0; }
/* phone: the star from the wordmark stands in for it, and the pill
   stays on the center line between them */
@media (max-width: 799px) {
    .nav { gap: 8px; }
    .nav .home { margin-right: auto; }
    .nav .home .row { display: none; }
    .nav .home .star { display: block; height: 28px; }
    .nav .links a { padding: 0 10px; }
}

/* ── footer ──────────────────────────────────────────────────── */
footer { padding: var(--sec) 0 var(--outer); }
.mail { display: inline-block; transition: opacity .15s ease; }
.mail:hover { opacity: .6; }
/* three short columns on the body's nine: where + year, the page's
   sections, then the apps on column 10, the line CineBox and Moshpit
   start on. Stacked lists, so nothing wraps mid-row */
.f-detail { margin-top: 32px; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); column-gap: var(--inner); row-gap: 24px; }
.f-where { grid-column: 1 / span 3; display: grid; row-gap: 4px; align-content: start; }
.f-detail .f-links { grid-column: 4 / span 3; }
.f-detail .f-apps { grid-column: 7 / span 3; }
.f-detail a { transition: color .15s ease; }
.f-detail a:hover { color: var(--fg); }
.f-links { display: grid; row-gap: 4px; align-content: start; justify-items: start; }
/* the row wordmark runs the full measure as the sign-off */
.f-mark { margin-top: var(--sec); }
.f-mark img { grid-column: 1 / -1; width: 100%; height: auto; }
.f-meta { margin-top: var(--inner); }
@media (max-width: 799px) {
    /* the address is one unbreakable word; scale it down so it fits a 320px screen */
    .mail { font-size: clamp(1.125rem, 6.6vw, var(--f-h3)); }
    .f-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .f-detail .f-links { grid-column: 1; grid-row: 1; } .f-detail .f-apps { grid-column: 2; grid-row: 1; }
    .f-where { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
