@layer base, layout, components, responsive;

@layer base {
  :root { color-scheme:light; --bg:#f4f6f8; --paper:#ffffff; --surface:#e6edf3; --ink:#1c3345; --muted:#526579; --line:#ccd6df; --accent:#b0cee2; --accent-ink:#18394c; --deep:#203242; --deep-ink:#eef4f8; --header:#f4f6f8ef; --shadow:0 28px 64px #173e5712; }
  :root[data-theme="dark"] { color-scheme:dark; --bg:#141c23; --paper:#1b252e; --surface:#23313c; --ink:#e8f0f5; --muted:#a8b9c5; --line:#354753; --accent:#b0cee2; --accent-ink:#18394c; --deep:#1f2e3a; --deep-ink:#eef4f8; --header:#141c23ef; --shadow:0 28px 64px #0003; }
  @media (prefers-color-scheme:dark) { :root:not([data-theme]) { color-scheme:dark; --bg:#141c23; --paper:#1b252e; --surface:#23313c; --ink:#e8f0f5; --muted:#a8b9c5; --line:#354753; --accent:#b0cee2; --accent-ink:#18394c; --deep:#1f2e3a; --deep-ink:#eef4f8; --header:#141c23ef; --shadow:0 28px 64px #0003; } }
  * { box-sizing:border-box; }
  html { scroll-padding-top:100px; }
  body { margin:0; color:var(--ink); background:var(--bg); font:16px/1.65 "Segoe UI Variable","Segoe UI",-apple-system,BlinkMacSystemFont,Arial,sans-serif; -webkit-font-smoothing:antialiased; }
  h1,h2,h3,p,figure { margin:0; }
  h1,h2,h3 { font-weight:600; line-height:1.06; letter-spacing:-.055em; text-wrap:balance; }
  h1 { font-size:clamp(3.7rem,7.7vw,6.6rem); }
  h2 { font-size:clamp(2.5rem,4.9vw,4rem); }
  h3 { font-size:1.4rem; letter-spacing:-.035em; }
  p { text-wrap:pretty; }
  a { color:inherit; text-underline-offset:.22em; }
  img { display:block; max-width:100%; height:auto; }
  button,select { font:inherit; color:inherit; }
  svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
  :focus-visible { outline:3px solid var(--ink); outline-offset:6px; border-radius:2px; }
  ::selection { color:var(--accent-ink); background:var(--accent); }
  .serif { font-family:Georgia,"Times New Roman",serif; font-weight:400; font-style:italic; letter-spacing:-.07em; }
  .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
  .skip-link { position:fixed; z-index:30; top:12px; left:20px; padding:10px 18px; color:var(--accent-ink); background:var(--accent); transform:translateY(-200%); }
  .skip-link:focus { transform:none; }
}

@layer layout {
  .shell { width:min(1200px,calc(100% - 96px)); margin-inline:auto; }
  .site-header { position:sticky; top:0; z-index:20; background:var(--header); border-bottom:1px solid var(--line); backdrop-filter:blur(18px); }
  .header-inner { display:flex; align-items:center; gap:32px; min-height:88px; }
  .header-inner nav { display:flex; align-items:center; gap:28px; margin-left:auto; }
  .hero { padding-top:66px; }
  .hero-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,.85fr); gap:74px; align-items:center; padding-block:32px 58px; }
  .hero-description { max-width:480px; margin-top:30px; color:var(--muted); font-size:1.12rem; }
  .hero-actions { display:flex; flex-wrap:wrap; align-items:center; gap:24px; margin-top:32px; }
  .hero-footnote { display:flex; justify-content:space-between; align-items:center; gap:24px; padding-block:23px; border-block:1px solid var(--line); color:var(--muted); font-size:.8rem; }
  .work-section { padding-block:94px 84px; }
  .section-topline { display:flex; justify-content:space-between; align-items:center; gap:24px; }
  .section-heading { display:flex; justify-content:space-between; gap:36px; align-items:flex-end; margin-block:22px 42px; }
  .section-heading>p { color:var(--muted); font-size:.95rem; }
  .project { display:grid; grid-template-columns:.8fr 1.2fr; gap:52px; align-items:center; padding:36px; background:var(--paper); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); }
  .project-copy { min-width:0; }
  .project-visual { min-width:0; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:var(--surface); }
  .work-more { display:flex; justify-content:space-between; align-items:center; gap:32px; padding-top:28px; color:var(--muted); font-size:.86rem; }
  .about-section { background:var(--deep); color:var(--deep-ink); padding-block:96px; }
  .about-grid { display:grid; grid-template-columns:1fr 1fr; gap:110px; }
  .about-intro h2 { margin-block:24px 28px; }
  .about-intro>p:not(.eyebrow) { color:#c5d1dc; max-width:430px; margin-bottom:18px; }
  .about-intro>.quiet-link { display:inline-flex; color:var(--accent); margin-top:12px; }
  .elsewhere-section { padding-block:92px; }
  .elsewhere-heading { display:flex; justify-content:space-between; gap:36px; align-items:flex-end; margin-block:22px 40px; }
  .elsewhere-heading>p { color:var(--muted); font-size:.95rem; }
  .elsewhere-links { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
  .site-footer { display:flex; flex-wrap:wrap; align-items:center; gap:18px 30px; padding-block:28px 34px; border-top:1px solid var(--line); font-size:.8rem; color:var(--muted); }
  .site-footer nav { display:flex; flex-wrap:wrap; gap:22px; margin-left:auto; }
  .copyright { flex-basis:100%; font-size:.72rem; }
}

@layer components {
  .brand { display:inline-flex; align-items:center; flex-shrink:0; gap:11px; text-decoration:none; font-size:1.1rem; letter-spacing:-.04em; font-weight:650; }
  .brand img { border-radius:50%; width:38px; height:38px; }
  .brand-dot { color:var(--muted); }
  .header-inner nav a { text-decoration:none; font-size:.85rem; font-weight:500; }
  .header-inner nav a:hover,.quiet-link:hover { text-decoration:underline; }
  .theme-control { display:flex; align-items:center; gap:8px; border-left:1px solid var(--line); padding-left:22px; color:var(--muted); }
  .theme-control svg { width:17px; height:17px; }
  .theme-control select { border:0; background:transparent; padding:8px 0; max-width:88px; font-size:.78rem; cursor:pointer; }
  .theme-control option { color:var(--ink); background:var(--paper); }
  .theme-control:has(select:disabled) { display:none; }
  .hero-kicker,.eyebrow,.section-number,.art-label,.art-caption,.destination-label { font-family:"Cascadia Code",Consolas,monospace; font-size:.68rem; font-weight:500; letter-spacing:.05em; }
  .hero-kicker { display:flex; align-items:center; gap:11px; color:var(--muted); }
  .status-dot { width:7px; height:7px; border-radius:50%; background:var(--ink); box-shadow:0 0 0 4px color-mix(in srgb,var(--ink) 8%,transparent); }
  .kicker-rule { height:1px; width:25px; background:var(--line); margin-inline:4px; }
  .button { display:inline-flex; align-items:center; justify-content:center; gap:28px; min-height:52px; padding:12px 20px; border:1px solid transparent; border-radius:5px; font-weight:600; font-size:.88rem; text-decoration:none; transition:transform .2s,background .2s; }
  .primary { color:var(--accent-ink); background:var(--accent); }
  .primary:hover { background:#9dbfd7; transform:translateY(-2px); }
  .quiet-link { display:inline-flex; align-items:center; gap:8px; font-size:.82rem; font-weight:500; text-decoration:none; }
  .hero-footnote>a { display:grid; place-items:center; width:30px; height:30px; border:1px solid var(--line); border-radius:50%; text-decoration:none; font-size:1rem; }
  .hero-art { width:100%; max-width:430px; justify-self:end; }
  .art-label,.art-caption { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:.64rem; }
  .art-label { margin-bottom:10px; }
  .art-caption { margin-top:10px; }
  .art-board { position:relative; aspect-ratio:1.08; overflow:hidden; background:var(--surface); border:1px solid var(--line); border-radius:5px; }
  .art-grid { position:absolute; inset:0; background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px); background-size:36px 36px; opacity:.5; }
  .art-mark { position:absolute; top:10%; left:18%; width:64%; border-radius:50%; filter:drop-shadow(0 16px 18px #0002); }
  .art-note { position:absolute; left:20px; bottom:20px; font-size:.64rem; font-family:"Cascadia Code",Consolas,monospace; line-height:1.5; }
  .art-spark { position:absolute; right:23px; bottom:13px; font-size:2.5rem; line-height:1; }
  .art-corner { position:absolute; width:9px; height:9px; border-color:var(--ink); border-style:solid; border-width:0; }
  .top-left { top:9px; left:9px; border-top-width:1px; border-left-width:1px; }
  .top-right { top:9px; right:9px; border-top-width:1px; border-right-width:1px; }
  .bottom-left { bottom:9px; left:9px; border-bottom-width:1px; border-left-width:1px; }
  .bottom-right { bottom:9px; right:9px; border-bottom-width:1px; border-right-width:1px; }
  .eyebrow { text-transform:uppercase; color:var(--muted); }
  .section-number { color:var(--muted); }
  .project-meta { display:flex; align-items:center; gap:12px; color:var(--muted); font-size:.72rem; }
  .project-meta img { width:36px; height:36px; }
  .project-meta span span { margin-inline:6px; color:var(--line); }
  .project h3 { display:flex; align-items:center; gap:16px; font-size:2.5rem; margin-top:24px; }
  .project h3>span { font-size:1.3rem; color:var(--muted); }
  .project-lead { font-size:1rem; margin-top:8px; }
  .project-description { margin-top:15px; color:var(--muted); font-size:.88rem; }
  .project-tags { display:flex; flex-wrap:wrap; gap:7px; padding:0; list-style:none; margin:20px 0 0; }
  .project-tags li { border:1px solid var(--line); padding:3px 8px; border-radius:4px; color:var(--muted); font-size:.69rem; }
  .project-links { display:flex; flex-wrap:wrap; align-items:center; gap:22px; margin-top:24px; }
  .text-link { display:inline-flex; align-items:center; gap:18px; font-size:.85rem; font-weight:650; text-decoration:underline; text-decoration-color:var(--line); text-underline-offset:6px; }
  .text-link:hover { text-decoration-color:var(--ink); }
  .preview-toolbar { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; gap:12px; font-size:.6rem; color:var(--muted); border-bottom:1px solid var(--line); }
  .preview-dots { display:flex; gap:4px; }
  .preview-dots i { display:block; width:4px; height:4px; border:1px solid var(--muted); border-radius:50%; }
  .screenshot-link { display:block; }
  .screenshot-link:focus-visible { outline-offset:-4px; }
  .screenshot-link img { width:100%; }
  .project-visual figcaption { display:flex; justify-content:space-between; gap:14px; padding:11px 12px; color:var(--muted); border-top:1px solid var(--line); font-size:.65rem; }
  .preview-stamp { font-style:italic; white-space:nowrap; }
  .about-section .eyebrow { color:#aec6d7; }
  .about-section :focus-visible { outline-color:var(--accent); }
  .principles { list-style:none; padding:0; margin:4px 0 0; }
  .principles li { display:flex; align-items:flex-start; gap:23px; padding-block:23px; border-top:1px solid #b0cee240; }
  .principles li:last-child { padding-bottom:0; }
  .principle-number { color:var(--accent); font:.65rem/1.8 "Cascadia Code",Consolas,monospace; }
  .principles h3 { font-size:1.2rem; line-height:1.3; }
  .principles p { color:#c5d1dc; font-size:.86rem; margin-top:10px; }
  .small-spark { font-size:2.1rem; line-height:1; }
  .destination { display:flex; align-items:center; gap:20px; padding:28px; background:var(--paper); border:1px solid var(--line); border-radius:8px; text-decoration:none; transition:transform .2s,border-color .2s; }
  .destination:hover { transform:translateY(-3px); border-color:var(--ink); }
  .destination-icon { display:grid; place-items:center; width:48px; height:48px; border:1px solid var(--line); border-radius:50%; flex:none; }
  .destination h3 { font-size:1.4rem; margin-top:8px; }
  .destination p { color:var(--muted); font-size:.8rem; margin-top:7px; }
  .destination-label { color:var(--muted); font-size:.66rem; }
  .destination-arrow { margin-left:auto; align-self:flex-start; font-size:1.3rem; }
  .coffee { color:var(--accent-ink); background:var(--accent); border-color:var(--accent); }
  .coffee .destination-label,.coffee p { color:#304f64; }
  .coffee .destination-icon { border-color:#294d6540; }
  .footer-brand { color:var(--ink); font-weight:650; text-decoration:none; font-size:.95rem; letter-spacing:-.03em; }
  .site-footer nav a { text-decoration:none; }
  .site-footer nav a:hover { text-decoration:underline; }
}

@layer responsive {
  @media (max-width:1050px) {
    .shell { width:calc(100% - 64px); }
    .hero-grid { gap:36px; grid-template-columns:1.2fr .8fr; }
    .hero-actions { gap:18px; }
    .hero-description { font-size:1rem; }
    .project { gap:32px; padding:28px; }
    .about-grid { gap:60px; }
    .destination { gap:14px; padding:23px; }
    .destination p { max-width:210px; }
    .destination-icon { width:40px; height:40px; }
  }
  @media (max-width:760px) {
    html { scroll-padding-top:124px; }
    .shell { width:calc(100% - 40px); }
    .header-inner { min-height:76px; gap:16px; flex-wrap:wrap; padding-block:14px 12px; }
    .brand { font-size:1rem; }
    .brand img { width:30px; height:30px; }
    .header-inner nav { order:3; width:100%; justify-content:space-between; gap:18px; }
    .header-inner nav a { font-size:.75rem; }
    .theme-control { margin-left:auto; padding-left:13px; gap:6px; }
    .theme-control select { font-size:.72rem; max-width:70px; padding-block:3px; }
    .theme-control svg { width:15px; height:15px; }
    .hero { padding-top:36px; }
    .hero-kicker { flex-wrap:wrap; row-gap:6px; font-size:.62rem; }
    .hero-grid { grid-template-columns:1fr; gap:40px; padding-block:27px 32px; }
    h1 { font-size:clamp(3.5rem,13vw,5rem); }
    .hero-description { max-width:510px; margin-top:24px; font-size:1rem; }
    .hero-actions { margin-top:25px; gap:20px; }
    .button { min-height:49px; gap:20px; padding:11px 17px; font-size:.8rem; }
    .quiet-link { font-size:.78rem; }
    .hero-art { max-width:430px; justify-self:center; }
    .art-board { aspect-ratio:1.5; }
    .art-mark { width:45%; top:6%; left:29%; }
    .art-note { font-size:.62rem; }
    .hero-footnote { font-size:.67rem; gap:16px; padding-block:18px; }
    .work-section,.elsewhere-section { padding-block:58px; }
    .eyebrow,.section-number { font-size:.64rem; }
    .section-heading,.elsewhere-heading { display:block; margin-block:20px 28px; }
    h2 { font-size:clamp(2.4rem,9vw,3.4rem); }
    .section-heading>p,.elsewhere-heading>p { margin-top:18px; font-size:.87rem; }
    .project { grid-template-columns:1fr; padding:24px; gap:28px; }
    .project h3 { font-size:2.3rem; margin-top:20px; }
    .project-description { font-size:.9rem; max-width:540px; }
    .project-tags li { font-size:.68rem; }
    .project-links { gap:24px; }
    .project-visual figcaption { font-size:.6rem; }
    .work-more { align-items:flex-start; flex-direction:column; gap:18px; padding-top:24px; font-size:.8rem; }
    .about-section { padding-block:58px; }
    .about-grid { grid-template-columns:1fr; gap:40px; }
    .about-intro>p:not(.eyebrow) { max-width:550px; font-size:.94rem; }
    .principles li { padding-block:23px; gap:20px; }
    .principles p { max-width:480px; }
    .elsewhere-links { grid-template-columns:1fr; gap:16px; }
    .destination { padding:24px 20px; gap:17px; }
    .destination h3 { font-size:1.35rem; }
    .destination p { max-width:none; font-size:.78rem; }
    .destination-label { font-size:.64rem; }
    .site-footer { gap:15px 24px; padding-block:26px; }
    .site-footer>p { flex-basis:100%; font-size:.76rem; }
    .site-footer nav { margin-left:0; }
    .copyright { font-size:.66rem; }
  }
  @media (max-width:370px) {
    .shell { width:calc(100% - 32px); }
    .brand { font-size:.9rem; gap:8px; }
    .brand img { width:28px; height:28px; }
    .theme-control { padding-left:9px; }
    .theme-control svg { display:none; }
    h1 { font-size:3.2rem; }
    .hero-actions { align-items:flex-start; gap:20px; flex-direction:column; }
    .project { padding:20px; }
    .preview-toolbar>span:last-child,.preview-stamp { display:none; }
  }
  @media (prefers-reduced-motion:no-preference) {
    html { scroll-behavior:smooth; }
    .hero-copy { animation:arrive .7s both; }
    .hero-art { animation:arrive .9s .12s both; }
    @keyframes arrive { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
  }
  @media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
  @media (forced-colors:active) {
    .brand img,.art-mark,.project-meta img { forced-color-adjust:none; }
    .primary,.coffee,.about-section { color:CanvasText; background:Canvas; border:1px solid CanvasText; }
    .about-intro>p:not(.eyebrow),.principles p,.about-section .eyebrow,.about-intro>.quiet-link,.coffee p,.coffee .destination-label { color:CanvasText; }
    .art-grid { display:none; }
  }
}
