/*
 * SORA — shared design system.
 * Tokens, header, footer, buttons, type and section patterns used on every
 * page. Page-specific styles stay inline in each page.
 */

:root {
    --ink: #000;
    --text: #1a1a1a;
    --muted: #5c5c5c;
    --soft: #737373;
    --line: rgba(0,0,0,0.08);
    --line-strong: rgba(0,0,0,0.16);
    --tint: rgba(0,0,0,0.025);
    --bg: #fefefe;
    --card: #fff;
    --error: #b42318;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    --radius: 16px;
    --gutter: 40px;
    --max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 300;
    background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 9999px;
    text-decoration: none; font-size: 14px;
}
.skip-link:focus { top: 16px; }

/* ── Header ── */
.header {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 40px 50px; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; margin-right: 40px; flex-shrink: 0; padding: 5px; margin-left: -5px; }
.logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a {
    color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 400;
    letter-spacing: 0.01em; transition: opacity 0.3s ease;
    padding: 12px 0; /* comfortable tap target without changing the look */
}
.nav a:hover { opacity: 0.6; }
.nav a[aria-current="page"]:not(.nav-cta) {
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
}
.nav-cta {
    margin-left: 4px; padding: 10px 18px !important; background: var(--ink); color: #fff !important;
    border-radius: 9999px; font-size: 13px !important; font-weight: 500; letter-spacing: 0.02em;
    white-space: nowrap; transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-cta:hover { opacity: 0.85 !important; transform: scale(1.02); }

/* ── Type & sections ── */
.eyebrow {
    font-family: var(--mono); font-size: 13px; color: var(--soft);
    letter-spacing: 0.02em; margin-bottom: 14px;
}
.section { padding: 88px var(--gutter); max-width: var(--max); margin: 0 auto; scroll-margin-top: 24px; }
.section-head { max-width: 620px; margin-bottom: 44px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-title { font-size: 34px; font-weight: 300; letter-spacing: -0.025em; line-height: 1.15; }
.section-intro { font-size: 16px; color: var(--muted); line-height: 1.7; margin-top: 14px; }
.divider { max-width: var(--max); margin: 0 auto; border: none; border-top: 1px solid var(--line); }

.page-hero { padding: 150px var(--gutter) 56px; max-width: var(--max); margin: 0 auto; }
.page-hero h1 { font-size: 52px; font-weight: 300; letter-spacing: -0.035em; line-height: 1.05; max-width: 760px; }
.page-hero .lede { font-size: 17px; color: var(--muted); line-height: 1.65; margin-top: 20px; max-width: 520px; }

/* ── Buttons & links ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 26px; border-radius: 9999px; font-size: 15px; font-weight: 500;
    text-decoration: none; cursor: pointer; border: 1px solid var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.text-link {
    color: var(--ink); text-decoration: none; font-weight: 500;
    border-bottom: 1px solid var(--line-strong); transition: border-color 0.2s ease;
}
.text-link:hover { border-color: var(--ink); }

.callout {
    padding: 18px 22px; border-radius: 12px; background: var(--tint);
    font-size: 14px; color: var(--muted); line-height: 1.6;
}
.callout strong { color: var(--ink); font-weight: 500; }

.closing { text-align: center; padding: 96px var(--gutter) 104px; }
.closing h2 { font-size: 40px; font-weight: 300; letter-spacing: -0.03em; }
.closing p { color: var(--muted); margin-top: 12px; font-size: 15px; }
.closing .btn { margin-top: 28px; }

/* ── Marquee ── */
.marquee-container { background: #000; color: #fff; padding: 20px 0; overflow: hidden; }
.marquee { display: flex; white-space: nowrap; animation: marquee-scroll 30s linear infinite; will-change: transform; }
.marquee-container:hover .marquee { animation-play-state: paused; }
.marquee-text { font-size: 16px; font-weight: 400; letter-spacing: 0.05em; text-transform: uppercase; padding-right: 0.5em; }
@keyframes marquee-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── Footer ── */
.footer { padding: 60px 40px 32px; border-top: 1px solid var(--line); }
.footer-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.footer-brand { font-size: 80px; font-weight: 700; line-height: 0.9; letter-spacing: -0.03em; }
.footer-nav { display: flex; flex-direction: column; gap: 0; align-items: flex-end; }
.footer-nav a { color: var(--ink); text-decoration: none; font-size: 15px; padding: 5px 0; transition: opacity 0.3s ease; }
.footer-nav a:hover { opacity: 0.6; }
.footer-meta {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
    margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
    font-size: 13px; color: var(--soft);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    :root { --gutter: 30px; }
    .page-hero { padding-top: 130px; }
    .page-hero h1 { font-size: 44px; }
}
@media (max-width: 768px) {
    .header { padding: 30px 30px; }
    .nav { gap: 20px; }
    .nav a:not(.nav-cta) { font-size: 13px; }
    .section { padding: 64px var(--gutter); }
    .section-title { font-size: 28px; }
    .closing h2 { font-size: 32px; }
    .marquee-text { font-size: 14px; }
    .footer { padding: 40px 20px 28px; }
    .footer-main { flex-direction: column; align-items: flex-start; }
    .footer-brand { font-size: 48px; }
    .footer-nav { align-items: flex-start; }
    .footer-nav a { padding: 10px 0; } /* larger tap targets on touch screens */
}
@media (max-width: 600px) {
    :root { --gutter: 20px; }
}
@media (max-width: 480px) {
    .header { padding: 24px 16px; }
    .logo { margin-right: 12px; }
    .logo img { height: 34px; }
    .nav { gap: 12px; }
    .nav a:not(.nav-cta) { font-size: 12px; }
    .nav-cta { padding: 10px 12px !important; font-size: 12px !important; margin-left: 0; }
    .page-hero { padding-top: 112px; padding-bottom: 40px; }
    .page-hero h1 { font-size: 36px; }
    .page-hero .lede { font-size: 16px; }
    .btn-row .btn { flex: 1 1 100%; }
    .section-title { font-size: 28px; }
    .marquee-text { font-size: 13px; }
    .footer-brand { font-size: 40px; }
}
@media (max-width: 480px) {
    .nav .nav-home { display: none; } /* the logo links home */
}
@media (max-width: 350px) {
    .nav { gap: 9px; }
    .nav a { font-size: 11px !important; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    .marquee { animation: none; }
}

/* ── Portfolio: masonry, tiles, lightbox (shared by Home, Work, Stories) ── */
.masonry { display: flex; gap: var(--gap, 20px); align-items: flex-start; }
.masonry-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap, 20px); }
.tile {
    display: block; width: 100%; padding: 0; border: none; background: #f1f1f1; cursor: zoom-in;
    overflow: hidden; border-radius: 2px; position: relative;
}
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease, transform 1.2s ease; }
.tile img.is-loaded, .tile img.no-fade { opacity: 1; }
.tile:hover img { transform: scale(1.025); }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.lightbox {
    border: none; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
    background: #0b0b0b; color: #fff;
}
.lightbox::backdrop { background: #000; }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 13px; color: rgba(255,255,255,0.7); font-family: var(--mono); }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 76px; position: relative; }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-btn {
    width: 44px; height: 44px; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06); color: #fff; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; font-size: 17px; transition: background 0.2s ease;
}
.lb-btn:hover { background: rgba(255,255,255,0.16); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-caption { min-height: 56px; padding: 14px 20px 20px; text-align: center; font-size: 13px; color: rgba(255,255,255,0.78); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.lb-caption strong { color: #fff; font-weight: 500; }
.lb-gear { font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,0.6); }

.load-error { padding: 40px 0; color: var(--muted); font-size: 15px; }

@media (max-width: 768px) {
    .masonry { --gap: 8px; }
    .lb-stage { padding: 0 8px; }
    .lb-prev, .lb-next { top: auto; bottom: -62px; transform: none; }
    .lb-prev { left: 20px; }
    .lb-next { right: 20px; }
    .lb-caption { padding-bottom: 80px; }
}
