:root {
  color-scheme: light;
  --paper: #f3f5f4;
  --white: #fff;
  --ink: #202724;
  --muted: #64716b;
  --line: #dce2de;
  --red: #bc392d;
  --green: #326459;
  --blue: #466a83;
  --display: Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --utility: "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; letter-spacing: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: var(--white); }
button, input, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
svg { display: block; width: 20px; height: 20px; flex: none; stroke-width: 1.5; }
[hidden] { display: none !important; }
.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: fixed; top: 10px; left: 20px; padding: 12px; background: white; z-index: 5; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* ===== Header ===== */
.site-header { height: 76px; background: var(--paper); }
.header-inner, .hero-inner, .projects, .footer-inner { width: min(100% - 112px, 1280px); margin-inline: auto; }
.header-inner { display: flex; height: 100%; align-items: center; }
.wordmark { font: italic 600 42px/1 var(--display); padding: 0 4px 7px 0; }
.wordmark span { color: var(--red); }
.site-label { font-size: 11px; margin-left: 22px; color: var(--muted); }
.header-nav { margin-left: auto; display: flex; gap: 34px; align-items: center; font-size: 13px; }
.header-nav a { min-height: 44px; display: inline-flex; align-items: center; transition: color .2s; }
.header-nav a:hover { color: var(--red); }
.header-nav .directory-link { border-left: 1px solid #ccd4ce; margin-left: 4px; padding-left: 32px; gap: 18px; }
.directory-link svg { width: 15px; height: 15px; }

/* ===== Storyboard side nav ===== */
.storyboard { position: fixed; left: 30px; top: 50%; transform: translateY(-50%); z-index: 4; display: none; border-left: 1px solid var(--line); padding-left: 18px; }
.storyboard p { font: 10px/1 var(--utility); color: var(--muted); margin: 0 0 14px; white-space: nowrap; }
.storyboard a { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; font-size: 12px; color: var(--muted); transition: color .2s; position: relative; white-space: nowrap; }
.storyboard a b { font: 10px/1 var(--utility); font-weight: 400; }
.storyboard a span { font: italic 14px/1 var(--display); color: var(--ink); }
.storyboard a::before { content: ""; position: absolute; left: -19px; top: 50%; width: 1px; height: 0; background: var(--red); transition: height .25s; transform: translateY(-50%); }
.storyboard a:hover { color: var(--red); }
.storyboard a[aria-current="true"] { color: var(--red); }
.storyboard a[aria-current="true"]::before { height: 100%; }
@media (min-width: 1640px) { .storyboard { display: block; } }

/* ===== Hero ===== */
.hero { position: relative; padding-block: 64px 90px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
.hero-hi { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); margin: 0 0 30px; }
.hero-hi img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
h1 { font: normal clamp(52px, 6.4vw, 96px)/1.08 var(--display); margin: 0; color: #203b30; }
h1 span { color: var(--red); }
.signature { font: italic 28px/1.2 var(--display); color: #30483d; margin: 20px 0 0 4px; }
.hero-desc { font-size: 14px; line-height: 1.9; color: var(--muted); margin: 26px 0 0; max-width: 420px; }
.hero-actions { display: flex; gap: 16px; margin-top: 38px; flex-wrap: wrap; }
.btn-primary, .btn-ghost { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 24px; border-radius: 4px; font-size: 13px; transition: background .2s, color .2s, border-color .2s; }
.btn-primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--green); border-color: var(--green); }
.btn-ghost { border: 1px solid #b8c3bc; color: var(--ink); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-primary svg, .btn-ghost svg { width: 15px; height: 15px; }
.hero-photo { margin: 0; position: relative; transform: rotate(1.6deg); }
.hero-photo::before { content: ""; position: absolute; inset: 0; border: 1px solid #c8d2cb; border-radius: 6px; transform: rotate(-3.2deg); background: var(--white); }
.hero-photo img { position: relative; width: 100%; aspect-ratio: 4 / 3.1; object-fit: cover; object-position: center 60%; border-radius: 6px; border: 1px solid #c8d2cb; }
.hero-photo figcaption { position: absolute; bottom: 16px; right: 12px; z-index: 1; font: 10px/1 var(--utility); color: white; writing-mode: vertical-rl; text-shadow: 0 1px 5px #18251e; }
.scroll-hint { width: min(100% - 112px, 1280px); margin: 74px auto 0; font: 11px/1 var(--utility); color: var(--muted); }

/* ===== Marquee ===== */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--white); }
.marquee-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee-track span { padding: 15px 0; font: 11px/1 var(--utility); letter-spacing: 3px; color: var(--muted); white-space: nowrap; }
.marquee-track b { color: var(--red); font-weight: 400; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Collection heading / search / filters ===== */
.projects { padding-block: 64px 70px; }
.projects-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.eyebrow { font: 10px/1.5 var(--utility); letter-spacing: 2px; color: var(--muted); margin: 0 0 10px; }
h2 { display: flex; align-items: flex-start; gap: 12px; font: normal 44px/1.2 var(--display); margin: 0; }
.total-count { padding-top: 6px; color: var(--red); font: 13px/1.4 var(--utility); }
.section-copy { font-size: 13px; line-height: 1.8; color: var(--muted); margin: 14px 0 0; }
.search { display: flex; width: 250px; height: 42px; align-items: center; border-bottom: 1px solid #b8c3bc; gap: 10px; color: var(--muted); flex: none; }
.search:focus-within { border-color: var(--green); }
.search > svg { width: 17px; height: 17px; }
.search input { min-width: 0; width: 100%; background: transparent; border: 0; height: 100%; font-size: 13px; color: var(--ink); }
.search input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@supports selector(:has(a)) {
  .search input:focus-visible { outline: 0; }
  .search:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 4px; }
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); }
.icon-button { width: 40px; height: 40px; border: 0; display: grid; place-items: center; background: transparent; color: var(--muted); flex: none; }
.icon-button:hover { color: var(--ink); }
.search-clear { width: 32px; height: 38px; }
.search-clear svg { width: 16px; height: 16px; }
.collection-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 30px; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 32px; }
.filters button { color: var(--muted); position: relative; border: 0; background: transparent; padding: 12px 0 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 44px; }
.filters button span { font: 10px/1 var(--utility); color: var(--muted); }
.filters button::after { position: absolute; content: ""; bottom: -1px; height: 2px; left: 0; right: 0; background: transparent; }
.filters button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.filters button[aria-pressed="true"]::after { background: var(--red); }
.filters button:hover { color: var(--red); }
.result-count { color: var(--muted); font-size: 11px; }

/* ===== Project groups (story chapters) ===== */
.project-group { --category: var(--green); --tint: #e8efeb; padding-top: 72px; scroll-margin-top: 26px; }
.project-group[data-category="everyday"] { --category: var(--blue); --tint: #eaf0f4; }
.project-group[data-category="interests"] { --category: var(--red); --tint: #f7eeea; }
.group-heading { margin-bottom: 26px; position: relative; }
.ghost { position: absolute; right: 0; top: -0.28em; z-index: -1; font: italic 700 clamp(60px, 9vw, 118px)/1 var(--display); color: var(--category); opacity: .09; pointer-events: none; user-select: none; }
.group-heading .eyebrow { margin-bottom: 12px; }
.chapter { color: var(--category); }
.group-title-row { display: flex; align-items: baseline; gap: 16px; }
.group-title-row h3 { margin: 0; font: normal 34px/1.25 var(--display); }
.group-count { margin-left: auto; font: 10px/1 var(--utility); color: var(--muted); }
.group-tagline { font: italic 14px/1.3 var(--display); color: var(--muted); margin: 10px 0 0; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.project { display: flex; align-items: center; gap: 16px; min-height: 108px; padding: 20px; border: 1px solid #e1e7e3; border-radius: 5px; background: #fcfdfc; position: relative; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.project-icon { flex: none; width: 43px; height: 43px; border-radius: 50%; background: var(--tint); color: var(--category); display: grid; place-items: center; }
.project-icon svg { width: 22px; height: 22px; }
.project-copy { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.project-name { font-size: 15px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.project-desc { font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.project-arrow { width: 16px; height: 16px; color: var(--muted); margin-left: auto; align-self: flex-start; flex: none; transition: transform .18s, color .18s; }
.project:hover { background: white; border-color: #a6b9ad; border-color: color-mix(in srgb, var(--category) 40%, #a6b9ad); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(32,39,36,.07); }
.project:hover .project-arrow { color: var(--category); transform: translate(2px,-2px); }
.empty-state { text-align: center; min-height: 260px; padding: 60px 16px; color: var(--muted); }
.empty-state > svg { width: 28px; height: 28px; margin: auto; }
.empty-state p { font-size: 15px; }
.reset-search { background: transparent; border: 0; color: var(--green); display: inline-flex; align-items: center; gap: 12px; font-size: 13px; min-height: 44px; }
.reset-search svg { width: 16px; height: 16px; }

/* ===== Footer (Say Hello) ===== */
.site-footer { border-top: 1px solid var(--line); padding-block: 80px 0; }
.footer-title { font: normal clamp(40px, 5vw, 64px)/1.1 var(--display); margin: 0; }
.footer-title span { color: var(--red); }
.footer-sign { font: italic 18px/1.4 var(--display); color: var(--muted); margin: 22px 0 0; }
.footer-bar { display: flex; align-items: center; gap: 28px; min-height: 104px; margin-top: 64px; border-top: 1px solid var(--line); }
.footer-bar .wordmark { font-size: 34px; }
.footer-bar > span { font-size: 11px; color: var(--muted); }
.back-top { border: 1px solid #d6ddd8; border-radius: 50%; margin-left: auto; }
.back-top svg { width: 16px; height: 16px; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .header-inner, .hero-inner, .projects, .footer-inner, .scroll-hint { width: calc(100% - 64px); }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-photo { max-width: 560px; }
  h2 { font-size: 36px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .header-inner, .hero-inner, .projects, .footer-inner, .scroll-hint { width: calc(100% - 40px); }
  .site-header { height: 62px; }
  .wordmark { font-size: 36px; }
  .site-label { margin-left: 15px; font-size: 10px; }
  .header-nav { gap: 22px; font-size: 12px; }
  .header-nav .directory-link { display: none; }
  .hero { padding-block: 40px 56px; }
  .hero-inner { gap: 40px; }
  .hero-hi { margin-bottom: 22px; font-size: 13px; }
  .hero-hi img { width: 34px; height: 34px; }
  h1 { font-size: clamp(40px, 11vw, 56px); }
  .signature { font-size: 22px; margin-top: 14px; }
  .hero-desc { font-size: 13px; margin-top: 20px; }
  .hero-actions { margin-top: 28px; gap: 12px; }
  .btn-primary, .btn-ghost { min-height: 44px; padding: 0 18px; font-size: 12px; }
  .hero-photo { transform: none; }
  .hero-photo::before { transform: rotate(-2deg); }
  .hero-photo img { aspect-ratio: 4 / 2.8; object-position: center 60%; }
  .scroll-hint { margin-top: 48px; font-size: 10px; }
  .marquee-track span { padding: 12px 0; font-size: 10px; letter-spacing: 2px; }
  .projects { padding-block: 44px 40px; }
  .projects-heading { flex-direction: column; align-items: stretch; gap: 18px; }
  h2 { font-size: 30px; gap: 8px; }
  .eyebrow { font-size: 9px; margin-bottom: 7px; }
  .total-count { font-size: 11px; padding-top: 3px; }
  .section-copy { font-size: 12px; }
  .search { width: 100%; }
  .collection-bar { margin-top: 16px; }
  .filters { gap: 25px; }
  .filters button { font-size: 12px; gap: 6px; }
  .filters button span { font-size: 9px; }
  .result-count { display: none; }
  .project-group { padding-top: 56px; }
  .group-title-row h3 { font-size: 24px; }
  .group-tagline { font-size: 12px; }
  .project-grid { grid-template-columns: 1fr; gap: 8px; }
  .project { min-height: 90px; padding: 19px; gap: 17px; }
  .project-icon { width: 40px; height: 40px; }
  .project-name { font-size: 15px; }
  .project-desc { font-size: 12px; }
  .project-arrow { align-self: center; }
  .site-footer { padding-block: 56px 0; }
  .footer-title { font-size: 34px; }
  .footer-sign { font-size: 15px; }
  .footer-bar { gap: 16px; min-height: 90px; margin-top: 44px; }
  .back-top { width: 34px; height: 34px; }
}
@media (max-width: 370px) {
  .site-label { display: none; }
  .header-nav { gap: 25px; }
  .filters { gap: 21px; }
  .footer-bar { gap: 12px; }
  .footer-bar > span { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .marquee-track { animation: none; }
  .hero-photo, .hero-photo::before { transform: none; }
  .project:hover, .project:hover .project-arrow { transform: none; }
}
