/* SPDX-License-Identifier: MIT */
/* Shōwa Night Train palette. Fonts are served from this VPS, not a font service. */
@font-face {
  font-family: "League Spartan";
  src: url("/assets/fonts/league-spartan-black.otf") format("opentype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --sign-vermilion: #E43C22;
  --persimmon-glaze: #D65C17;
  --whisky-amber: #EBA51B;
  --saffron-ticket: #E1C329;
  --bitter-citron: #B2A218;
  --enamel-jade: #00805B;
  --glass-turquoise: #008F91;
  --night-petrol: #005762;
  --poster-cobalt: #214AA7;
  --velvet-violet: #74348F;
  --cabaret-carmine: #C42265;
  --lacquer-wine: #841D43;
  --night: #101211;
  --paper: #F0E9D8;
  --muted: #A9ADA1;
  --line: #42483D;
  --body-font: "Manrope", sans-serif;
  --display-font: "League Spartan", sans-serif;
  --text-body: 1.125rem;
  --text-small: 0.875rem;
  --text-nav: 1rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 40px; }
body { margin: 0; background: var(--night); color: var(--paper); font-family: var(--body-font); font-size: var(--text-body); line-height: 1.7; }
::selection { background: var(--saffron-ticket); color: var(--night); }
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--whisky-amber); }
a:focus-visible { outline: 2px solid var(--saffron-ticket); outline-offset: 7px; }
p, h1, h2, h3, figure { margin: 0; }
h1, h2, h3 { font-weight: 900; }
ol { list-style: none; padding: 0; margin: 0; }
img { display: block; max-width: 100%; height: auto; }
.sheet { width: min(1280px, calc(100% - 112px)); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 10px 16px; background: var(--saffron-ticket); color: var(--night); z-index: 10; }
.skip-link:focus { top: 16px; }
.small-label { font-family: var(--body-font); font-size: var(--text-small); font-weight: 600; letter-spacing: 0.08em; line-height: 1.6; text-transform: uppercase; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 28px; }
.site-address { font-weight: 600; font-size: var(--text-nav); text-decoration: none; }
.study-label { color: var(--muted); font-size: var(--text-small); letter-spacing: 0.03em; }
.study-label span { margin-inline: 8px; color: var(--whisky-amber); }

/* An open, off-center cover: navigation, name, and bio occupy different axes. */
/* Reserve clearance for the rule's upward slope, not just its left endpoint. */
.cover { --cover-bottom-space: 180px; position: relative; min-height: 635px; padding-block: 42px var(--cover-bottom-space); }
.cover-coordinate { position: absolute; top: 65px; left: 0; display: flex; gap: 12px; writing-mode: vertical-rl; transform: rotate(180deg); font-size: var(--text-small); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.wordmark { margin-left: 10%; padding-right: 5%; }
.wordmark h1 { font-family: var(--display-font); font-size: clamp(135px, 26vw, 350px); line-height: 0.9; letter-spacing: -0.065em; white-space: nowrap; }
/* Inline punctuation shares the text baseline; compensate for negative tracking. */
.name-dot { display: inline-block; vertical-align: baseline; width: clamp(18px, 2.6vw, 34px); aspect-ratio: 1; margin-left: calc(14px + 0.065em); background: var(--sign-vermilion); }
.contents { position: absolute; left: 4%; bottom: calc(var(--cover-bottom-space) + 4px); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.contents .small-label { margin-bottom: 8px; color: var(--muted); }
.contents a { display: inline-flex; align-items: baseline; gap: 14px; font-size: var(--text-nav); font-weight: 600; text-decoration: none; }
.contents a span { color: var(--whisky-amber); font-size: var(--text-small); font-weight: 400; }
.contents a:hover { text-decoration: underline; }
.intro { width: min(425px, 46%); margin-top: 28px; margin-left: 49%; }
.intro .small-label { color: var(--whisky-amber); }
.intro-lead { font-size: 27px; line-height: 1.35; letter-spacing: -0.04em; margin-block: 14px 10px; }
.intro-copy { color: var(--muted); font-size: var(--text-body); line-height: 1.85; }
.cover-rule { position: absolute; height: 8px; bottom: 48px; left: 0; width: 96%; transform: rotate(-4deg); transform-origin: left; background: var(--sign-vermilion); }
.cover-rule::after { content: ""; position: absolute; width: 14%; height: 100%; right: 0; background: var(--persimmon-glaze); }
.cover-end { position: absolute; right: 1%; bottom: 53px; font-size: 30px; color: var(--whisky-amber); }

/* Projects are a spread and a counterweight, never matching boxed cards. */
.chapter { position: relative; }
.projects { padding-block: 35px 85px; }
.chapter-heading { display: flex; align-items: baseline; gap: 22px; margin-bottom: 40px; }
.chapter-number { color: var(--muted); font-size: var(--text-small); font-weight: 600; }
.chapter-heading h2 { font-family: var(--display-font); font-size: clamp(72px, 11vw, 145px); letter-spacing: -0.055em; line-height: 1; color: var(--sign-vermilion); }
.chapter-caption { margin-left: auto; align-self: center; padding-right: 12%; color: var(--muted); font-size: var(--text-small); line-height: 1.8; }
.project-feature { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; padding-top: 16px; }
.folio-label { position: absolute; top: 22px; left: 2%; writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-size: var(--text-small); letter-spacing: 0.06em; }
.folio-label span { color: var(--whisky-amber); margin-block: 10px; }
.project-figure { grid-column: 4 / 13; grid-row: 1; align-self: start; }
.project-figure img { width: 100%; }
.project-figure figcaption { margin-top: 12px; text-align: right; font-size: var(--text-small); color: var(--muted); }
.project-feature .project-description { grid-column: 1 / 7; grid-row: 1; z-index: 1; position: relative; transform: translateY(30px); padding: 28px 30px 0 0; background: var(--night); }
.project-description h3 { position: relative; font-family: var(--display-font); font-size: clamp(36px, 5vw, 64px); line-height: 0.98; letter-spacing: -0.035em; }
.project-description h3 > span { display: inline-block; margin-left: 22px; color: var(--whisky-amber); font-family: var(--body-font); font-size: 32px; font-weight: 400; }
.project-description > p:not(.small-label) { max-width: 37ch; margin-top: 17px; color: var(--muted); font-size: var(--text-body); line-height: 1.85; }
.project-text { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.4fr) minmax(0, 0.5fr); align-items: center; gap: 30px; margin-top: 105px; margin-left: 17%; padding-top: 36px; border-top: 1px solid var(--line); }
.project-counter { font-family: var(--display-font); font-size: clamp(100px, 14vw, 175px); line-height: 1; letter-spacing: -0.055em; color: var(--night-petrol); }
.project-text .small-label { margin-bottom: 17px; color: var(--muted); }
.project-text .project-description h3 { font-size: clamp(35px, 4vw, 51px); }
.project-stripes { align-self: stretch; display: flex; justify-content: flex-end; align-items: flex-end; gap: 7px; padding-bottom: 10px; }
.project-stripes span { width: 14px; height: 80%; transform: skewY(-20deg); background: var(--enamel-jade); }
.project-stripes span:nth-child(2) { height: 62%; background: var(--glass-turquoise); }
.project-stripes span:nth-child(3) { height: 45%; background: var(--poster-cobalt); }

/* The chronology steps down the page instead of becoming a résumé table. */
.background { width: 78%; margin-left: 22%; padding-block: 40px 110px; }
.background-heading .small-label { color: var(--whisky-amber); }
.background-heading h2 { font-family: var(--display-font); font-size: clamp(68px, 9vw, 112px); line-height: 0.95; letter-spacing: -0.04em; margin-top: 18px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 54px; margin-top: 45px; }
.timeline::before { content: ""; position: absolute; top: calc(var(--text-small) * 1.7 + 24.5px); left: 7px; width: calc(50% + 23px); height: 1px; background: var(--line); }
.timeline li { position: relative; }
.timeline li:nth-child(2) { margin-top: 76px; }
.timeline li:nth-child(2)::before { content: ""; position: absolute; height: 76px; width: 1px; left: 7px; top: calc(var(--text-small) * 1.7 + 24.5px - 76px); background: var(--line); }
.timeline-period { font-size: var(--text-small); color: var(--muted); margin-bottom: 17px; }
.timeline-point { position: relative; display: block; width: 15px; height: 15px; border-radius: 50%; background: var(--whisky-amber); margin-bottom: 26px; }
.timeline li:nth-child(2) .timeline-point { background: var(--cabaret-carmine); }
.timeline h3 { font-family: var(--display-font); font-size: 37px; line-height: 1; letter-spacing: -0.025em; }
.timeline li > p:not(.timeline-period) { color: var(--muted); font-size: var(--text-body); margin-top: 14px; }
.sample-label { display: inline-block; margin-top: 9px; color: var(--muted); font-size: var(--text-small); }

/* A vertical chapter spine and staggered, open typography for writing. */
.writing { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8%; border-top: 5px solid var(--night-petrol); padding-block: 60px 85px; }
.writing-heading { position: relative; }
.writing-heading .small-label { position: absolute; top: 0; left: 0; white-space: nowrap; color: var(--muted); }
.writing-heading h2 { font-family: var(--display-font); font-size: 122px; letter-spacing: -0.045em; line-height: 1; writing-mode: vertical-rl; transform: rotate(180deg); margin-top: 54px; color: var(--whisky-amber); }
.writing-list { max-width: 790px; padding-top: 40px; }
.writing-list li { max-width: 500px; }
.writing-list li + li { margin-top: 65px; margin-left: 20%; padding-top: 30px; border-top: 1px solid var(--line); }
.writing-list .small-label { color: var(--muted); margin-bottom: 19px; }
.writing-list .small-label span { color: var(--whisky-amber); margin-inline: 6px; }
.writing-list h3 { font-family: var(--display-font); font-size: clamp(48px, 6.5vw, 82px); letter-spacing: -0.035em; line-height: 0.96; }
.writing-list li > p:not(.small-label) { max-width: 33ch; color: var(--muted); font-size: var(--text-body); margin-top: 20px; }

.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding-block: 24px 36px; color: var(--muted); font-size: var(--text-small); }
.site-footer a { text-decoration: none; }
.site-footer a span { color: var(--whisky-amber); margin-left: 10px; }
.palette-strip { width: 150px; height: 5px; background: linear-gradient(to right, var(--sign-vermilion) 0% 8.333%, var(--persimmon-glaze) 8.333% 16.666%, var(--whisky-amber) 16.666% 25%, var(--saffron-ticket) 25% 33.333%, var(--bitter-citron) 33.333% 41.666%, var(--enamel-jade) 41.666% 50%, var(--glass-turquoise) 50% 58.333%, var(--night-petrol) 58.333% 66.666%, var(--poster-cobalt) 66.666% 75%, var(--velvet-violet) 75% 83.333%, var(--cabaret-carmine) 83.333% 91.666%, var(--lacquer-wine) 91.666% 100%); }
.error-page { width: min(960px, calc(100% - 64px)); margin-inline: auto; padding-block: 100px; }
.error-page .small-label { color: var(--whisky-amber); }
.error-page h1 { font-family: var(--display-font); font-size: clamp(45px, 8vw, 100px); line-height: 1; letter-spacing: -0.04em; margin-block: 32px; }
.error-page a { color: var(--whisky-amber); }

@media (max-width: 1000px) {
  .sheet { width: calc(100% - 72px); }
  .cover { min-height: 560px; }
  .wordmark { margin-left: 7%; }
  .wordmark h1 { font-size: 28vw; }
  .intro { margin-top: 46px; }
  .chapter-caption { padding-right: 0; }
  .project-text { margin-left: 10%; gap: 22px; }
  .project-stripes span { width: 10px; }
  .background { width: 84%; margin-left: 16%; }
  .writing { grid-template-columns: 100px minmax(0, 1fr); gap: 7%; }
  .writing-heading h2 { font-size: 100px; }
}
@media (max-width: 700px) {
  .sheet { width: calc(100% - 40px); }
  .site-header { align-items: flex-start; padding-block: 23px; }
  .study-label { max-width: 190px; text-align: right; }
  .cover { --cover-bottom-space: 124px; min-height: 0; padding-block: 34px var(--cover-bottom-space); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 28px 22px; }
  .cover-coordinate { display: none; }
  .wordmark { grid-column: 1 / -1; margin-left: 0; padding-right: 0; }
  .wordmark h1 { font-size: 35vw; }
  .name-dot { width: 18px; margin-left: calc(10px + 0.065em); }
  .contents { position: static; align-self: start; gap: 8px; padding-top: 4px; }
  .contents a { gap: 10px; min-height: 44px; padding-block: 5px; }
  .intro { width: auto; margin: 0; }
  .intro-lead { font-size: 23px; }
  .cover-rule { bottom: 37px; height: 5px; width: 91%; transform: rotate(-3deg); }
  .cover-end { bottom: 32px; font-size: 24px; }
  .projects { padding-block: 22px 48px; }
  .chapter-heading { flex-wrap: wrap; gap: 12px; margin-bottom: 25px; }
  .chapter-heading h2 { font-size: 17vw; }
  .chapter-caption { margin-left: 30px; flex-basis: 100%; }
  .chapter-caption br { display: none; }
  .project-feature { display: block; padding-top: 0; }
  .folio-label { position: static; writing-mode: horizontal-tb; transform: none; margin-bottom: 12px; }
  .folio-label span { margin-inline: 7px; }
  .project-figure { margin-left: 12%; }
  .project-feature .project-description { width: 87%; transform: none; margin-top: 6px; padding: 23px 16px 0 0; }
  .project-description h3 { font-size: 44px; }
  .project-description h3 > span { font-size: 26px; margin-left: 12px; }
  .project-text { grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr); margin-top: 46px; margin-left: 0; padding-top: 26px; gap: 20px; }
  .project-counter { font-size: 22vw; }
  .project-text .project-description h3 { font-size: 35px; }
  .project-stripes { display: none; }
  .background { width: 100%; margin-left: 0; padding-block: 25px 63px; }
  .background-heading h2 { font-size: 70px; }
  .timeline { gap: 26px; margin-top: 35px; }
  .timeline::before { width: calc(50% + 6px); }
  .timeline li:nth-child(2) { margin-top: 55px; }
  .timeline li:nth-child(2)::before { height: 55px; top: calc(var(--text-small) * 1.7 + 24.5px - 55px); }
  .timeline h3 { font-size: 29px; }
  .writing { grid-template-columns: 57px minmax(0, 1fr); gap: 24px; padding-block: 90px 50px; }
  .writing-heading { position: static; }
  .writing-heading .small-label { top: 26px; white-space: normal; }
  .writing-heading h2 { font-size: 65px; margin-top: 0; }
  .writing-list { padding-top: 5px; }
  .writing-list h3 { font-size: 43px; }
  .writing-list li + li { margin-left: 0; margin-top: 35px; padding-top: 24px; }
  .site-footer { flex-wrap: wrap; gap: 18px; }
  .palette-strip { order: 3; width: 100%; height: 3px; }
}
@media (max-width: 520px) {
  .cover { grid-template-columns: minmax(0, 1fr); }
  .contents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
  .contents .small-label { grid-column: 1 / -1; }
  .intro { max-width: 36ch; }
}
@media (max-width: 380px) {
  .sheet { width: calc(100% - 32px); }
  .cover { gap: 24px 14px; }
  .project-text { grid-template-columns: 65px minmax(0, 1fr); gap: 14px; }
  .project-text .project-description h3 { font-size: 30px; }
  .timeline { gap: 18px; }
  .timeline h3 { font-size: 26px; }
  .writing { grid-template-columns: 43px minmax(0, 1fr); gap: 18px; }
  .writing-heading h2 { font-size: 52px; }
  .writing-list h3 { font-size: 37px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  :root { color-scheme: light; --night: white; --paper: #111; --muted: #444; --line: #999; --whisky-amber: #111; --sign-vermilion: #111; }
  body { font-size: 11pt; }
  .sheet { width: 100%; }
  .study-label, .contents, .cover-rule, .cover-coordinate, .cover-end, .name-dot, .project-stripes, .palette-strip, .site-footer a { display: none; }
  .cover { display: block; min-height: 0; padding-block: 10px 30px; }
  .wordmark { margin: 0; }
  .wordmark h1 { font-size: 80pt; }
  .intro { width: 100%; margin: 20px 0 0; }
  .chapter { width: 100%; margin-left: 0; padding-block: 20px; }
  .chapter-heading h2, .background-heading h2 { font-size: 45pt; }
  .project-feature { display: block; }
  .project-figure { width: 55%; margin-left: auto; }
  .project-feature .project-description { transform: none; padding: 20px 0 0; }
  .folio-label { position: static; writing-mode: horizontal-tb; transform: none; margin-bottom: 10px; }
  .project-text { margin: 30px 0 0; }
  .project-counter { font-size: 70pt; }
  .project-description h3 { font-size: 30pt; }
  .writing { display: block; }
  .writing-heading .small-label { position: static; }
  .writing-heading h2 { writing-mode: horizontal-tb; transform: none; font-size: 45pt; margin-top: 10px; }
  .writing-list { padding-top: 25px; }
  .writing-list h3 { font-size: 32pt; }
  .project, .timeline li, .writing-list li { break-inside: avoid; }
}
