/* =====================================================================
 * base.css — Polyphase base layout & section styles
 *
 * Reference: site-spec v0.4 §14 (visual system, Pattern G), mock-top-jp.html.
 * tokens.css must be loaded before this file. Hardcoded color/px values
 * are forbidden — every value resolves through a token (Step 2 grep gate).
 * ===================================================================== */

/* ---------------------------------------------------------------------
 * Reset + global typography
 * ------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  /* site-spec §14.2 — OpenType features required at body level */
  font-feature-settings: "ss01" on, "cv11" on;
  font-variant-numeric: tabular-nums slashed-zero;
}
a { color: inherit; text-decoration: none; }
a.text-link {
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
a.text-link:hover { border-bottom-color: var(--signal); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid var(--signal);
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------------------------------------------------------------------
 * Masthead
 * ------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
}
/* v0.4 §14.3 #17 — Polyphase exception: accent on the leading P. */
.brand .accent { color: var(--signal); }
.brand__publisher {
  display: inline-block;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--rule-strong);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-mute);
  vertical-align: middle;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}
.nav .lang {
  margin-left: 8px;
  padding-left: 20px;
  border-left: 1px solid var(--rule-strong);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-mute);
}
.nav .lang .active { color: var(--text); }

/* Mobile drawer trigger — visible only below 720px */
.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}
.nav__toggle svg { display: block; }

/* Drawer (mobile) */
.drawer {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  padding: 24px 24px 32px;
  transform: translateX(100%);
  transition: transform 260ms var(--ease);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.drawer[aria-hidden="false"] { transform: translateX(0); }
.drawer__head {
  display: flex;
  justify-content: flex-end;
}
.drawer__close {
  background: transparent;
  border: 0;
  padding: 8px;
  color: var(--text);
  cursor: pointer;
}
.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer__nav a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.drawer__lang {
  margin-top: auto;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-mute);
}
.drawer__lang .active { color: var(--text); }

@media (max-width: 720px) {
  .masthead__inner { height: 56px; padding: 0 20px; }
  .brand__publisher { display: none; }
  .nav { display: none; }
  .nav__toggle { display: inline-flex; align-items: center; }
}

/* ---------------------------------------------------------------------
 * Section 1: Hero (Mode D — always dark)
 * ------------------------------------------------------------------- */
.hero {
  background: var(--bg-D);
  color: var(--text-D);
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--rule-strong-D);
}
.hero__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: end;
}
.hero__brand-mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text-D);
  margin: 0 0 24px;
}
.hero__brand-mark .accent { color: var(--signal-D); }
.hero__tagline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-mute-D);
  max-width: 32ch;
  margin: 0 0 56px;
}
.hero__pub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute-D);
}
.hero__pub .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--signal-D);
  margin: 0 12px 2px;
  vertical-align: middle;
}

.feature-card {
  background: transparent;
  border-top: 1px solid var(--rule-strong-D);
  padding-top: 28px;
}
.feature-card__meta {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute-D);
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.feature-card__meta .pill { color: var(--signal-D); }
.feature-card__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--text-D);
  margin: 0 0 20px;
}
.feature-card__dek {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-mute-D);
  max-width: 52ch;
  margin: 0 0 32px;
}
.feature-card__cta {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--text-D);
  border-bottom: 1px solid var(--signal-D);
  padding-bottom: 2px;
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 56px; }
  .hero { padding: 64px 0; }
}

/* ---------------------------------------------------------------------
 * Section 2: Editorial stance (Light)
 * ------------------------------------------------------------------- */
.stance {
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--rule);
}
.stance__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 0.4fr 1fr;
  gap: 64px;
}
.section-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.section-label .num {
  color: var(--signal);
  margin-right: 12px;
}
.stance__body {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 56ch;
}
.stance__body em {
  font-style: normal;
  background: linear-gradient(to top, var(--signal-glow) 38%, transparent 38%);
  padding: 0 2px;
}

@media (max-width: 720px) {
  .stance { padding: 64px 0; }
  .stance__inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------------------------------------------------------------------
 * Section 3: Latest essays (index)
 * ------------------------------------------------------------------- */
.essays {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--rule);
}
.essays__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.essays__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 48px;
}
.essays__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}
.essays__more {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}
.essays__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}
.essay-item {
  display: grid;
  grid-template-columns: 100px 1fr 280px;
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.essay-item__issue {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.essay-item__issue .num {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  margin-top: 4px;
}
.essay-item__main h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 1.8vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--text);
}
.essay-item__main p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-mute);
  max-width: 56ch;
}
.essay-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
}
.essay-item__tags span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.essay-item__tags span.series {
  color: var(--text);
  border-bottom: 1px solid var(--signal);
  padding-bottom: 1px;
}

@media (max-width: 900px) {
  .essay-item { grid-template-columns: 80px 1fr; gap: 24px; }
  .essay-item__tags { grid-column: 2 / -1; justify-content: flex-start; margin-top: 4px; }
}
@media (max-width: 720px) {
  .essays { padding: 64px 0; }
  .essays__header { flex-direction: column; align-items: flex-start; padding-bottom: 32px; }
}

/* ---------------------------------------------------------------------
 * Section 4: Series (3-up grid + composition stack bar)
 * ------------------------------------------------------------------- */
.series {
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--rule);
}
.series__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.series__header { margin-bottom: 56px; }
.series__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 12px 0 16px;
}
.series__dek {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-mute);
  max-width: 56ch;
  margin: 0;
}
.series__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 48px;
}
.series-card {
  border-top: 1px solid var(--rule-strong);
  padding-top: 24px;
}
.series-card__meta {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}
.series-card__meta .count { color: var(--text); }
.series-card__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0 0 12px;
}
.series-card__intent {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-mute);
  margin: 0 0 20px;
}
.series-card__recent {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.series-card__recent li {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  display: flex;
  gap: 12px;
}
.series-card__recent li time {
  flex: 0 0 64px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  padding-top: 1px;
}
.series-card__more {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}

/* composition stack bar — referenced from v3.1 Interlude */
.stack-bar {
  display: flex;
  height: 4px;
  margin-bottom: 18px;
  background: var(--rule);
}
.stack-bar > span { display: block; height: 100%; }
.stack-bar .a { background: var(--text); }
.stack-bar .b { background: var(--signal); }
.stack-bar .c { background: var(--text-soft); }

@media (max-width: 1024px) {
  .series__grid { grid-template-columns: 1fr 1fr; gap: 48px 32px; }
}
@media (max-width: 720px) {
  .series { padding: 64px 0; }
  .series__grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------------------------------------------------------------------
 * Section 5: About preview
 * ------------------------------------------------------------------- */
.about {
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--rule);
}
.about__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: 64px;
  align-items: start;
}
.about__portrait {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--portrait-grad-1), var(--portrait-grad-2));
  border: 1px solid var(--rule-strong);
  position: relative;
}
.about__portrait::after {
  content: "Portrait of Shigeto Mizumoto";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.about__body h2 {
  margin: 12px 0 24px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.about__body h2 small {
  display: block;
  font-size: 0.5em;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  margin-top: 8px;
  font-weight: 400;
}
.about__body p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 18px;
  max-width: 56ch;
}
.about__body p.muted { color: var(--text-mute); }
.about__more {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}

@media (max-width: 900px) {
  .about__inner { grid-template-columns: 1fr; gap: 32px; }
  .about__portrait { max-width: 360px; }
}

/* ---------------------------------------------------------------------
 * Section 6: Contact (quiet)
 * ------------------------------------------------------------------- */
.contact {
  padding: 96px 0 96px;
  border-bottom: 1px solid var(--rule);
}
.contact__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 0.4fr 1fr;
  gap: 64px;
}
.contact__body {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.55;
  letter-spacing: -0.01em;
  max-width: 56ch;
}
.contact__list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.contact__list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
}
.contact__list li b {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding-top: 4px;
}
.contact__link {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--text);
  border-bottom: 1px solid var(--signal);
  padding-bottom: 2px;
}

@media (max-width: 720px) {
  .contact { padding: 64px 0; }
  .contact__inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------- */
.footer {
  padding: 56px 0 80px;
  background: var(--bg);
}
.footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.footer .brand-line {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
}
.footer .brand-line .accent { color: var(--signal); }
.footer p.publisher {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  margin: 8px 0 0;
}
.footer__col h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 14px;
}
.footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__col li {
  padding: 4px 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
}
.footer__col li a:hover {
  border-bottom: 1px solid var(--signal);
  padding-bottom: 1px;
}
.footer__copy {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.footer__copy .lang {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.16em;
}
.footer__copy .lang b { color: var(--text); font-weight: 500; }
.footer__licenses {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-soft);
}

@media (max-width: 720px) {
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 40px 32px; }
  .footer__copy { flex-direction: column; align-items: flex-start; }
}
