@charset "UTF-8";

/* ============================================================
   TAKUMIISOBE.COM — base.css
   Mobile-first global styles, design tokens, reset
   ============================================================ */

/* ------------------------------------------------------------
   Naming convention (TAKUMIISOBE.COM "Stratum Naming")

   - Page / Block        : PascalCase  (main.Office, section.Ethos)
   - Wrapper structure   : lowercase   (.wrapper, .container, .box)
   - Style descendants by parent:
       .Ethos .wrapper .container h1 { ... }
   - State               : .is-active, .has-image
   - Simple role         : .bold, .white, .mute, .center, .sp, .pc
   - Layout              : .l-stack, .l-grid, .flex, .w100
   - Spacing             : .mt-10, .mb-20, .mx-30 ... (px direct)
   - JS hook (no styles) : .js-*

   - Language detection  : <html lang="en"> + :lang(ja) auto
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   1. Font faces
   ------------------------------------------------------------ */

/* Primary Latin face — Andersen / Steiner (in-house face,
   formerly Aether). VF21 variable font (wght 1–950:
   Hair / Book / Ultra masters).

   The family is declared as 'Steiner by AUGUST.tf VF75' — version number
   included on request, so inspectors that read getComputedStyle().fontFamily
   (WhatFont, Fontanello, DevTools' Computed panel) see both the foundry
   credit and the build in one string. Bump the number here (and in the 3
   --font-* variables below) on every export. DevTools' "Rendered Fonts"
   panel reads the font binary's own name table independently — that
   already says "Steiner VF 72" regardless of this name, since build_vf.sh
   sets it at export time. */
@font-face {
  font-family: 'Steiner by AUGUST.tf VF75';
  src: url('/fonts/Steiner-VF75.woff2?v=20260828f') format('woff2');
  font-weight: 1 950;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------
   2. Modern reset
   ------------------------------------------------------------ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* A <video> is laid out at a fractional height (width x videoHeight/videoWidth
   is almost never an integer), but the decoded frame is rasterised to whole
   device pixels — so a 1px sliver of whatever sits BEHIND the element shows
   through along an edge, at some viewport widths and not others. Measured on
   this site: a video box of 414 x 109.4375px, i.e. the exact condition.
   It reads as a thin dark line on a light video, and it is not in the file:
   the video's own edge pixels are clean (checked at the pixel level).
   The element itself painted no background (rgba(0,0,0,0)), so what showed
   was whichever ancestor happened to paint first — white here, but the
   page-transition backdrop (.transition-bg) is BLACK and is exposed while
   .page-wrapper fades during a route change.
   Giving the element its own light background removes that dependency
   entirely. Components that have a first-frame LQIP (see videoFrame() in
   $lib/js/img) additionally inherit it onto the element so the sliver matches
   the video's own artwork rather than merely being light. */
video {
  background-color: var(--color-bg);
}

/* Device-only iOS hairline (rdar://35158514): the AVPlayerLayer that renders
   <video> on iOS generates its own ~1px dark edge around the frame at the
   display-output stage — visible on the physical panel only. It never appears
   in device screenshots (those capture the logical-resolution composite,
   BEFORE the panel resample that creates the line) and never on desktop
   (in-process, integer-scale compositing). No background rule can cover it:
   the black is produced inside the media layer, on top of anything the page
   paints. The only countermeasure is geometric — shave the outer 2px of the
   media layer off. Pages add a ~2% overscan inside an overflow-clipped box on
   top of this (see per-page video rules), so the visible edge always lands on
   artwork pixels. Exported videos keep >=1% background margin (Dev/CLAUDE.md
   §4-0; the two reference clips measure >=6%), so no artwork is ever lost. */
video {
  -webkit-clip-path: inset(2px);
  clip-path: inset(2px);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul,
ol,
ul li,
ol li {
  list-style: none;
  text-decoration: none;
}

a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

::selection {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ------------------------------------------------------------
   3. Design tokens (mobile baseline)
   ------------------------------------------------------------ */

:root {
  /* --- Colors --- */
  --color-bg:        #ffffff;
  --color-text:      #000000;  /* default text — black (was accent blue #004489) */
  --color-text-mute: rgba(0, 0, 0, 0.3);
  --color-bg-dark:   #121212;
  --color-bg-gray:   #f1f1f1;
  --color-bg-charcoal: #2e2e2e;  /* dark-gray page bg (Legal pages) — distinct from bg-dark/near-black */
  --color-accent:    #b33030;
  --color-accent-yellow: #f2edcb;  /* Office text & header */
  --color-accent-blue:   #004489;  /* Office background */
  --color-line:      rgba(0, 0, 0, 0.15);

  /* --- Color aliases (general-purpose) --- */
  --background: var(--color-bg);
  --white:      #ffffff;
  --black:      var(--color-text);
  --key:        var(--color-text);

  /* --- Typography stacks --- */
  --font-en:     'Steiner by AUGUST.tf VF75', 'Helvetica Neue', Arial, sans-serif;
  /* Steiner wght400 (Book) + Ishii Gothic R (TypeSquare) ahead of Tazugane
     (FontPlus). */
  --font-ja:     'Steiner by AUGUST.tf VF75', 'Ishii Gothic R', TazuganeGothicStdN-Book, 'TazuganeGothicStdN-Book','Tazugane Gothic StdN', 'Tazugane Gothic',
                 'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
                 'Yu Gothic', 'Meiryo', sans-serif;
  /* Steiner wght330 + Tazugane Light — lighter JP text */
  --font-ja-light: 'Steiner by AUGUST.tf VF75', TazuganeGothicStdN-Light, 'TazuganeGothicStdN-Light', 'Tazugane Gothic StdN', 'Tazugane Gothic',
                 'Hiragino Sans W3', 'Hiragino Sans',
                 'Yu Gothic', 'Meiryo', sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, sans-serif;

  /* heading-font / text-font are switched by :lang() blocks */
  --heading-font: var(--font-en);
  --text-font:    var(--font-en);

  /* --- Type scale (mobile) --- */
  --fs-h0:   32px;   /* Display larger than h1 if needed */
  --fs-h1:   24px;   /* Archive title */
  --fs-h2:   20px;   /* Major section (interpolated) */
  --fs-h3:   16px;   /* PC section title ("Office", "Ethos:") */
  --fs-h4:   14px;   /* "Colophon" heading */
  --fs-h5:   12px;   /* Numbering "01", labels, nav PC */
  --fs-h6:   10.5px;   /* Body copy / meta / caption — SP (PC: 13.5) */
  --fs-h7:   9px;   /* Smallest — Home Archives card meta on PC (PC: 11.5) */
  --fs-body: var(--fs-h6);
  --fs-p:    11.5px;

  /* Body copy is language-aware (Latin runs larger than JP) */
  --fs-p-en: 13px;   /* Body copy (Latin) — SP */
  --fs-p-ja: 12px;   /* Body copy (JP) — SP */

  /* --- Font weights (single source of truth — no per-component weights) --- */
  --fw-base:   300;   /* default for all text unless emphasized */
  --fw-medium: 400;   /* medium emphasis */
  --fw-bold:   500;   /* bold */
  --fw-lead:   350;   /* exception: large display lead (Radix. For what endures.) */

  /* --- Line heights --- */
  --lh-h0:   1.2;
  --lh-h1:   1.2;
  --lh-h2:   1.3;
  --lh-h3:   1.33;
  --lh-h4:   1.4;
  --lh-h5:   1.4;
  --lh-h6:   1.5;
  --lh-body: 1.5;
  --lh-en:   1.4;   /* Latin body line-height — used by p:lang(en) */
  --lh-ja:   1.8;   /* JP body line-height — used by p:lang(ja) */
  --lh-h-ja: 1.6;   /* JP heading/lead line-height — tighter than body JA (1.8), looser than the h1–h6 tiers (tuned for Latin) */
  --lh-row:  2;

  /* --- Spacing scale (component padding/gap, 4px base) --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  30px;
  --space-8:  40px;
  --space-9:  60px;
  --space-10: 80px;
  --space-11: 120px;

  /* --- Layout (vw-based padding for sections) --- */
  --padding:    5vw;     /* Mobile section padding */
  --pcPadding:  5vw;     /* Used in PC override below */
  --gutter:     20px;    /* Fixed-px alt for image-bleed pages */
  --gutter-alt: 25px;    /* Fixed-px alt for nav/Office (Mobile) */
  --header-offset: 30px;
  --max-width:  1480px;  /* PC Figma viewport */

  /* --- Motion --- */
  --duration-fast:    200ms;
  --duration-default: 400ms;
  --duration-slow:    800ms;
  --ease-default:     cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:         cubic-bezier(0, 0, 0.2, 1);
  --ease-in:          cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);

  /* --- Z-index --- */
  --z-base:    0;
  --z-content: 1;
  --z-header:  10;
  --z-overlay: 100;
  --z-modal:   1000;

  /* --- Misc reusable height for animation slots --- */
  --shuffle-height: 15vh;
}

/* ------------------------------------------------------------
   4. Breakpoint scale-ups (768 / 1024 / 1440)
   ------------------------------------------------------------ */

@media (min-width: 768px) {
  :root {
    --fs-h1: 28px;
    --fs-h2: 24px;
    --padding:       7.5vw;
    --gutter:        32px;
    --gutter-alt:    40px;
    --header-offset: 32px;
  }
}

@media (min-width: 1024px) {
  :root {
    --fs-h0: 42px;
    --fs-h1: 40px;
    --fs-h2: 28px;
    --fs-h3: 24px;   /* was 16px — keep the step under h2 on PC (no 2× jump) */
    --fs-h4: 20px;   /* was 14px */
    --fs-h5: 16px;   /* was 12px */
    --fs-h6: 13.5px;
    --fs-h7: 11.5px;
    --fs-body: 12px;
    --fs-p:    14px;
    --fs-p-en: 13px;   /* Body copy (Latin) — PC */
    --fs-p-ja: 12px;   /* Body copy (JP) — PC */
    --padding:       3vw;
    --gutter:        40px;
    --gutter-alt:    40px;
    --header-offset: 28px;
  }
}

@media (min-width: 1440px) {
  :root {
    --fs-h1: 48px;
    --fs-h2: 28px;   /* was 32px — too close to h1; h3–h5 inherit @1024 */
    --padding:    3vw;
    --gutter:     48px;
    --gutter-alt: 48px;
  }
}

/* ------------------------------------------------------------
   5. Lang-based font switch
   ------------------------------------------------------------ */

:lang(en) {
  --heading-font: var(--font-en);
  --text-font:    var(--font-en);
  font-weight: var(--fw-base);
  /* Steiner is drawn with its own fit — Latin runs at the metrics as
     designed, with no extra tracking. */
  letter-spacing: 0;
}

:lang(ja) {
  --heading-font: var(--font-ja);
  --text-font:    var(--font-ja);
  /* 石井ゴシック R (TypeSquare) sits tighter than Tazugane by default —
     opened up to read comfortably again now that it leads the JP stack. */
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   6. Document base
   ------------------------------------------------------------ */

html {
  font-size: 62.5%;                    /* 1rem = 10px */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body {
  width: 100vw;
  background-color: var(--background);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100% !important;
}

body {
  font-family: var(--text-font);
  font-weight: var(--fw-base);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
}

/* JP-specific line-height (font-family is already switched by :lang) */
:lang(ja) {
  line-height: var(--lh-ja);
  /* --heading-font/--text-font resolve to --font-ja (Tazugane Book) via the
     :lang(ja) block above — Book pairs with Steiner wght400, close to the
     current --fw-base. --font-ja-light (Tazugane Light, pairs with wght330)
     is still available for any element that opts in explicitly. */
  font-weight: var(--fw-base);
  font-variation-settings: 'wght' var(--fw-base);
}

/* ------------------------------------------------------------
   7. Universal text element styling
   ------------------------------------------------------------ */

div, h1, h2, h3, h4, h5, h6,
a, span, input, button, tspan,
tr, td, th, p, li {
  font-family: var(--heading-font);
  color: var(--color-text);
  font-display: swap;
  font-feature-settings: "palt";
}

/* ------------------------------------------------------------
   8. Headings & body (tags + .h0/.h1〜.h6 utility)
   ------------------------------------------------------------ */

.h0 {
  font-size: var(--fs-h0);
  line-height: var(--lh-h0);
}

h1, .h1 {
  font-family:  var(--heading-font);
  font-size:    var(--fs-h1);
  line-height:  var(--lh-h1);
}

h2, .h2 {
  font-family:  var(--heading-font);
  font-size:    var(--fs-h2);
  line-height:  var(--lh-h2);
}

h3, .h3 {
  font-family:  var(--heading-font);
  font-size:    var(--fs-h3);
  line-height:  var(--lh-h3);
}

h4, .h4 {
  font-family:  var(--heading-font);
  font-size:    var(--fs-h4);
  line-height:  var(--lh-h4);
  font-weight: var(--fw-medium);
}

h5, .h5 {
  font-family:  var(--heading-font);
  font-size:    var(--fs-h5);
  line-height:  var(--lh-h5);
}

h6, .h6 {
  font-family:  var(--heading-font);
  font-size:    var(--fs-h6);
  line-height:  var(--lh-h6);
}

p, .p {
  font-family:  var(--text-font);
  font-size:    var(--fs-p);
  line-height:  var(--lh-body);
}

/* Body copy size is language-aware and scales up on PC (vars in :root) */
p:lang(en), .p:lang(en) {
  font-size: var(--fs-p-en);
  /* Latin body sits a step above --fw-base (300): Steiner at the base
     weight reads lighter than the JP face does beside it, so Latin body
     copy is nudged up to match optically. The only weight literal in the
     type system — deliberate, not a stray per-component override. */
  font-weight: 350;
  line-height: var(--lh-en);
  text-align: left;
  hyphens: auto;
}

p:lang(ja), .p:lang(ja) {
  font-size: var(--fs-p-ja);
  line-height: var(--lh-ja);
}

/* ------------------------------------------------------------
   9. Body element defaults
   ------------------------------------------------------------ */

section {
  padding-left:  var(--padding);
  padding-right: var(--padding);
}

img {
  width: 100%;
  object-fit: cover;
  object-position: 50%;
}

input::placeholder {
  color: var(--color-text);
  opacity: 0.25;
}

/* ------------------------------------------------------------
   10. Role utilities
   ------------------------------------------------------------ */

/* Weight */
.regular { font-weight: var(--fw-base); }
.medium  { font-weight: var(--fw-medium); }
.bold    { font-weight: var(--fw-bold); }

/* Color */
.white   { color: var(--white); }
.black   { color: var(--black); }
.mute    { color: var(--color-text-mute); }
.accent  { color: var(--color-accent); }

/* Background */
.bg-white { background: var(--white); }
.bg-dark  { background: var(--color-bg-dark); }
.bg-gray  { background: var(--color-bg-gray); }

/* Alignment */
.left    { text-align: left; }
.center  { text-align: center; }
.right   { text-align: right; }

/* Transform */
.upper   { text-transform: uppercase; }
.lower   { text-transform: lowercase; }
.italic  { font-style: italic; }
.nowrap  { white-space: nowrap; }

/* Display */
.block         { display: block; }
.inline-block  { display: inline-block; }
.hidden        { display: none; }

/* Mobile-first responsive switches */
.sp { display: block; }
.pc { display: none; }

@media (min-width: 768px) {
  .sp { display: none; }
  .pc { display: block; }
}

/* Full-bleed (cancel section padding) */
.w100 {
  width: 100vw;
  margin-left: calc(-1 * var(--padding));
}

/* ------------------------------------------------------------
   11. State utilities (.is-*, .has-*)
   ------------------------------------------------------------ */

.is-active   { color: var(--color-text); }
.is-inactive,
.is-mute     { color: var(--color-text-mute); }
.is-hidden   { display: none; }
.is-paused   { animation-play-state: paused; }
.is-open     { /* hook for components */ }
.is-closed   { /* hook for components */ }

.has-image   { /* hook */ }
.has-video   { /* hook */ }

/* ------------------------------------------------------------
   12. Layout utilities (.l-*, .flex)
   ------------------------------------------------------------ */

.flex {
  display: flex;
  justify-content: center;
  align-items: center;
}

.l-container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.l-container-alt {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter-alt);
}

.l-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.l-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.l-grid {
  display: grid;
  gap: var(--space-4);
}

.l-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------
   13. Spacing utilities (margin, px direct)
   Values: 1, 3, 5, 8, 10, 15, 20, 30, 40, 60, 80, 100, 120
   (mt/mb extend to 160, 200)
   ------------------------------------------------------------ */

/* mx (left + right) */
.mx-1   { margin-left: 1px;   margin-right: 1px; }
.mx-3   { margin-left: 3px;   margin-right: 3px; }
.mx-5   { margin-left: 5px;   margin-right: 5px; }
.mx-8   { margin-left: 8px;   margin-right: 8px; }
.mx-10  { margin-left: 10px;  margin-right: 10px; }
.mx-15  { margin-left: 15px;  margin-right: 15px; }
.mx-20  { margin-left: 20px;  margin-right: 20px; }
.mx-30  { margin-left: 30px;  margin-right: 30px; }
.mx-40  { margin-left: 40px;  margin-right: 40px; }
.mx-60  { margin-left: 60px;  margin-right: 60px; }
.mx-80  { margin-left: 80px;  margin-right: 80px; }
.mx-100 { margin-left: 100px; margin-right: 100px; }
.mx-120 { margin-left: 120px; margin-right: 120px; }

/* my (top + bottom) */
.my-1   { margin-top: 1px;   margin-bottom: 1px; }
.my-3   { margin-top: 3px;   margin-bottom: 3px; }
.my-5   { margin-top: 5px;   margin-bottom: 5px; }
.my-8   { margin-top: 8px;   margin-bottom: 8px; }
.my-10  { margin-top: 10px;  margin-bottom: 10px; }
.my-15  { margin-top: 15px;  margin-bottom: 15px; }
.my-20  { margin-top: 20px;  margin-bottom: 20px; }
.my-30  { margin-top: 30px;  margin-bottom: 30px; }
.my-40  { margin-top: 40px;  margin-bottom: 40px; }
.my-60  { margin-top: 60px;  margin-bottom: 60px; }
.my-80  { margin-top: 80px;  margin-bottom: 80px; }
.my-100 { margin-top: 100px; margin-bottom: 100px; }
.my-120 { margin-top: 120px; margin-bottom: 120px; }

/* mt (top only) */
.mt-1   { margin-top: 1px; }
.mt-3   { margin-top: 3px; }
.mt-5   { margin-top: 5px; }
.mt-8   { margin-top: 8px; }
.mt-10  { margin-top: 10px; }
.mt-15  { margin-top: 15px; }
.mt-20  { margin-top: 20px; }
.mt-30  { margin-top: 30px; }
.mt-40  { margin-top: 40px; }
.mt-60  { margin-top: 60px; }
.mt-80  { margin-top: 80px; }
.mt-100 { margin-top: 100px; }
.mt-120 { margin-top: 120px; }
.mt-160 { margin-top: 160px; }
.mt-200 { margin-top: 200px; }

/* mb (bottom only) */
.mb-1   { margin-bottom: 1px; }
.mb-3   { margin-bottom: 3px; }
.mb-5   { margin-bottom: 5px; }
.mb-8   { margin-bottom: 8px; }
.mb-10  { margin-bottom: 10px; }
.mb-15  { margin-bottom: 15px; }
.mb-20  { margin-bottom: 20px; }
.mb-30  { margin-bottom: 30px; }
.mb-40  { margin-bottom: 40px; }
.mb-60  { margin-bottom: 60px; }
.mb-80  { margin-bottom: 80px; }
.mb-100 { margin-bottom: 100px; }
.mb-120 { margin-bottom: 120px; }
.mb-160 { margin-bottom: 160px; }
.mb-200 { margin-bottom: 200px; }

/* ml (left only) */
.ml-1   { margin-left: 1px; }
.ml-3   { margin-left: 3px; }
.ml-5   { margin-left: 5px; }
.ml-8   { margin-left: 8px; }
.ml-10  { margin-left: 10px; }
.ml-15  { margin-left: 15px; }
.ml-20  { margin-left: 20px; }
.ml-30  { margin-left: 30px; }
.ml-40  { margin-left: 40px; }
.ml-60  { margin-left: 60px; }
.ml-80  { margin-left: 80px; }
.ml-100 { margin-left: 100px; }
.ml-120 { margin-left: 120px; }

/* mr (right only) */
.mr-1   { margin-right: 1px; }
.mr-3   { margin-right: 3px; }
.mr-5   { margin-right: 5px; }
.mr-8   { margin-right: 8px; }
.mr-10  { margin-right: 10px; }
.mr-15  { margin-right: 15px; }
.mr-20  { margin-right: 20px; }
.mr-30  { margin-right: 30px; }
.mr-40  { margin-right: 40px; }
.mr-60  { margin-right: 60px; }
.mr-80  { margin-right: 80px; }
.mr-100 { margin-right: 100px; }
.mr-120 { margin-right: 120px; }

/* ------------------------------------------------------------
   14. Reduced motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------
   15. Focus outlines (accessibility)
   ------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ------------------------------------------------------------
   16. Accessibility helper
   ------------------------------------------------------------ */

.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;
}
