@font-face { font-family: "Sailec"; src: url("../fonts/sailec/SailecRegular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sailec"; src: url("../fonts/sailec/SailecBold.woff") format("woff"); font-weight: 700; font-display: swap; }
/* Syne (OFL), served from the site rather than Google Fonts */
@font-face { font-family: "Syne"; src: url("../fonts/syne/syne-600-latin-ext.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Syne"; src: url("../fonts/syne/syne-600-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --canvas: #f9f8f5;
    --ink: #161616;
    --muted: #6e6c68;
    --brand: #ff5050;   /* logo red: marks, fills, ink-on-red */
    --accent: #d0393a;  /* same red, deep enough for text on canvas */
    --line: rgba(0, 0, 0, 0.16);
    --rule: rgba(0, 0, 0, 0.10);
    --tile: hsl(36 14% 88%);  /* shared backdrop for the scope images: warm stone under the canvas */
    --frame: min(100% - 2rem, 72rem);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --burn: cubic-bezier(0.25, 0.3, 0.3, 1);  /* steadier sweep for the art wipe */
    /* fine dashes, finer than border-style: dashed */
    --dash-x: linear-gradient(to right, var(--line) 3px, transparent 3px) left top / 7px 1px repeat-x;
    --dash-y: linear-gradient(to bottom, var(--line) 3px, transparent 3px) left top / 1px 7px repeat-y;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }

body {
    margin: 0;
    overflow-x: clip;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Sailec", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* The frame: two dashed verticals that run the full page height */
.frame { position: relative; width: var(--frame); margin: 0 auto; }
.frame::before, .frame::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 1px;
    background: var(--dash-y); pointer-events: none;
}
.frame::before { left: 0; }
.frame::after { right: 0; }

/* Each row gets a full-bleed dashed rule on top */
.row { position: relative; display: grid; }
.row::before {
    content: ""; position: absolute; top: 0; height: 1px;
    left: calc(50% - 50vw); width: 100vw;
    background: var(--dash-x);
}
.cell { padding: 2rem; min-width: 0; }
.cell + .cell { background: var(--dash-y); }

header {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--canvas) 88%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
header .row { grid-template-columns: auto 1fr auto; align-items: center; }
header .row::before { top: auto; bottom: 0; }
header .cell { padding-block: 0.6rem; }
/* Wordmark in Syne, centered on the bar: the cell is a flex row so no baseline gap pushes it up */
header .cell:first-child { display: flex; align-items: center; }
.mark { display: flex; align-items: center; gap: 0.6rem; font-family: "Syne", "Sailec", sans-serif; font-weight: 600; font-size: 1.3rem; line-height: 1; letter-spacing: -0.015em; text-decoration: none; }
.mark svg { width: 1.6rem; height: auto; display: block; fill: var(--ink); overflow: visible; }
.mark:hover { color: var(--ink); }  /* the cell animation is the hover cue; the word stays put */
.mark svg .dot { fill: var(--brand); }
header .cell:nth-child(2) { background: none; }
header .cell:last-child { font-size: 0.9rem; }
header nav { display: flex; gap: 1.75rem; }
header nav a { text-decoration: none; }
header nav a[aria-current] { text-decoration: underline; }

.label { margin: 0 0 1rem; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.01em; }

h1, h2 { font-weight: 400; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(2rem, 7.6vw, 4rem); line-height: 1.04; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.12; }

p { margin: 0 0 1em; font-size: 1.05rem; line-height: 1.6; letter-spacing: -0.005em; }
.small { font-size: 0.9rem; line-height: 1.55; color: var(--muted); }

/* Hero */
.hero { grid-template-columns: 1fr; text-align: center; }
.hero .cell { padding: clamp(3.5rem, 9vh, 6rem) 2rem 0; }
.hero h1 { margin-bottom: 0.9rem; }
.hero .tagline { color: var(--muted); font-size: 1.05rem; margin: 0 auto; max-width: 40rem; text-wrap: balance; }

.plate { margin: clamp(1rem, 2.5vh, 1.75rem) auto 0; width: min(100%, 40rem); --art-h: clamp(22rem, 64vh, 40rem); }
.plate .art { display: grid; justify-items: center; }

/* The burn wipe on the hero art */
.plate .wipe-target {
    -webkit-mask: url("../img/wipe.svg") 0 100% / 100% 237.5% no-repeat;
    mask: url("../img/wipe.svg") 0 100% / 100% 237.5% no-repeat;
    transition: -webkit-mask-position 2s var(--burn), mask-position 2s var(--burn);
}
.plate .wipe-target.in { -webkit-mask-position: 0 0; mask-position: 0 0; }
.plate img.wipe-target { height: var(--art-h); width: auto; max-width: 100%; object-fit: contain; display: block; }

/* Communications image: capillary with a red blood cell that scroll drives out of the lumen.
   Positions come from the base art's own pixel grid (1465 x 1099); the drift is set inline by JS. */
.scene { position: relative; width: 100%; height: 100%; }
.scene img { position: absolute; display: block; }
.scene .base { inset: 0; width: 100%; height: 100%; object-fit: contain; }
.scene .rbc { left: 48.601%; top: 36.124%; width: 37.611%; will-change: transform; }

.plate figcaption { padding: 1.25rem 0 1.5rem; color: var(--muted); font-size: 0.78rem; }

/* Intro + calls to action, one row */
.intro { grid-template-columns: 1fr; }
.intro .cell { padding-block: 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem 3rem; flex-wrap: wrap; }
.intro p { max-width: 36rem; margin-bottom: 0; font-size: 1.1rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.actions { display: flex; align-items: center; gap: 0.5rem 2rem; flex-wrap: wrap; }
/* Arrow sits outside the flow so the link underline doesn't run under it */
.arrow { position: relative; margin-right: 1.5rem; }
.arrow::after { content: "\2192"; position: absolute; left: 100%; margin-left: 0.5rem; transition: transform 0.25s var(--ease); }
.arrow:hover::after { transform: translateX(3px); }

/* Capabilities: heading row, then three equal cells */
.caps-head { grid-template-columns: 1fr; }
.caps-head .cell { padding-top: 3.5rem; padding-bottom: 3rem; }
.caps-head h2 { max-width: 22ch; }
.caps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cap { display: flex; flex-direction: column; gap: 0.5rem; padding: 3.5rem 2.5rem 3.5rem; }
/* Scope images: full cell width, 4:3 (the capillary art's own shape) */
.cap .thumb { width: 100%; aspect-ratio: 4 / 3; margin: 0 0 2.5rem; background: var(--tile); overflow: hidden; }
.settle { will-change: transform; }
.cap .thumb > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cap h3 { margin: 0; font-weight: 400; font-size: 1.2rem; letter-spacing: -0.01em; }
.cap p { margin: 0; }

/* Clients */
.clients { grid-template-columns: 1fr 2fr; }
.clients .cell:first-child { padding-top: 3.5rem; }
.clients ul { list-style: none; margin: 0; padding: 0; }
.clients li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 1.05rem;
}
.clients li:last-child { border-bottom: 0; }
.clients li span { color: var(--muted); font-size: 0.8rem; }
.clients .cell:last-child { padding-top: 2.25rem; padding-bottom: 2.25rem; }

/* Closing */
.closing { grid-template-columns: 1fr 1fr; }
.closing .cell { padding-block: 4rem; }
.closing .aside { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.25rem; }

/* About page */
.page-head { grid-template-columns: 1fr; }
.page-head .cell { padding-block: clamp(3.5rem, 10vh, 6rem) clamp(2.5rem, 6vh, 4rem); }
.page-head h1 { max-width: 14ch; }
.split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.split > .cell:first-child { padding-top: 3.5rem; }
.split > .cell:last-child { padding: 3.5rem 2.5rem; }
.split .body p { max-width: 38rem; text-wrap: pretty; }
.split .body p:last-child { margin-bottom: 0; }
.founder { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
/* Photo multiplies onto the page tone: whites become canvas, ink stays ink.
   The wrapper carries the canvas so the blend holds during the fade-in. */
.founder .portrait { width: 9rem; height: 9rem; background: var(--canvas); isolation: isolate; }
.founder img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) contrast(1.04); mix-blend-mode: multiply; }
.founder .name { margin: 0; font-size: 1.2rem; }
.founder .role { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9rem; }
.logos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.logos li {
    list-style: none; height: 7rem; display: grid; place-items: center;
    color: var(--muted); font-size: 0.8rem; letter-spacing: 0.02em;
    background: var(--dash-y), var(--dash-x);
}
.logos li:nth-child(4n+1) { background: var(--dash-x); }
.logos li:nth-child(-n+4) { background: var(--dash-y); }
.logos li:first-child { background: none; }
.logos-wrap { padding: 0 !important; }

/* Timeline: four stops along a dashed rail, each with a node */
.timeline-wrap { padding: 3.5rem 2.5rem !important; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.timeline li { position: relative; padding: 2.25rem 1.5rem 0 0; background: var(--dash-x); }
.timeline li::before {
    content: ""; position: absolute; top: -4px; left: 0;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--canvas); border: 1px solid var(--ink);
}
.timeline li:last-child::before { background: var(--brand); border-color: var(--brand); }
.timeline .year { display: block; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.025em; line-height: 1; margin-bottom: 1rem; }
.timeline p { margin: 0; font-size: 0.98rem; line-height: 1.45; }
.logos-wrap ul { margin: 0; padding: 0; }

footer .row { grid-template-columns: 1fr auto; align-items: center; }
footer .cell { padding-block: 1.5rem; font-size: 0.85rem; color: var(--muted); }
footer nav { display: flex; gap: 1.5rem; }

/* Buttons: black, easing a shade lighter on hover */
.button {
    display: inline-flex; align-items: center; gap: 0.5rem;
    min-height: 44px; padding: 0 1.1rem;
    background: var(--ink); color: var(--canvas);
    font-size: 0.9rem; text-decoration: none;
    transition: background 0.25s var(--ease);
}
.button:hover, .button:focus-visible { background: #3a3a3a; color: var(--canvas); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.28em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.link { display: inline-flex; align-items: center; min-height: 44px; }

/* Motion: everything marked .reveal rises in once */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* Headings rise into place line by line, each line inside its own window (js/reveal.js splits them) */
.wipe .line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.wipe .line > span {
    display: block;
    transform: translateY(110%);
    transition: transform 1.1s var(--ease);
    transition-delay: calc(var(--d, 0s) + var(--i, 0) * 0.12s);
}
.wipe.in .line > span { transform: none; }
/* Hidden until split, so unsplit text never flashes */
.js .wipe:not(:has(.line)) { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
    .reveal, .plate .art.reveal { opacity: 1; transform: none; transition: none; }
    .wipe .line > span { transform: none; transition: none; }
    .plate .wipe-target { -webkit-mask: none; mask: none; transition: none; }
    .scene .rbc { transform: translate(-5.445%, 16.274%); }
    html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
    .cell { padding: 1.5rem 1.25rem; }
    .intro, .clients, .closing, .caps, .split { grid-template-columns: 1fr; }
    .cell + .cell { background: var(--dash-x); }
    .caps-head .cell { padding-top: 2.5rem; padding-bottom: 2rem; }
    .cap { padding: 2.5rem 1.25rem; }
    .cap .thumb { margin: 0 0 1.5rem; }
    .split > .cell:first-child { padding-top: 2.5rem; padding-bottom: 0; }
    .split > .cell:last-child { background: none; padding: 1.25rem 1.25rem 2.5rem; }
    .founder { grid-template-columns: 1fr; gap: 1.5rem; }
    .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logos li, .logos li:nth-child(-n+4), .logos li:nth-child(4n+1) { background: var(--dash-y), var(--dash-x); }
    .logos li:nth-child(odd) { background: var(--dash-x); }
    .logos li:nth-child(-n+2) { background: var(--dash-y); }
    .logos li:first-child { background: none; }
    header nav { gap: 1.25rem; }
    .timeline-wrap { padding: 1.5rem 1.25rem 2.5rem !important; }
    .timeline { grid-template-columns: 1fr; }
    .timeline li { padding: 0 0 2rem 1.75rem; background: var(--dash-y); background-position: 4px 0; }
    .timeline li:last-child { padding-bottom: 0; background: none; }
    .timeline li::before { top: 0.35rem; left: 0; }
    header .cell + .cell { background: none; }
    .closing .cell { padding-block: 2.5rem; }
    .clients .cell:first-child { padding-top: 2.5rem; padding-bottom: 0; }
    .clients .cell:last-child { background: none; padding-top: 0.5rem; }
    .hero .cell { padding-top: 3rem; }
    footer .row { grid-template-columns: 1fr; }
    footer .cell + .cell { background: none; padding-top: 0; }
}

/* Compact button for the header */
.button-sm { min-height: 34px; padding: 0 0.85rem; font-size: 0.85rem; }
header nav { align-items: center; }
.mark, .button { white-space: nowrap; }
@media (max-width: 760px) {
    header .cell { padding-inline: 1rem; }
    header nav { gap: 1rem; }
}
@media (max-width: 760px) {
    header .row { grid-template-columns: 1fr auto; }
    header .cell:nth-child(2) { display: none; }
    header .nav-about { display: none; }
}
/* Footer reads as one strip: no divider between copyright and email */
footer .cell + .cell { background: none; }

/* Client logos: flattened to one ink tone so mixed brand colors and white marks read as a set */
.logos img { display: block; max-width: 66%; max-height: calc(2.1rem * var(--s, 1)); width: auto; height: auto; filter: grayscale(1) brightness(0); opacity: 0.55; transition: opacity 0.3s; }
.logos li:hover img { opacity: 0.85; }

/* Founder credentials */
.creds { list-style: none; margin: 1.25rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--rule); }
.creds li { color: var(--muted); font-size: 0.88rem; line-height: 1.5; padding: 0.15rem 0; }
/* On phones, keep the two-line break: match the other cells' gutter and
   scale the headline so "the people it serves" fits even on narrow screens */
@media (max-width: 760px) {
    .hero .cell { padding-inline: 1.25rem; }
    .hero h1 { font-size: min(2rem, calc((100vw - 72px) / 9.8)); }
}

/* About page: name meaning under the page title */
.page-sub { margin: 1.25rem 0 0; max-width: 34rem; color: var(--muted); font-size: 1.05rem; line-height: 1.55; text-wrap: pretty; }
.page-sub em { font-style: italic; color: var(--ink); }

/* Founder: portrait fills the left cell, text gets the full right column */
.founder-side { display: flex; flex-direction: column; }
/* Top of the curtain trimmed so the photo carries less weight */
.founder-photo { aspect-ratio: 3 / 4; background: var(--canvas); overflow: hidden; }
.founder-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 100%; }
.founder { grid-template-columns: 1fr; }
@media (max-width: 760px) {
    .founder-photo { aspect-ratio: 4 / 5; }
    .founder-photo img { object-position: 50% 70%; }
    .split > .founder-side { padding-bottom: 1.25rem; }
}

/* Closing: headline centers vertically against the button */
.closing .cell:first-child { display: flex; align-items: center; }

/* Page headlines in Syne (same pairing as andrewqtran.com); section headings stay in Sailec */
h1 { font-family: "Syne", "Sailec", sans-serif; font-weight: 600; letter-spacing: -0.02em; }

/* About: the logo as a large dividing cell, the studio section's hero (js/logo.js plays it on scroll) */
.split > .cell:has(.cell-mark) { display: flex; align-items: flex-start; justify-content: center; padding-block: 3.5rem; }
.cell-mark { width: min(16rem, 72%); margin: 0; }
.cell-mark svg { display: block; width: 100%; height: auto; fill: var(--ink); overflow: visible; }
.cell-mark svg .dot { fill: var(--brand); }
@media (max-width: 760px) {
    .split > .cell:has(.cell-mark) { justify-content: flex-start; padding-block: 2.5rem 0; }
    .cell-mark { width: 8rem; }
}
