/* ==========================================================================
   Masano Sports SARL — "Swiss Modern"
   Swiss Modernism 2.0 + Minimalism & Swiss Style: 12-column grid,
   off-white paper, ink type, a single signal-red accent, thin rules.
   ========================================================================== */

:root {
  --paper: #F7F6F2;
  --paper-2: #EFEDE6;
  --white: #FFFFFF;
  --ink: #111111;          /* 18.0:1 on paper */
  --ink-2: #33322F;        /* 12.2:1 on paper */
  --muted: #5A5954;        /*  6.6:1 on paper */
  --rule: #D6D3CA;
  --rule-strong: #111111;
  --red: #D7261E;          /* 4.6:1 on paper, 5.0:1 white on red — large type & fills */
  --red-ink: #B21E17;      /* 6.1:1 on paper — small text */
  --focus: #1F4BD8;        /* focus ring, 6.9:1 on paper */

  --font-head: "Inter Tight", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --u: 8px;
  --gutter: clamp(16px, 2vw, 24px);
  --pad: clamp(16px, 4.5vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 72px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; line-height: 1.02; letter-spacing: -0.03em; }
ul, ol { padding: 0; margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--red); color: var(--white); }

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

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--pad); top: -100px; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; min-height: 44px; font-weight: 600; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus, .skip-link:focus-visible { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 246, 242, .94);
  border-bottom: 1px solid var(--rule-strong);
}
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .site-header { background: rgba(247, 246, 242, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.header-inner {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 8px 24px; min-height: var(--header-h); flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand img { width: 132px; height: auto; }

.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
.nav a {
  position: relative; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 12px;
  font-size: .9375rem; font-weight: 500; text-decoration: none; color: var(--ink);
}
.nav a .idx { font-family: var(--font-head); font-size: .6875rem; font-weight: 600; color: var(--red-ink); margin-right: 6px; letter-spacing: .02em; }
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Generic ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: .8125rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
}
.eyebrow::before { content: ""; width: 10px; height: 10px; background: var(--red); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--font-head); font-size: 1rem; font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-red:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn .arrow { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.arrow path { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: square; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); position: relative; }
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 24px;
  padding-bottom: 16px; margin-bottom: clamp(32px, 6vw, 72px);
  border-bottom: 1px solid var(--rule);
  font-size: .8125rem; color: var(--muted); letter-spacing: .02em;
}
.hero-meta strong { color: var(--ink); font-weight: 600; }
.hero-title {
  font-size: clamp(2.4rem, 10.4vw, 9.5rem);
  line-height: .9; letter-spacing: -0.055em; font-weight: 700;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.hero-title .line { display: block; }
.hero-title .accent { color: var(--red); }
.hero-title .dot { display: inline-block; width: .16em; height: .16em; background: var(--red); margin-left: .04em; vertical-align: baseline; }
.hero-lede { font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.5; color: var(--ink-2); max-width: 40ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-figure { margin-top: 40px; }
.hero-art { width: 100%; max-width: 640px; height: auto; margin: 0 auto; }

@media (min-width: 900px) {
  .hero-title { grid-column: 1 / 8; grid-row: 1; font-size: clamp(3.5rem, 7.2vw, 8rem); position: relative; z-index: 1; }
  .hero-copy { grid-column: 1 / 7; grid-row: 2; align-self: start; padding-top: 8px; position: relative; z-index: 1; }
  .hero-figure { grid-column: 7 / 13; grid-row: 1 / 3; align-self: center; margin-top: 0; }
  .hero-art { max-width: 680px; margin-right: 0; }
  .hero-copy::after {
    content: ""; display: block; margin-top: 48px; height: 120px; max-width: 320px;
    background-image: radial-gradient(circle, var(--ink) 1.6px, transparent 2px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent);
    mask-image: linear-gradient(90deg, #000, transparent);
  }
}

/* Hero entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-title .line { animation: rise .9s var(--ease) both; }
  .hero-title .line:nth-child(2) { animation-delay: .08s; }
  .hero-title .line:nth-child(3) { animation-delay: .16s; }
  .hero-copy, .hero-figure { animation: fade 1s .3s var(--ease) both; }
  .hero-art .ha-float { animation: haFloat 6s ease-in-out infinite alternate; }
  .hero-art .ha-float2 { animation: haFloat 7.5s -2s ease-in-out infinite alternate; }
  .hero-art .ha-float3 { animation: haFloatSm 5s -1s ease-in-out infinite alternate; }
  .hero-art .ha-drift { animation: haDrift 14s ease-in-out infinite alternate; }
  .hero-art .ha-pulse { animation: haPulse 3.2s ease-in-out infinite alternate; }
  .hero-art .ha-lines { stroke-dasharray: 160 40; animation: haLines 4s linear infinite; }
}
@keyframes haFloat { from { transform: translateY(0); } to { transform: translateY(-12px); } }
@keyframes haFloatSm { from { transform: translate(0, 0); } to { transform: translate(4px, -7px); } }
@keyframes haDrift { from { transform: translate(0, 0); } to { transform: translate(-14px, 10px); } }
@keyframes haPulse { from { opacity: 1; } to { opacity: .45; } }
@keyframes haLines { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -200; } }
@keyframes rise { from { opacity: 0; transform: translateY(.25em); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
  background: var(--ink); color: var(--paper);
  overflow: hidden; position: relative;
}
.marquee-track { display: flex; width: max-content; }
.marquee-list {
  display: flex; flex: none; list-style: none; align-items: center;
  padding: 18px 0;
}
.marquee-list li {
  display: inline-flex; align-items: center; gap: 28px; padding-right: 28px;
  font-family: var(--font-head); font-weight: 600; font-size: clamp(1.125rem, 2.2vw, 1.75rem);
  letter-spacing: -.02em; white-space: nowrap;
}
.marquee-list li::after { content: ""; width: 10px; height: 10px; background: var(--red); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 38s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { width: auto; }
  .marquee-list { flex-wrap: wrap; flex: 1 1 auto; padding: 18px var(--pad); row-gap: 6px; }
  .marquee-list[aria-hidden="true"] { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 144px) 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section-head { margin-bottom: clamp(32px, 5vw, 64px); align-items: end; }
.numeral {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(5.5rem, 18vw, 15rem); line-height: .78; letter-spacing: -0.07em;
  color: var(--ink); margin: 0 0 24px; display: block;
}
.numeral .slash { color: var(--red); }
.section-title { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -0.045em; line-height: .98; }
.section-title-wrap .eyebrow { margin-bottom: 20px; }

@media (min-width: 900px) {
  .section-head .numeral { grid-column: 1 / 6; margin: 0; }
  .section-head .section-title-wrap { grid-column: 6 / 13; padding-bottom: 12px; }
}

/* About */
.about-body { font-size: clamp(1.25rem, 2.1vw, 1.75rem); line-height: 1.4; letter-spacing: -.012em; color: var(--ink); font-weight: 500; }
.about-body p:last-child { margin-bottom: 0; }
.about-body .muted { color: var(--muted); }
.about-aside {
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rule-strong);
  font-size: .875rem; color: var(--muted);
}
.about-aside dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; }
.about-aside dt { font-weight: 600; color: var(--ink); }
.about-aside dd { margin: 0; }
.about-figure { margin-top: 40px; }
.about-art { width: 100%; max-width: 560px; }
@media (min-width: 900px) {
  .about-body { grid-column: 7 / 13; grid-row: 1; align-self: start; }
  .about-aside { grid-column: 7 / 13; grid-row: 2; margin-top: 40px; align-self: start; }
  .about-figure { grid-column: 1 / 6; grid-row: 1 / 3; margin-top: 0; align-self: start; }
}

/* Work cards */
.cards { list-style: none; border-top: 1px solid var(--rule-strong); }
.card {
  position: relative; padding: 28px 0 32px; border-bottom: 1px solid var(--rule-strong);
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 16px;
}
.card-art { grid-column: 1 / -1; margin: 0 0 20px; background: var(--white); border: 1px solid var(--rule); }
.card-art img { display: block; width: 100%; height: auto; }
.card-no { font-family: var(--font-head); font-weight: 600; font-size: .875rem; color: var(--red-ink); padding-top: 8px; letter-spacing: .02em; }
.card h3 { font-size: clamp(1.5rem, 2.6vw, 2.125rem); letter-spacing: -.035em; margin-bottom: 12px; }
.card p { color: var(--ink-2); margin: 0; max-width: 46ch; }
.card::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--red);
  transition: width .45s var(--ease);
}
.card:hover::before { width: 100%; }
@media (min-width: 720px) {
  .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); }
  .card { grid-template-columns: 1fr; row-gap: 20px; padding: 28px 0 40px; align-content: start; }
  .card-art { margin-bottom: 0; }
  .card-no { padding-top: 0; }
}
@media (min-width: 1100px) {
  .card { min-height: 280px; align-content: start; }
  .card-art { margin-bottom: 4px; }
}

/* Approach */
.approach {
  background-color: var(--paper-2);
  background-image: radial-gradient(circle, rgba(17, 17, 17, .14) 1.4px, transparent 1.8px);
  background-size: 18px 18px;
  background-position: right top;
  position: relative;
}
.approach > .container { position: relative; }
.approach::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--paper-2) 55%, rgba(239, 237, 230, .6) 80%, rgba(239, 237, 230, 0));
}
.principle-art { width: 72px; margin-bottom: 12px; }
.principle-art img { width: 100%; height: auto; }
.principles { list-style: none; counter-reset: p; }
.principle {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  padding: 28px 0; border-top: 1px solid var(--rule-strong); align-items: baseline;
}
.principle:last-child { border-bottom: 1px solid var(--rule-strong); }
.principle > * { grid-column: 1 / -1; }
.principle-no { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--red-ink); margin-bottom: 8px; }
.principle h3 { font-size: clamp(1.625rem, 3.4vw, 2.75rem); letter-spacing: -.04em; margin-bottom: 10px; }
.principle p { margin: 0; color: var(--ink-2); max-width: 52ch; }
@media (min-width: 900px) {
  .principle-no { grid-column: 1 / 2; margin: 0; }
  .principle { align-items: center; }
  .principle-art { grid-column: 2 / 4; width: 100%; max-width: 104px; margin: 0; }
  .principle h3 { grid-column: 4 / 8; margin: 0; }
  .principle p { grid-column: 8 / 13; }
}

/* Process */
.process { position: relative; overflow: hidden; }
.process::after {
  content: ""; position: absolute; right: 0; top: 0; width: min(42vw, 520px); height: 320px; pointer-events: none;
  background-image: radial-gradient(circle, var(--ink) 1.5px, transparent 1.9px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(225deg, rgba(0, 0, 0, .55), transparent 65%);
  mask-image: linear-gradient(225deg, rgba(0, 0, 0, .55), transparent 65%);
}
.process > .container { position: relative; z-index: 1; }
.steps { list-style: none; display: grid; gap: 40px var(--gutter); grid-template-columns: minmax(0, 1fr); }
.step { position: relative; border-top: 3px solid var(--ink); padding-top: 24px; }
.step-art { width: 136px; background: var(--white); border: 1px solid var(--rule); margin-bottom: 20px; position: relative; z-index: 1; }
.step-art img { width: 100%; height: auto; }
.step-no { font-family: var(--font-head); font-weight: 700; font-size: .875rem; color: var(--red-ink); letter-spacing: .04em; margin: 0 0 8px; }
.step h3 { font-size: clamp(1.375rem, 2vw, 1.75rem); letter-spacing: -.035em; margin-bottom: 10px; }
.step p:last-child { margin: 0; color: var(--ink-2); max-width: 32ch; }
@media (min-width: 600px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .step { border-top: 0; padding-top: 0; }
  /* connector: dashed rail + arrowhead between illustrations */
  .step::before {
    content: ""; position: absolute; top: 68px; left: 136px; right: calc(-1 * var(--gutter));
    border-top: 3px dashed var(--ink);
  }
  .step::after {
    content: ""; position: absolute; top: 61px; right: calc(-1 * var(--gutter) + 2px);
    width: 14px; height: 14px; border-top: 3px solid var(--red); border-right: 3px solid var(--red);
    transform: rotate(45deg);
  }
  .step:last-child::before { border-top-color: var(--red); border-top-style: solid; right: 0; }
  .step:last-child::after { right: 2px; }
}

/* Statement banner */
.statement { position: relative; background: var(--ink); color: var(--paper); overflow: hidden; border-bottom: 1px solid var(--ink); }
.statement-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; }
.statement-inner { position: relative; padding-top: clamp(72px, 10vw, 140px); padding-bottom: clamp(72px, 10vw, 140px); }
.statement .eyebrow { color: var(--paper); margin-bottom: 24px; }
.statement-title {
  font-size: clamp(2rem, 5.2vw, 4.75rem); letter-spacing: -.05em; line-height: .98; max-width: 14em; color: var(--paper);
}
.statement-title .accent { color: #FF5A4F; }
.statement::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(17, 17, 17, .94) 0, rgba(17, 17, 17, .88) 42%, rgba(17, 17, 17, 0) 58%);
}
.statement-inner { z-index: 1; }
@media (min-width: 900px) {
  .statement-title { font-size: clamp(2.25rem, 4.2vw, 4rem); max-width: min(13em, 54vw); }
}
@media (max-width: 1023px) {
  .statement-art { opacity: .4; object-position: 85% 50%; }
  .statement::after { background: rgba(17, 17, 17, .55); }
}

/* Contact */
.contact { padding-bottom: clamp(72px, 10vw, 152px); }
.contact-mail {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .2em;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.75rem, 7.2vw, 6.5rem); line-height: 1; letter-spacing: -0.05em;
  text-decoration: none; color: var(--ink); word-break: break-word;
  border-bottom: 3px solid var(--ink); padding-bottom: .08em;
  transition: color .2s var(--ease), border-color .2s var(--ease);
  min-height: 44px;
}
.contact-mail:hover { color: var(--red); border-color: var(--red); }
.contact-mail .at { color: var(--red); }
.contact-note { margin-top: 28px; color: var(--muted); max-width: 52ch; }
.contact-row { margin-top: 28px; align-items: center; row-gap: 32px; }
.contact-row .contact-note { margin-top: 0; }
.contact-art { width: 100%; max-width: 480px; }
.contact-grid { margin: 40px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .9375rem; display: grid; gap: 0 var(--gutter); }
.contact-grid > div { margin-bottom: 16px; }
.contact-grid dt, .label { font-family: var(--font-head); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.contact-grid dd { margin: 0; font-weight: 500; }
.contact-grid a { text-underline-offset: 3px; }
@media (min-width: 720px) {
  .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .contact-text { grid-column: 1 / 8; }
  .contact-figure { grid-column: 8 / 13; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #E8E6DF; padding: clamp(48px, 7vw, 88px) 0 32px; font-size: .9375rem; }
.site-footer a { color: #FFFFFF; }
.footer-top { padding-bottom: 32px; border-bottom: 1px solid #3A3936; row-gap: 32px; }
.footer-logo { display: inline-flex; align-items: center; align-self: start; justify-self: start; min-height: 44px; text-decoration: none; }
.footer-logo img { width: clamp(180px, 26vw, 320px); height: auto; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 8px; }
.footer-nav a, .footer-nav .linklike {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px 0 0;
  text-decoration: none; color: #FFFFFF; font-weight: 500;
  background: none; border: 0; cursor: pointer; font-size: inherit;
  text-decoration-color: var(--red); text-underline-offset: 4px;
}
.footer-nav a:hover, .footer-nav .linklike:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.site-footer :focus-visible { outline-color: #8FB0FF; }
.footer-bottom { padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 32px; color: #BDBAB1; font-size: .8125rem; }
.footer-bottom p { margin: 0; }
@media (min-width: 900px) {
  .footer-logo { grid-column: 1 / 8; }
  .footer-nav { grid-column: 9 / 13; align-self: end; }
  .footer-nav ul { flex-direction: column; align-items: flex-start; }
}

/* ---------- Legal pages ---------- */
.legal-hero { padding: clamp(48px, 8vw, 112px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--rule-strong); }
.legal-hero h1 { font-size: clamp(2.5rem, 8vw, 6.5rem); letter-spacing: -0.055em; line-height: .92; margin: 20px 0 24px; }
.legal-hero .updated { color: var(--muted); font-size: .9375rem; margin: 0; }
.legal-hero .updated time { color: var(--ink); font-weight: 600; }
.legal-hero { position: relative; overflow: hidden; }
.legal-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; column-gap: var(--gutter); }
.legal-hero-art { order: 2; margin-top: 32px; max-width: 360px; }
.legal-hero-art img { width: 100%; height: auto; }
@media (min-width: 760px) {
  .legal-hero-inner { grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); grid-template-rows: auto auto auto; }
  .legal-hero-inner > :not(.legal-hero-art) { grid-column: 1; }
  .legal-hero-art { grid-column: 2; grid-row: 1 / 4; margin: 0; max-width: none; }
}
.legal-wrap { padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(64px, 9vw, 128px); }
.toc { margin-bottom: 48px; font-size: .9375rem; }
.toc h2 { font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; font-weight: 600; }
.toc ol { list-style: none; counter-reset: toc; border-top: 1px solid var(--rule-strong); }
.toc li { counter-increment: toc; border-bottom: 1px solid var(--rule); }
.toc a {
  display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 6px 0;
  text-decoration: none; color: var(--ink-2);
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-head); font-weight: 600; font-size: .75rem; color: var(--red-ink); min-width: 22px; }
.toc a:hover { color: var(--ink); }
.toc a:hover::before { color: var(--red); }
@media (min-width: 1000px) {
  .toc { grid-column: 1 / 5; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
  .prose { grid-column: 6 / 13; }
}
.prose { max-width: 72ch; }
.prose section { padding-top: 8px; margin-bottom: 44px; }
.prose h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.035em; line-height: 1.1;
  padding-top: 18px; border-top: 1px solid var(--rule-strong); margin-bottom: 18px;
  display: flex; gap: 14px; align-items: baseline;
}
.prose h2 .n { font-size: .875rem; color: var(--red-ink); letter-spacing: 0; flex: none; }
.prose h3 { font-size: 1.1875rem; letter-spacing: -.02em; margin: 24px 0 10px; line-height: 1.25; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { list-style: none; margin: 0 0 1em; }
.prose ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 2px; background: var(--red); }
.prose a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--red-ink); }
.prose strong { color: var(--ink); }
.note {
  border-left: 3px solid var(--red); background: var(--white);
  padding: 16px 20px; margin: 0 0 32px; color: var(--ink-2); font-size: .9688rem;
}
.note p:last-child { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.25em; border-top: 1px solid var(--rule-strong); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 520px; }
caption { text-align: left; font-size: .8125rem; color: var(--muted); padding: 10px 0; caption-side: bottom; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); }
th { font-family: var(--font-head); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
td code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875rem; background: var(--paper-2); padding: 2px 6px; color: var(--ink); }
.inline-btn { margin-top: 4px; }

/* 404 */
.notfound { padding: clamp(64px, 12vw, 160px) 0; }
.notfound .numeral { font-size: clamp(7rem, 30vw, 22rem); }
.notfound h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.045em; margin-bottom: 16px; }
.notfound p { color: var(--ink-2); max-width: 46ch; margin-bottom: 28px; }
.notfound-inner { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--gutter); align-items: center; justify-items: start; }
.notfound-art { order: 5; margin-top: 48px; max-width: 520px; }
.notfound-art img { width: 100%; height: auto; }
@media (min-width: 900px) {
  .notfound-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .notfound-inner > :not(.notfound-art) { grid-column: 1; }
  .notfound-inner .numeral { font-size: clamp(7rem, 15vw, 15rem); }
  .notfound-art { justify-self: stretch; }
  .notfound-art { grid-column: 2; grid-row: 1 / 5; margin: 0; }
}

/* ---------- Reveal (only when JS opted in and motion allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .reveal-on [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Back to top ---------- */
#top:focus, #top:focus-visible { outline: none; }
.back-to-top {
  position: fixed; z-index: 80;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 48px; height: 48px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 0; cursor: pointer;
  box-shadow: 0 0 0 1.5px var(--paper), 0 12px 0 -6px rgba(17, 17, 17, .08); /* paper ring keeps the shape visible over the dark footer */
  visibility: hidden; opacity: 0; transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s, background-color .2s var(--ease), border-color .2s var(--ease);
}
.back-to-top.is-visible { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.back-to-top:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.back-to-top:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 3px var(--paper); }
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
@media (prefers-reduced-motion: reduce) {
  .back-to-top, .back-to-top.is-visible { transition: none; transform: none; }
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 0 var(--pad) max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.cookie-banner[hidden] { display: none; }
.cookie-card {
  pointer-events: auto;
  max-width: var(--max); margin: 0 auto;
  background: var(--white); color: var(--ink);
  border: 1.5px solid var(--ink); border-top: 6px solid var(--red);
  box-shadow: 0 12px 0 -6px rgba(17, 17, 17, .08);
  padding: 20px;
  display: grid; gap: 16px;
}
.cookie-card h2 { font-size: 1.25rem; letter-spacing: -.025em; margin: 0 0 6px; }
.cookie-card p { margin: 0; font-size: .9375rem; color: var(--ink-2); line-height: 1.5; }
.cookie-card a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
.cookie-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cookie-actions .btn { min-height: 44px; font-size: .9375rem; padding: 0 16px; }
@media (min-width: 560px) { .cookie-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .cookie-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; padding: 22px 28px; }
  .cookie-actions { grid-template-columns: repeat(3, auto); }
}
@media (prefers-reduced-motion: no-preference) {
  .cookie-banner:not([hidden]) .cookie-card { animation: slideup .5s var(--ease) both; }
}
@keyframes slideup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Cookie dialog ---------- */
.cookie-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1.5px solid var(--ink); border-top: 6px solid var(--red); border-radius: 0;
  background: var(--white); color: var(--ink);
  overflow: auto;
}
.cookie-dialog::backdrop { background: rgba(17, 17, 17, .55); }
.dialog-inner { padding: clamp(20px, 4vw, 32px); }
.dialog-head { display: flex; justify-content: flex-start; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.dialog-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.035em; }
.icon-btn {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink); background: transparent; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--ink); color: var(--white); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn path { fill: none; stroke: currentColor; stroke-width: 2; }
.dialog-intro { color: var(--ink-2); font-size: .9375rem; margin-bottom: 20px; }
.dialog-intro a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
.cat-list { list-style: none; border-top: 1px solid var(--ink); margin-bottom: 24px; }
.cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.cat-name { font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; letter-spacing: -.015em; cursor: pointer; }
.cat-desc { grid-column: 1 / -1; margin: 0; font-size: .875rem; color: var(--muted); line-height: 1.5; }
.cat-tag { font-size: .75rem; font-weight: 600; color: var(--red-ink); letter-spacing: .04em; text-transform: uppercase; margin-left: 6px; }

/* Switch */
.switch { position: relative; display: inline-flex; width: 56px; height: 44px; align-items: center; justify-content: center; }
.switch input {
  -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer;
  width: 52px; height: 28px; border: 1.5px solid var(--ink); background: var(--paper);
  position: relative; transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: var(--ink);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.switch input:checked { background: var(--red); border-color: var(--red); }
.switch input:checked::after { transform: translateX(23px); background: var(--white); }
.switch input:disabled { cursor: not-allowed; background: var(--ink); border-color: var(--ink); }
.switch input:disabled::after { background: var(--paper); transform: translateX(23px); }
.switch input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.dialog-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dialog-actions .btn { min-height: 44px; font-size: .9375rem; padding: 0 14px; }
@media (min-width: 560px) { .dialog-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.status-msg { min-height: 1.5em; margin: 12px 0 0; font-size: .875rem; color: var(--muted); }

/* ---------- Small screens ---------- */
@media (max-width: 719px) {
  .site-header { position: static; }
  html { scroll-padding-top: 16px; }
  .header-inner { padding-top: 8px; padding-bottom: 4px; }
  .nav { width: 100%; border-top: 1px solid var(--rule); }
  .nav ul { justify-content: flex-start; gap: 0 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav li { flex: 0 0 auto; }
  .nav a { padding: 0 6px; font-size: .9375rem; white-space: nowrap; }
  .hero-figure { margin-top: 0; }
  .nav a::after { left: 6px; right: 6px; }
  .nav li:first-child a { padding-left: 0; }
  .nav li:first-child a::after { left: 0; }
  .nav li:last-child a { padding-right: 0; }
}
@media (max-width: 380px) {
  .nav a .idx { display: none; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .cookie-banner, .cookie-dialog, .marquee, .footer-nav, .skip-link, .back-to-top { display: none !important; }
  body { background: #fff; }
  .prose { max-width: none; }
}

/* Dialog fallback for browsers without native <dialog> */
.cookie-dialog:not([open]) { display: none; }
.cookie-dialog.is-fallback-open { position: fixed; inset: 0; margin: auto; z-index: 100; height: fit-content; box-shadow: 0 0 0 100vmax rgba(17, 17, 17, .55); }

/* Push trailing items to the far edge (flex auto margins) */
.nav { margin-left: auto; }
.hero-meta > :last-child,
.footer-bottom > :last-child,
.dialog-head > .icon-btn { margin-left: auto; }
@media (max-width: 719px) {
  .nav { margin-left: 0; }
  .hero-meta > :last-child, .footer-bottom > :last-child { margin-left: 0; }
}

/* Smooth in-page scrolling only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
