/* Warm Editorial — homepage only. The product pages retain their own stylesheet. */
:root {
  color-scheme: light;
  --paper: #eee8dc;
  --ink: #252820;
  --forest: #303b36;
  --rust: #9b5844;
  --taupe: #cfc6b7;
  --muted: #66685d;
  --rule: rgba(37, 40, 32, 0.23);
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --anchor-clearance: 24px;
}
* { box-sizing: border-box; }
html { overflow-y: auto; scroll-behavior: smooth; scroll-padding-top: var(--anchor-clearance); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
::selection { color: var(--paper); background: var(--rust); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--rust); outline-offset: 6px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; }
img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1280px, calc(100% - 112px)); margin-inline: auto; }
.eyebrow { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase; }
.skip-link { position: absolute; z-index: 20; top: 12px; left: 12px; padding: 10px 20px; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.masthead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 48px; align-items: center; padding-block: 25px; border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font: 500 2rem/1 var(--serif); letter-spacing: -0.05em; }
.brand-logo { width: 32px; height: 32px; flex-shrink: 0; }
.brand-name { white-space: nowrap; }
.brand-name > span, .footer-wordmark span { color: var(--rust); }
.main-nav { display: flex; gap: 32px; font-size: 0.8rem; }
.main-nav a, .social-links a, .footer-baseline a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: color 180ms ease, text-decoration-color 180ms ease; }
.main-nav a:hover, .social-links a:hover, .footer-baseline a:hover { color: var(--rust); text-decoration-color: currentColor; }
.language-switcher { display: flex; gap: 9px; justify-self: end; align-items: center; font-size: 0.68rem; }
.language-switcher > span { opacity: 0.35; }
.language-switcher button { color: var(--muted); background: none; border: 0; padding: 10px 2px; cursor: pointer; }
.language-switcher button.is-active { color: var(--rust); text-decoration: underline; text-underline-offset: 5px; }
.language-switcher button:hover { color: var(--rust); }
.localized-copy { opacity: 1; transition: opacity 180ms ease-out; }
.is-changing-language .localized-copy { opacity: 0; transition-duration: 120ms; }
.editorial-hero {
  /* The masthead stays in normal flow and is counted only once in the first screen. */
  min-height: calc(100vh - var(--masthead-height, 0px));
  min-height: calc(100svh - var(--masthead-height, 0px));
  display: flex;
  flex-direction: column;
  padding-top: 50px;
  padding-bottom: 74px;
}
.hero-topline { display: flex; gap: 24px; justify-content: space-between; color: var(--muted); }
.editorial-hero h1 { margin-block: auto; padding-block: 68px 42px; font-family: var(--serif); font-size: clamp(3.4rem, 7.9vw, 8rem); line-height: 1.04; letter-spacing: -0.055em; }
/* Keep each translated title line intact; sizes below account for the stagger. */
.editorial-hero h1 > span, .editorial-hero h1 > em { white-space: nowrap; }
.editorial-hero h1 > span { display: block; }
.editorial-hero h1 > em { display: block; margin-left: 16%; color: var(--rust); font-weight: 400; }
.hero-bottom { display: grid; grid-template-columns: 1fr 0.8fr; gap: 48px; align-items: end; }
.hero-bottom > p { max-width: 440px; font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.7; }
.explore-link { display: flex; align-items: center; gap: 17px; width: fit-content; font-size: 0.72rem; }
.circle-arrow { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 50%; font-size: 1.45rem; transition: background 220ms ease, color 220ms ease, transform 220ms ease; }
.explore-link:hover .circle-arrow { background: var(--ink); color: var(--paper); transform: rotate(45deg); }
.chapter { position: relative; padding-block: 70px 100px; }
.legacy-anchor { display: block; position: absolute; top: 0; }
/* Mio's background starts at its anchor: cancel only the root's anchor clearance.
   The masthead is in normal flow, so no navigation offset is needed here. */
.editorial-page .mio-chapter,
.editorial-page .mio-chapter > #work { scroll-margin-top: calc(-1 * var(--anchor-clearance)); }
.text-link { display: inline-flex; align-items: center; gap: 28px; width: fit-content; padding-block: 6px; border-bottom: 1px solid currentColor; color: var(--ink); font-size: 0.8rem; transition: color 200ms ease, gap 200ms ease; }
.text-link:hover { color: var(--rust); gap: 35px; }
.mio-chapter { position: relative; display: grid; align-items: center; min-height: 100vh; min-height: 100svh; background: var(--forest); color: var(--paper); padding-block: 90px; }
.mio-grid { display: grid; grid-template-columns: 1fr 0.8fr; gap: 100px; align-items: center; }
.mio-copy .eyebrow { color: #c8c9bb; }
.mio-copy h2 { display: flex; align-items: center; gap: 65px; margin-top: 42px; font-family: var(--serif); font-size: clamp(7rem, 14vw, 12.5rem); line-height: 0.95; letter-spacing: -0.06em; }
.mio-star { color: #c3b19b; font-family: Georgia, serif; font-size: 0.3em; }
.mio-tagline { margin-top: 30px; font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.35rem); line-height: 1.2; white-space: pre-line; }
.mio-description { margin-top: 25px; max-width: 350px; color: #d0d1c6; font-size: 0.9rem; }
.mio-copy .text-link { margin-top: 30px; color: var(--paper); border-color: #8b9589; }
.mio-copy .text-link:hover { color: #e4baa3; }
.mio-chapter a:focus-visible { outline-color: var(--paper); }
.mio-visual { width: 100%; max-width: 435px; justify-self: end; }
.mio-image-frame { position: relative; transition: transform 700ms ease; }
.mio-visual img { width: 100%; height: auto; }
/* Blend only the expression; keep the original silhouette and translucent edges. */
.mio-visual .mio-smile {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 29% 20% at 54% 33%, #000 65%, transparent 100%);
  mask-image: radial-gradient(ellipse 29% 20% at 54% 33%, #000 65%, transparent 100%);
  transition: opacity 400ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .mio-visual:hover .mio-image-frame { transform: translateY(-4px) scale(1.025); }
  .mio-visual:hover .mio-smile { opacity: 1; transition-duration: 600ms; transition-delay: 80ms; }
}
.mio-visual figcaption { display: flex; justify-content: space-between; padding-top: 14px; color: #c8c9bb; font-size: 0.68rem; }
.selected-work { padding-top: 100px; }
.selected-heading { display: grid; grid-template-columns: 1fr 0.7fr; gap: 90px; align-items: end; margin-bottom: 50px; }
.selected-heading .eyebrow, .about-grid .eyebrow { color: var(--rust); margin-bottom: 26px; }
.selected-heading h2, .about-grid h2 { white-space: pre-line; font-family: var(--serif); font-size: clamp(2.8rem, 4.5vw, 4.25rem); line-height: 1.05; letter-spacing: -0.035em; }
.selected-heading > p { max-width: 290px; justify-self: end; color: var(--muted); font-size: 0.9rem; }
.work-entry { padding-block: 36px; border-top: 1px solid var(--rule); }
.work-entry-content { display: grid; grid-template-columns: 48px minmax(0, 1fr) 160px minmax(0, 1fr); gap: 24px; align-items: start; }
.work-entry:last-child { border-bottom: 1px solid var(--rule); }
.work-number { color: var(--rust); font-size: 0.7rem; }
.work-entry h3 { font-family: var(--serif); font-size: 2.25rem; line-height: 1.15; letter-spacing: -0.025em; }
.work-category { color: var(--muted); font-size: 0.75rem; }
.work-description { color: #505348; font-size: 0.92rem; }
.work-entry-content > * { min-width: 0; }
/* Small sans-serif columns share a fixed optical inset, independent of row height. */
.work-number, .work-category { padding-top: 0.2rem; }
.work-description { padding-top: 0.1rem; }
.work-title-link { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 6px; transition: color 180ms ease, text-decoration-color 180ms ease; }
.work-title-link > span { display: inline-block; font-family: var(--sans); font-size: 0.55em; transition: transform 180ms ease; }
.work-title-link:hover, .work-title-link:focus-visible { color: var(--rust); text-decoration-color: currentColor; }
.work-title-link:hover > span { transform: translate(2px, -2px); }
.work-availability { display: block; margin-top: 8px; font-size: 0.65rem; font-style: italic; }
/* Anchor the serif capitals to a fixed inset, retaining the line-height footprint.
   Neither wrapped descriptions nor availability labels can move the title. */
@supports (text-box-trim: trim-both) and (text-box-edge: cap alphabetic) {
  .work-entry h3 {
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
    min-block-size: 1lh;
    padding-top: 0.2em;
  }
}
.about-chapter { background: #e4ddcf; padding-block: 86px; }
.about-grid { display: grid; grid-template-columns: 1fr 0.9fr; gap: 60px 100px; align-items: start; }
/* Note subsets cover the four paragraphs; see asset/fonts/about-note/subsets.json. */
@font-face {
  font-family: "Noto Serif SC Note";
  src: url('/asset/fonts/about-note/noto-serif-sc-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif JP Note";
  src: url('/asset/fonts/about-note/noto-serif-jp-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
.about-copy {
  position: relative;
  isolation: isolate;
  margin-top: 14px;
  padding: 30px 34px;
  font-family: Newsreader, Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: normal;
  text-align: left;
  color: #3d3933;
  --paper-edge: polygon(2px 3px, 8% 1px, 19% 2px, 33% 0, 46% 2px,
    61% 1px, 78% 3px, 91% 1px, calc(100% - 2px) 2px,
    100% 18%, calc(100% - 1px) 36%, 100% 53%, calc(100% - 2px) 72%,
    calc(100% - 1px) calc(100% - 3px), 88% calc(100% - 1px),
    74% calc(100% - 2px), 59% 100%, 43% calc(100% - 2px),
    26% calc(100% - 1px), 12% 100%, 1px calc(100% - 2px),
    2px 82%, 0 63%, 2px 44%, 1px 25%);
}
html:lang(zh) .about-copy { font-family: "Noto Serif SC Note", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif; }
html:lang(ja) .about-copy { font-family: "Noto Serif JP Note", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif; }
/* Level paper layers with a faint contact shadow; the scroll animation stays intact. */
.about-copy::before, .about-copy::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: var(--paper-edge);
}
.about-copy::before {
  z-index: -2;
  background: rgba(63, 53, 35, 0.045);
  transform: translateY(1px);
  filter: blur(1px);
}
.about-copy::after {
  z-index: -1;
  background: #f3eee4 url('/asset/textures/note-paper.svg') repeat;
  background-size: 420px 420px;
}
.about-copy p + p { margin-top: 18px; }
/* Medium trial: retain the Regular faces and base rule above for comparison. */
@font-face {
  font-family: "Noto Serif SC Note";
  src: url('/asset/fonts/about-note/noto-serif-sc-medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif JP Note";
  src: url('/asset/fonts/about-note/noto-serif-jp-medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
.about-copy { font-weight: 500; font-synthesis: none; }
.contact-intro { position: relative; padding-top: 26px; border-top: 1px solid var(--rule); }
.contact-intro h3 { font-family: var(--serif); font-size: 1.8rem; white-space: pre-line; line-height: 1.3; }
.contact-intro h3 > span { display: block; }
.contact-intro h3 > span + span { color: var(--rust); }
.contact-links { padding-top: 26px; border-top: 1px solid var(--rule); }
.contact-invitation { margin-bottom: 22px; }
.contact-email { color: var(--rust); font-size: 1rem; }
.social-links { display: flex; gap: 30px; margin-top: 25px; font-size: 0.75rem; }
.social-links span { margin-left: 6px; }
.social-links a.contact-github { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 0.875rem; text-decoration: none; }
.contact-github svg { flex-shrink: 0; }
.social-links .contact-github > span { margin-left: 0; }
.editorial-footer { padding-top: 48px; padding-bottom: 30px; }
.footer-wordmark { display: block; width: fit-content; font-family: var(--serif); font-size: clamp(5rem, 18vw, 17.5rem); line-height: 1.05; letter-spacing: -0.065em; }
.footer-baseline { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px 25px; margin-top: 35px; padding-top: 22px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.65rem; }
html:lang(zh), html:lang(ja) { --serif: "Songti SC", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif; --sans: Inter, "Hiragino Sans", "PingFang SC", "Yu Gothic", system-ui, sans-serif; }
html:lang(ja) { --serif: "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", "Noto Serif CJK JP", serif; }
html:lang(zh) .brand, html:lang(ja) .brand,
html:lang(zh) .footer-wordmark, html:lang(ja) .footer-wordmark,
html:lang(zh) .mio-copy h2, html:lang(ja) .mio-copy h2,
html:lang(zh) .work-entry h3, html:lang(ja) .work-entry h3 { font-family: Newsreader, Georgia, serif; }
html:lang(zh) .editorial-hero h1, html:lang(ja) .editorial-hero h1 { font-size: clamp(3.4rem, 7.6vw, 7rem); line-height: 1.35; letter-spacing: -0.04em; }
html:lang(ja) .editorial-hero h1 { font-size: clamp(3rem, 6.8vw, 6.5rem); }
html:lang(zh) .editorial-hero h1 em, html:lang(ja) .editorial-hero h1 em { font-style: normal; }
html:lang(zh) .selected-heading h2, html:lang(ja) .selected-heading h2,
html:lang(zh) .about-grid h2, html:lang(ja) .about-grid h2 { font-size: clamp(2rem, 3.5vw, 3.3rem); line-height: 1.4; }
html:lang(zh) .mio-tagline, html:lang(ja) .mio-tagline { line-height: 1.5; }
@media (min-width: 761px) {
  /* Fit the 2:3 portrait, section padding and caption within a desktop viewport.
     Short windows can grow with the content instead of clipping it. */
  .mio-visual { max-width: min(435px, max(220px, calc((100svh - 180px - 2.25rem) * 2 / 3))); }
}
@media (max-width: 1050px) {
  html:lang(en) .selected-heading h2 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
  .wrap { width: calc(100% - 64px); }
  .masthead { gap: 25px; }
  .mio-grid { gap: 64px; }
  .mio-copy h2 { gap: 35px; }
  .work-entry-content { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: min-content 1fr; gap: 12px 20px; }
  .work-number { grid-row: 1; }
  .work-entry h3 { grid-column: 2; grid-row: 1; }
  .work-category { grid-column: 2; grid-row: 2; padding-top: 0; }
  .work-description { grid-column: 3; grid-row: 1 / 3; }
  .about-grid { gap: 50px; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 40px); }
  .masthead { grid-template-columns: 1fr auto; gap: 14px; padding-block: 20px; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; gap: 28px; padding-top: 4px; }
  .language-switcher { grid-column: 2; grid-row: 1; }
  .hero-topline { font-size: 0.58rem; }
  .hero-topline > p:first-child { max-width: 230px; }
  .hero-topline > p:last-child { flex-shrink: 0; }
  .editorial-hero { padding-top: 32px; padding-bottom: 50px; }
  .editorial-hero h1 { padding-block: 50px 30px; font-size: clamp(1.5rem, 8vw, 3.8rem); }
  .editorial-hero h1 > em { margin-left: 8%; }
  .hero-bottom { grid-template-columns: 1fr; gap: 30px; }
  .hero-bottom > p { grid-row: 1; margin-left: 20%; font-size: 0.95rem; max-width: 370px; }
  .circle-arrow { width: 42px; height: 42px; }
  .chapter { padding-block: 45px 60px; }
  .mio-chapter { padding-block: 54px; }
  .mio-grid { grid-template-columns: 1fr 0.7fr; gap: 28px; align-items: start; }
  .mio-copy h2 { font-size: 6.5rem; margin-top: 24px; gap: 20px; }
  .mio-tagline { font-size: 1.5rem; }
  .mio-description { font-size: 0.85rem; }
  .mio-visual { padding-top: 58px; }
  .selected-heading { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
  .selected-heading > p { justify-self: start; max-width: 360px; }
  .selected-heading h2, .about-grid h2 { font-size: 2.7rem; }
  html:lang(en) .selected-heading h2 { font-size: clamp(1.7rem, 9vw, 2.7rem); }
  .work-entry h3 { font-size: 1.9rem; }
  .about-chapter { padding-block: 54px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-copy { margin-top: 0; padding: 24px; font-size: 16px; }
  .contact-intro { margin-top: 14px; }
  .contact-links { padding-top: 0; border-top: 0; }
  .footer-baseline { margin-top: 24px; }
  html:lang(zh) .editorial-hero h1 { font-size: clamp(1.5rem, 8.6vw, 4.2rem); }
  html:lang(ja) .editorial-hero h1 { font-size: clamp(1.4rem, 7.8vw, 3.7rem); }
}
@media (max-width: 520px) {
  .hero-topline { flex-direction: column; gap: 6px; }
  .hero-topline > p:first-child { max-width: none; }
  .hero-bottom > p { margin-left: 12%; }
  .mio-grid { grid-template-columns: 1fr; }
  .mio-copy h2 { font-size: 8rem; justify-content: space-between; }
  .mio-visual { max-width: 300px; margin-top: 12px; padding-top: 0; justify-self: end; width: 82%; }
  .work-entry { padding-block: 30px; }
  .work-entry-content { grid-template-columns: 25px minmax(0, 1fr); grid-template-rows: min-content min-content auto; gap: 10px 15px; }
  .work-description { grid-column: 2; grid-row: 3; padding-top: 0; }
  .work-category { grid-row: 2; }
  .work-entry h3 { font-size: 2rem; }
  .footer-baseline { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  /* Progressive enhancement: without view timelines, all content stays visible.
     Each content group follows its own position, including on upward scrolling.
     Sections and their backgrounds remain in the normal document flow. */
  @supports (animation-timeline: view()) and (animation-range: cover 0% cover 100%) and (view-timeline-name: --editorial-group) {
    :where(.editorial-hero h1, .hero-bottom, .mio-copy, .mio-visual,
           .selected-heading, .about-grid > div:not(.contact-intro, .contact-links),
           .work-entry-content, .contact-intro > h3, .contact-links > *) {
      animation: editorial-reveal auto linear both;
      animation-timeline: view(block);
      animation-range: cover 0% cover 100%;
    }

    /* Hero is already on screen at load; only its departure needs a fade.
       Scrolling back up restores it along the same timeline. */
    :where(.editorial-hero h1, .hero-bottom) {
      animation-name: editorial-hero-reveal;
    }

    /* Keep rule-bearing containers static; animate each project's content
       as one grid, linked to the outer row's position. */
    :where(.work-entry, .contact-intro, .contact-links) {
      view-timeline-name: --editorial-group;
      view-timeline-axis: block;
    }
    :where(.work-entry-content, .contact-intro > h3, .contact-links > *) {
      animation-timeline: --editorial-group;
    }

    :where(.selected-heading) { animation-name: project-heading-reveal; }
    :where(.work-entry-content) { animation-name: project-row-reveal; }

    /* Keep keyboard-focused content readable even at a viewport edge. */
    :where(.hero-bottom, .mio-copy, .about-copy):focus-within,
    :where(.work-entry, .contact-intro, .contact-links):focus-within > * {
      animation: none;
    }

    @keyframes editorial-reveal {
      0% { opacity: 0; transform: translateY(12px); }
      20%, 75% { opacity: 1; transform: translateY(0); }
      100% { opacity: 0; transform: translateY(-12px); }
    }
    @keyframes editorial-hero-reveal {
      0%, 75% { opacity: 1; transform: translateY(0); }
      100% { opacity: 0; transform: translateY(-12px); }
    }
    @keyframes project-heading-reveal {
      0% { opacity: 0; transform: translateY(24px); }
      20%, 75% { opacity: 1; transform: translateY(0); }
      100% { opacity: 0; transform: translateY(-12px); }
    }
    @keyframes project-row-reveal {
      0% { opacity: 0; transform: translateY(24px); }
      20%, 75% { opacity: 1; transform: translateY(0); }
      100% { opacity: 0; transform: translateY(-24px); }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mio-visual:hover .mio-image-frame, .explore-link:hover .circle-arrow, .work-title-link:hover > span { transform: none; }
}
