/* Tokens */
:root {
  color-scheme: light;
  --paper: #f7f7f3;
  --surface: #ffffff;
  --ink: #171a18;
  --muted: #59605d;
  --accent: #9f3f2b;
  --soft: #e9e9e4;
  --line: #cfd2cd;
  --font-voice: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  --font-ui: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;
  --space-7: 7.5rem;
  --space-8: 11rem;
  --content-width: 84rem;
  --reading-width: 40rem;
  --gutter: clamp(1.25rem, 4.5vw, 4.75rem);
}

/* Base */
* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body {
  margin: 0;
  overflow-wrap: break-word;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.9;
  line-break: strict;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 650; }
h1 { font-family: var(--font-voice); }
h3 { font-size: clamp(1.35rem, 2.1vw, 2rem); line-height: 1.45; letter-spacing: -0.025em; }
a { color: inherit; text-underline-offset: 0.32em; }
a:hover { text-decoration-thickness: 1px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
::selection { color: var(--surface); background: var(--ink); }

/* Layout */
.container { width: min(100% - var(--gutter) * 2, var(--content-width)); margin-inline: auto; }
.section { padding-block: clamp(5.5rem, 11vw, var(--space-8)); }
.section-heading { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: end; margin-bottom: clamp(3.75rem, 7vw, var(--space-7)); }
.section-intro { max-width: 22rem; color: var(--muted); margin-top: var(--space-2); }
.works-grid > *, .services-grid > *, .about-layout > *, .closing-grid > * { min-width: 0; }

/* Shared UI */
.site-name, .site-nav, .eyebrow, .section-label, .button, .text-link, .asset-label, .project-index, .project-next, .service-index, .process-number, .channel-name, .channel-action, .contact-link, .hero-footnote { font-family: var(--font-ui); }
.eyebrow { color: var(--accent); font-size: 0.875rem; font-weight: 650; letter-spacing: 0.16em; line-height: 1.5; margin-bottom: var(--space-2); }
.section-label { color: var(--accent); font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 650; letter-spacing: 0.16em; line-height: 1.35; }
.small-note { max-width: var(--reading-width); color: var(--muted); font-size: 0.875rem; line-height: 1.75; }
.keep-together { white-space: nowrap; }
.button { display: inline-flex; justify-content: space-between; align-items: center; gap: var(--space-5); min-height: 3.5rem; padding: 0.75rem 0; border-bottom: 1px solid currentColor; font-weight: 650; text-decoration: none; }
.button:hover { color: var(--accent); }
.text-link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2.75rem; padding-block: 0.5rem; font-size: 0.9375rem; }
.skip-link { position: absolute; z-index: 3; top: 0.5rem; left: var(--gutter); transform: translateY(-200%); background: var(--surface); padding: 0.75rem 1rem; }
.skip-link:focus { transform: translateY(0); }

/* Header and hero */
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem var(--space-4); padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
.site-name { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.875rem; font-weight: 650; letter-spacing: 0.16em; line-height: 1; text-decoration: none; }
.site-name-dot { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem var(--space-3); }
.site-nav a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; font-size: 0.875rem; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.nav-contact { font-weight: 650; }
.hero { display: flex; min-height: calc(100svh - 5.6rem); flex-direction: column; justify-content: space-between; padding-block: clamp(3.25rem, 7vw, 6.5rem) var(--space-4); }
.hero > .eyebrow { margin-bottom: clamp(2.5rem, 7vw, 5rem); }
.hero h1 { font-size: clamp(3.15rem, 7vw, 6.5rem); font-weight: 600; line-height: 1.18; letter-spacing: -0.055em; }
.hero-line { display: block; white-space: nowrap; }
.hero-line > span { display: inline; }
.hero-description { max-width: 33rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.9; margin-top: clamp(2.75rem, 6vw, 5.5rem); }
.desktop-break { display: none; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); }
.hero-footnote { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-3); margin-top: clamp(3rem, 7vw, 6rem); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }
.hero-footnote > span { letter-spacing: 0.06em; }

/* Works catalog */
.works-section { background: var(--surface); border-top: 1px solid var(--line); }
.works-heading { margin-bottom: clamp(3rem, 6vw, var(--space-6)); }
.works-grid { display: grid; gap: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.work { min-width: 0; }
.work-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-3); height: 100%; padding-top: var(--space-3); border-top: 1px solid var(--ink); text-decoration: none; }
.work-card-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2); min-height: 5rem; align-items: start; }
.project-index { color: var(--accent); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.14em; white-space: nowrap; }
.work-card-heading h3 { font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 650; line-height: 1.2; }
.work-kind { margin-top: 0.35rem; color: var(--muted); font-size: 0.875rem; }
.work-thumbnail { aspect-ratio: 4 / 3; margin: 0; overflow: hidden; background: var(--soft); }
.work-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.work-thumbnail--ebay img { object-position: 50% 8%; }
.work-thumbnail--converter img { object-position: 50% 5%; }
.work-card-copy { max-width: 28rem; color: var(--muted); font-size: 0.9375rem; line-height: 1.75; }
.work-card-action { display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem; padding-top: var(--space-1); border-top: 1px solid var(--line); color: var(--muted); font-family: var(--font-ui); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.1em; }
.work-card:hover .work-card-action { color: var(--accent); }

/* Project detail pages */
.project-page h1 { font-family: var(--font-body); }
.project-hero { padding-block: clamp(3rem, 7vw, 6rem) clamp(5rem, 10vw, 9rem); }
.back-link { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 2.75rem; font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.08em; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.project-kicker { margin-top: clamp(3rem, 8vw, 6rem); color: var(--accent); font-family: var(--font-ui); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.14em; }
.project-hero h1 { margin-top: var(--space-2); font-size: clamp(3rem, 8vw, 7.5rem); font-weight: 650; line-height: 1.05; letter-spacing: -0.065em; }
.project-lead { margin-top: clamp(2rem, 5vw, 4rem); font-size: clamp(1.65rem, 4vw, 3.75rem); font-weight: 650; line-height: 1.4; letter-spacing: -0.045em; }
.project-status { margin-top: var(--space-3); color: var(--muted); }
.project-visual { margin: clamp(3rem, 7vw, 6rem) 0 0; padding: clamp(0.75rem, 2.5vw, 2rem); background: var(--soft); }
.project-visual img { width: 100%; box-shadow: 0 1rem 3rem rgba(23, 26, 24, 0.12); }
.project-visual figcaption { max-width: 48rem; margin-top: var(--space-2); color: var(--muted); font-size: 0.8125rem; line-height: 1.7; }
.project-nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); padding-block: var(--space-2); border-block: 1px solid var(--line); }
.project-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font-family: var(--font-ui); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.1em; text-decoration: none; }
.project-nav a:hover { color: var(--accent); }
.project-section { scroll-margin-top: 1rem; padding-block: clamp(5.5rem, 11vw, 10rem); }
.project-section--soft { background: var(--soft); }
.project-section--ink { background: var(--ink); color: var(--paper); }
.project-section--ink .section-label { color: #e3a28e; }
.project-section-heading { display: grid; gap: var(--space-3); margin-bottom: clamp(3rem, 7vw, 6rem); }
.project-section-heading > * { min-width: 0; }
.project-section-heading h2 { max-width: 60rem; overflow-wrap: normal; font-size: clamp(2rem, 5vw, 4.8rem); line-height: 1.25; letter-spacing: -0.055em; text-wrap: balance; word-break: auto-phrase; }
.heading-phrase { display: inline-block; white-space: nowrap; }
.project-prose { display: grid; gap: var(--space-3); max-width: 48rem; margin-left: auto; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.125rem); }
.feature-list { list-style: none; display: grid; gap: 0; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.feature-list li { display: grid; grid-template-columns: 2.5rem minmax(0, 0.7fr) minmax(0, 1.3fr); gap: var(--space-2); align-items: start; padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.feature-list li > span { color: var(--accent); font-family: var(--font-ui); font-size: 0.75rem; font-weight: 650; }
.feature-list strong { font-size: 1.1rem; }
.feature-list p { color: var(--muted); font-size: 0.9375rem; }
.decision-grid { display: grid; gap: var(--space-4); }
.decision-grid article { padding-top: var(--space-3); border-top: 1px solid var(--ink); }
.decision-grid h3 { font-size: clamp(1.35rem, 2.5vw, 2rem); }
.decision-grid p { margin-top: var(--space-2); color: var(--muted); }
.growth-list { list-style: none; display: grid; gap: 0; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.growth-list li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.growth-list li > span { color: var(--accent); font-family: var(--font-ui); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.1em; }
.growth-list strong { font-size: clamp(1.2rem, 2vw, 1.6rem); }
.growth-list p { max-width: 44rem; margin-top: 0.35rem; color: var(--muted); }
.improvement-list { display: grid; gap: var(--space-5); }
.improvement-list article { padding-top: var(--space-3); border-top: 1px solid #6d726f; }
.improvement-before { color: #e3a28e; font-family: var(--font-ui); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.12em; }
.improvement-list h3 { margin-top: var(--space-1); font-size: clamp(1.35rem, 2.5vw, 2rem); }
.improvement-list article > p:last-child { margin-top: var(--space-2); color: #c7cbc8; }
.spec-list { border-top: 1px solid var(--ink); }
.spec-list > div { display: grid; grid-template-columns: minmax(6rem, 0.4fr) minmax(0, 1.6fr); gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--accent); font-family: var(--font-ui); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.1em; }
.spec-list dd { color: var(--muted); }
.project-cta { padding-block: clamp(5rem, 10vw, 9rem); background: var(--ink); color: var(--paper); }
.project-cta-inner { display: grid; gap: var(--space-5); align-items: end; }
.project-cta .section-label { color: #e3a28e; }
.project-cta h2 { margin-top: var(--space-2); font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1.2; letter-spacing: -0.05em; }
.project-cta p:not(.section-label) { max-width: 38rem; margin-top: var(--space-2); color: #c7cbc8; }
.project-external { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 4rem; padding-block: var(--space-2); border-block: 1px solid #6d726f; font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.1em; text-decoration: none; }
.project-external:hover { color: #e3a28e; }
.project-disclaimer { padding-block: var(--space-3); color: var(--muted); font-size: 0.8125rem; }

/* Services and about */
.services-heading { margin-bottom: clamp(3.5rem, 7vw, var(--space-7)); }
.services-grid { display: grid; border-top: 1px solid var(--ink); }
.service { display: grid; gap: var(--space-2); padding-block: var(--space-4); border-bottom: 1px solid var(--line); }
.service-index { color: var(--accent); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.1em; }
.service h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); }
.service p { max-width: 24rem; color: var(--muted); }
.about-section { padding-block: clamp(7.5rem, 14vw, 13rem); background: var(--soft); }
.about-layout { display: grid; gap: var(--space-5); }
.about-copy { max-width: var(--reading-width); }
.statement { font-size: clamp(1.9rem, 5.2vw, 4.8rem); font-weight: 650; line-height: 1.35; letter-spacing: -0.05em; }
.statement span { display: block; white-space: nowrap; }
.about-copy > p + p { margin-top: var(--space-4); }
.about-copy > .small-note { margin-top: var(--space-5); padding-top: var(--space-2); border-top: 1px solid var(--line); }

/* Process: words and space show the flow */
.approach-heading { display: grid; gap: var(--space-4); margin-bottom: clamp(4rem, 9vw, 8rem); }
.approach-message { font-size: clamp(2rem, 4.6vw, 4.5rem); font-weight: 650; line-height: 1.35; letter-spacing: -0.05em; }
.approach-message span { display: block; white-space: nowrap; }
.process { list-style: none; display: grid; gap: var(--space-3); padding: 0; margin: 0; }
.process li { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.process-number { color: var(--accent); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.1em; }
.process-word { font-size: clamp(1.8rem, 3.4vw, 3rem); font-weight: 600; letter-spacing: -0.035em; }
.process-arrow { margin-left: auto; color: var(--muted); font-size: 1.25rem; font-weight: 400; transform: rotate(90deg); }

/* Closing navigation */
.closing-section { background: var(--ink); color: var(--paper); }
.closing-grid { display: grid; }
.closing-panel { padding-block: clamp(5.5rem, 10vw, 9rem); }
.closing-section .section-label { color: #e3a28e; }
.closing-intro { max-width: 24rem; margin-top: var(--space-3); color: #c7cbc8; }
.channel-list { margin-top: clamp(3rem, 7vw, 5rem); }
.channel { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; min-height: 5rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.channel:first-child { border-top: 1px solid #6d726f; }
.closing-section .channel { border-bottom-color: #6d726f; }
.channel-name { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 560; }
.channel-action { color: #c7cbc8; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.1em; }
.channel:hover .channel-name, .channel:hover .channel-action { color: #e3a28e; }
.closing-section a:focus-visible { outline-color: #e3a28e; }

/* Contact and footer */
.contact-message { margin-top: clamp(2.5rem, 6vw, 4.5rem); font-size: clamp(2rem, 4.2vw, 4rem); font-weight: 650; line-height: 1.3; letter-spacing: -0.055em; }
.contact-message span { display: block; white-space: nowrap; }
.contact-intro { margin-top: var(--space-4); color: #c7cbc8; }
.contact-action { display: grid; gap: var(--space-2); margin-top: clamp(3rem, 7vw, 5rem); }
.contact-link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 5rem; border-block: 1px solid #6d726f; font-weight: 650; text-decoration: none; }
.contact-link-action { color: #c7cbc8; font-size: 0.75rem; letter-spacing: 0.1em; }
.contact-link:hover, .contact-link:hover .contact-link-action { color: #e3a28e; }
.contact-action > p { color: #c7cbc8; font-size: 0.875rem; }
.site-footer { border-top: 1px solid #424744; background: var(--ink); color: var(--paper); font-size: 0.8125rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding-block: var(--space-4); }

/* Responsive: each width is composed independently */
@media (min-width: 48rem) {
  .desktop-break { display: inline; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service { min-height: 16rem; align-content: space-between; padding: var(--space-4); border-right: 1px solid var(--line); }
  .service:first-child { padding-left: 0; }
  .service:last-child { padding-right: 0; border-right: 0; }
  .about-layout { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr); gap: clamp(4rem, 10vw, 10rem); }
  .decision-grid, .improvement-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .site-header { flex-wrap: nowrap; }
  .site-nav { gap: var(--space-4); }
  .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-section-heading { grid-template-columns: minmax(8rem, 0.3fr) minmax(0, 1.7fr); gap: clamp(2rem, 5vw, 5rem); }
  .decision-grid, .improvement-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-cta-inner { grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.6fr); }
  .approach-heading { grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr); gap: clamp(4rem, 10vw, 10rem); }
  .process { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .process li { gap: var(--space-2); }
  .process-arrow { transform: none; }
  .closing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-panel { padding-right: clamp(3rem, 6vw, 6rem); }
  .contact-panel { padding-left: clamp(3rem, 6vw, 6rem); border-left: 1px solid #424744; }
}

@media (max-width: 35rem) {
  .site-header { align-items: flex-start; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0.5rem; }
  .site-nav a { font-size: 0.8125rem; }
  .hero { min-height: auto; padding-top: 4rem; }
  .hero h1 { font-size: clamp(2.1rem, 10.5vw, 3.2rem); line-height: 1.24; }
  .hero-line > span { display: block; }
  .approach-message { font-size: clamp(1.65rem, 8.5vw, 2.4rem); }
  .contact-message { font-size: clamp(1.8rem, 8.8vw, 2.5rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .hero-footnote > span { display: none; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .work-card-heading { display: block; min-height: 0; }
  .work-card-heading .project-index { margin-bottom: 0.75rem; }
  .project-hero h1 { font-size: clamp(2.4rem, 13vw, 3rem); word-break: keep-all; }
  .project-lead br { display: none; }
  .feature-list li { grid-template-columns: 2rem minmax(0, 1fr); }
  .feature-list li p { grid-column: 2; }
  .spec-list > div { grid-template-columns: 1fr; gap: 0.35rem; }
}
