/* ------------------------------------------------------------------
   base: reset, typography, page shell
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv01";
  word-break: keep-all;
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button, [role="button"], select, input { touch-action: manipulation; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line-strong); margin: 0; }
::selection { background: var(--accent); color: var(--accent-fg); }

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

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 12px;
  font-family: var(--font-mono); font-size: 12px;
}
.skip:focus { top: 8px; }

/* type scale ------------------------------------------------------- */
.display, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.display { font-size: clamp(56px, 11vw, 168px); }
.h1 { font-size: clamp(40px, 7vw, 104px); }
.h2 { font-size: clamp(32px, 4.6vw, 64px); }
.h3 { font-size: clamp(22px, 2.6vw, 34px); }

.hud {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-2);
  line-height: 1.4;
}
.hud--strong { color: var(--fg); font-weight: 600; }
.hud--accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.muted { color: var(--fg-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* layout ----------------------------------------------------------- */
.app { flex: 1; outline: none; }
.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.sec { padding-block: clamp(48px, 7vw, 112px); position: relative; }
.sec--tight { padding-block: clamp(28px, 4vw, 56px); }
.sec--ink { background: var(--ink); color: var(--paper); }
.sec--ink .hud { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.sec--ink .hud--strong { color: var(--paper); }
.sec--accent { background: var(--accent); color: var(--accent-fg); }
.sec--accent .hud { color: color-mix(in srgb, var(--accent-fg) 70%, transparent); }
.sec--grid { background-image: var(--grid-img); background-size: var(--cell) var(--cell); background-position: center top; }
:root { --grid-img: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); }
.sec--line-top { border-top: 2px solid var(--line-strong); }
.sec--line-bottom { border-bottom: 2px solid var(--line-strong); }

.cols { display: grid; gap: var(--gutter); }
@media (min-width: 900px) {
  .cols--2 { grid-template-columns: 1fr 1fr; }
  .cols--3 { grid-template-columns: repeat(3, 1fr); }
  .cols--4 { grid-template-columns: repeat(4, 1fr); }
  .cols--side { grid-template-columns: 220px 1fr; }
  .cols--side-r { grid-template-columns: 1fr 300px; }
}

/* section head: rotated label on desktop ---------------------------- */
.sec-head {
  display: grid;
  gap: 12px 32px;
  align-items: end;
  margin-bottom: clamp(24px, 4vw, 48px);
}
.sec-head__label { display: flex; align-items: center; gap: 8px; }
.sec-head__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.sec-head__title { max-width: 14ch; }
.sec-head__aside { color: var(--fg-2); max-width: 44ch; font-size: 15px; }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: auto 1fr auto; }
  .sec-head__aside { text-align: right; }
}

/* header ----------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: var(--head-h);
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-strong);
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: 22px; letter-spacing: .02em; line-height: 1; }
.brand__mark { font-size: 24px; color: var(--accent); transition: transform var(--slow) var(--ease); display: inline-block; transform-origin: 50% 55%; }
.brand:hover .brand__mark { transform: rotate(180deg); }
.brand__en { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; color: var(--fg-2); }

.site-nav { display: flex; gap: clamp(12px, 2.4vw, 36px); justify-content: center; }
.site-nav a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 2px; position: relative; color: var(--fg-2);
}
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 2px; background: var(--accent); transition: right var(--fast) var(--ease); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav a[aria-current="page"]::after, .site-nav a:hover::after { right: 0; }

.head-tools { display: flex; align-items: center; gap: 10px; justify-self: end; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line-strong); padding: 6px 12px; border-radius: var(--pill);
  white-space: nowrap;
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .status__dot, .brand__mark { animation: none; transition: none; } }

/* route-change progress bar */
body.is-loading::before {
  content: ""; position: fixed; left: 0; top: 0; z-index: 60; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent) 0 40%, transparent 40% 100%);
  background-size: 200% 100%; animation: loadbar .9s linear infinite;
}
@keyframes loadbar { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { body.is-loading::before { animation: none; background: var(--accent); } }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding-inline: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--pill);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  transition: background var(--fast), color var(--fast);
}
.icon-btn:hover { background: var(--ink); color: var(--paper); }
.menu-btn { display: none; }

@media (max-width: 899px) {
  .site-head { grid-template-columns: auto 1fr auto; }
  .status { display: none; }
  .menu-btn { display: inline-grid; }
  .site-nav {
    position: fixed; inset: var(--head-h) 0 auto 0; z-index: 49;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 2px solid var(--line-strong);
    transform: translateY(calc(-100% - var(--head-h))); visibility: hidden;
    transition: transform var(--slow) var(--ease), visibility 0s var(--slow);
  }
  .site-nav[data-open="true"] { transform: translateY(0); visibility: visible; transition-delay: 0s; }
  .site-nav a { padding: 18px var(--gutter); border-top: 1px solid var(--line); font-size: 14px; }
  .site-nav a::after { display: none; }
}

/* footer ----------------------------------------------------------- */
.site-foot { background: var(--ink); color: var(--paper); border-top: 2px solid var(--ink); }
.foot-grid { display: grid; gap: 32px; padding-block: clamp(40px, 6vw, 72px); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr; } }
.foot__title { font-family: var(--font-display); font-size: clamp(40px, 6vw, 88px); line-height: .9; text-transform: uppercase; }
.foot__links a { display: block; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 0; color: color-mix(in srgb, var(--paper) 80%, transparent); }
.foot__links a:hover { color: var(--accent); }
.foot__label { color: var(--accent); margin-bottom: 10px; }
.foot__bottom { border-top: 1px solid color-mix(in srgb, var(--paper) 20%, transparent); padding-block: 16px 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.foot__legal { font-size: 12px; color: color-mix(in srgb, var(--paper) 60%, transparent); max-width: 70ch; line-height: 1.5; }
.barcode {
  height: 36px; width: 180px;
  background: repeating-linear-gradient(90deg, var(--paper) 0 2px, transparent 2px 4px, var(--paper) 4px 5px, transparent 5px 9px, var(--paper) 9px 12px, transparent 12px 14px);
  position: relative;
}
.barcode::after { content: attr(data-code); position: absolute; left: 0; right: 0; bottom: -16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .3em; color: color-mix(in srgb, var(--paper) 60%, transparent); }

.loading { padding: 80px var(--gutter); text-align: center; }
