/* ==========================================================
   Syrentre — style.css
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #111;
  --muted: #71717a;
  --line: #e4e4e7;
  --bg: #fff;
  --green: #2e7d32;
  --purple: #6b4c9a;

  --sans: "Inter", "Noto Sans JP", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --w: 640px;          /* content width */
  --gutter: 24px;
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--green); color: #fff; }

/* ---------- Scrollbar ----------
   Pixel rail built from the logo: grey dots, a green trunk that grows as you
   scroll, and a purple pixel at the tip. Only on mouse/trackpad devices;
   touch devices keep the native overlay scrollbar. */
html.pxbar { scrollbar-width: none; }
html.pxbar::-webkit-scrollbar { display: none; }
.pxbar-rail {
  position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: 22px;
  padding: 12px 8px; cursor: pointer; touch-action: none;
}
.pxbar-track, .pxbar-fill {
  position: absolute; left: 8px; top: 12px; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--c) 0 6px, transparent 6px 10px);
}
.pxbar-track { --c: #e4e4e7; bottom: 12px; }
.pxbar-fill { --c: var(--green); height: 0; }
.pxbar-head { position: absolute; left: 8px; top: 12px; width: 6px; height: 6px; background: var(--purple); }
.pxbar-rail:hover .pxbar-track, .pxbar-rail.is-drag .pxbar-track { --c: #c4c4c8; }
.pxbar-rail:hover .pxbar-head, .pxbar-rail.is-drag .pxbar-head { box-shadow: -10px 0 0 var(--purple), 10px 0 0 var(--purple); }

/* ---------- Language switch ---------- */
html[lang="ja"] [lang="en"],
html[lang="en"] [lang="ja"] { display: none; }

/* ---------- Links & focus ---------- */
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .15s; }
a:hover { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */
.container { max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); position: relative; }
.site-header .logo img { height: 42px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.site-header .container { gap: 24px; }
.nav { margin-left: auto; }

.nav { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--ink); }

.lang-toggle {
  background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; color: var(--muted);
  transition: color .15s, border-color .15s;
}
.lang-toggle:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: 88px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 4px;
  transition: border-color .15s, color .15s;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill b { font-weight: 500; font-size: 12px; color: #fff; background: var(--ink); border-radius: 999px; padding: 1px 8px; }

h1 {
  margin-top: 28px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.025em;
}

/* ---------- Sections ---------- */
section { margin-top: 72px; scroll-margin-top: calc(var(--header-h) + 16px); }
h2 {
  margin-bottom: 16px;
  font-family: var(--mono); font-weight: 400; font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
p + p { margin-top: 12px; }

/* ---------- Rows (team) ---------- */
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.row > :first-child { white-space: nowrap; }
.row > :last-child { color: var(--muted); text-align: right; font-size: 14px; }

/* ---------- Menu button (mobile) ---------- */
.menu-toggle { display: none; width: 36px; height: 36px; background: none; border: 0; cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--ink); transition: transform .2s, top .2s; }
.menu-toggle span:first-child { top: 14px; }
.menu-toggle span:last-child { top: 21px; }
.menu-open .menu-toggle span:first-child { top: 17.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 17.5px; transform: rotate(-45deg); }

/* ---------- Projects ---------- */
.projects { border-top: 1px solid var(--line); }
.project {
  display: grid; grid-template-columns: 160px 1fr auto; gap: 20px; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.project-img {
  aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden;
  background: #f4f4f5; border: 1px solid var(--line);
}
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.project h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.project p { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.project-arrow { color: var(--muted); transition: transform .15s, color .15s; }
.project:hover { color: var(--ink); }
.project:hover .project-img img { transform: scale(1.03); }
.project:hover .project-arrow { color: var(--ink); transform: translateX(3px); }

/* ---------- News ---------- */
.news { list-style: none; border-top: 1px solid var(--line); }
.news li { display: flex; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.news time { flex: none; font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 2px; }
.news a { text-decoration: underline; }

/* ---------- Contact ---------- */
.social { display: flex; gap: 20px; }

/* ---------- Policy page ---------- */
.policy h2 { margin-top: 40px; margin-bottom: 8px; font-family: var(--sans); font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.policy p, .policy li { font-size: 15px; }
.policy ul { padding-left: 1.2em; margin-top: 8px; }
.policy li + li { margin-top: 4px; }
.policy .updated { margin-top: 12px; color: var(--muted); font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  padding: 9px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s;
}
.btn:hover { background: var(--green); color: #fff; }


/* ---------- QMB Share page ---------- */
.lede { margin-top: 12px; color: var(--muted); font-size: 17px; }

.stage {
  position: relative; height: 260px; margin-top: 48px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fafafa;
}
.stage svg { display: block; }
.person { position: absolute; top: 60%; translate: 0 -50%; z-index: 2; }
.stage > .item { opacity: 0; }
.person.left { left: 8%; }
.person.right { right: 8%; transform: scaleX(-1); }
.item { position: absolute; top: 0; left: 0; will-change: transform; }

.speed { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.speed input { flex: 1; -webkit-appearance: none; appearance: none; height: 2px; background: var(--line); border-radius: 2px; outline-offset: 6px; }
.speed input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); cursor: pointer; }
.speed input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--ink); cursor: pointer; }

.steps { list-style: none; }
.steps .row { justify-content: flex-start; }
.steps .row > :last-child { color: var(--ink); text-align: left; }
.step-n { font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 32px; }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shots img { width: 100%; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 120px; border-top: 1px solid var(--line); font-size: 14px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; padding: 48px 0 40px; }
.footer-top .logo img { height: 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, auto); gap: 48px; }
.footer-cols h4 { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-cols a { display: block; text-decoration: none; color: var(--ink); line-height: 2; }
.footer-cols a:hover { color: var(--green); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.footer-bottom a { text-decoration: none; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --header-h: 64px; --gutter: 20px; }
  .site-header .logo img { height: 34px; }
  .menu-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px; font-size: 16px; color: var(--ink);
    display: none;
  }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .menu-open .nav { display: flex; }
  .menu-open .site-header { border-bottom-color: var(--line); }

  .hero { padding-top: 56px; }
  section { margin-top: 56px; }
  .row { flex-direction: column; gap: 2px; }
  .row > :last-child { text-align: left; font-size: 13px; }
  .stage { height: 240px; margin-top: 32px; }
  .speed input::-webkit-slider-thumb { width: 24px; height: 24px; }
  .speed input::-moz-range-thumb { width: 24px; height: 24px; }
  .speed input { height: 4px; }
  .person.left { left: 4%; }
  .person.right { right: 4%; }
  .steps .row { flex-direction: row; gap: 12px; }
  .shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 8px; scrollbar-width: none; }
  .shots::-webkit-scrollbar { display: none; }
  .shots::after { content: ""; flex: 0 0 calc(var(--gutter) - 12px); }
  .shots img { width: 64%; flex: none; scroll-snap-align: start; }
  .lede { font-size: 16px; }
  .project { grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
  .project-arrow { display: none; }
  .news li { flex-direction: column; gap: 2px; }
  .btn { width: 100%; justify-content: center; padding: 12px 16px; }

  .footer-top { flex-direction: column; gap: 32px; padding-top: 40px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-cols > div:last-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Easter eggs ---------- */
/* Time since launch, next to the footer logo */
.footer-top { flex-direction: column; gap: 36px; }
.footer-brand { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand .logo img { flex: none; }
.since { white-space: nowrap; }
.since { display: flex; align-items: flex-end; gap: 10px; font-family: var(--mono); color: var(--ink); line-height: 1.3; }
.since-tree { flex: none; }
.since-tree svg { display: block; shape-rendering: crispEdges; }
.since small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.since b { display: block; font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.since b i { font-style: normal; color: var(--green); }

/* Local time under team names */
.row { flex-wrap: wrap; }
.who { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; white-space: nowrap; }
.who:hover, .who[aria-expanded="true"] { color: var(--green); }
.tz { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 2px; }
.tz svg { display: block; shape-rendering: crispEdges; }
.tz svg rect { animation: px .2s steps(1, end) both; }
.tz-time { font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tz-time b { font-weight: 400; color: var(--ink); }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes px { from { opacity: 0; } }
.row[data-tz] > :nth-child(2) { color: var(--muted); text-align: right; font-size: 14px; }
.row > .tz { color: var(--ink); text-align: left; font-size: inherit; }
@media (max-width: 720px) { .row[data-tz] > :nth-child(2) { text-align: left; font-size: 13px; } }

/* ---------- Mobile polish ---------- */
a, button { -webkit-tap-highlight-color: transparent; }
:lang(ja) { word-break: auto-phrase; line-break: strict; }
.policy { margin-top: 32px; }
.policy ul + p { margin-top: 12px; }
.policy h2:first-of-type { margin-top: 48px; }
@media (max-width: 720px) {
  .lang-toggle { padding: 5px 10px; font-size: 13px; }
  .policy h2 { margin-top: 36px; }
  .policy p, .policy li { font-size: 14px; line-height: 1.8; }
  .social { gap: 24px; }
}

/* ---------- Pixel bits ---------- */
.sprout { margin-top: 28px; width: max-content; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sprout svg, .px-art svg { display: block; shape-rendering: crispEdges; }
.sprout rect { transition: fill .12s, opacity .2s; }

.news li { flex-wrap: wrap; }
.news-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.news-btn:hover, .news-btn[aria-expanded="true"] { color: var(--green); }
.px-art { flex-basis: 100%; padding: 6px 0 2px; }
.px-art rect { animation: px .15s steps(1, end) both; }
.px-art .lift { animation: lift 1.2s .9s ease-in-out both; }
@keyframes lift { 0% { transform: translateY(0); } 60% { transform: translateY(-8px); } 100% { transform: translateY(-4px); } }


/* 404 */
.nf { padding-top: 88px; }
.nf-code { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--muted); margin-top: 24px; }
.nf h1 { margin-top: 8px; }
.nf .btn { margin-top: 28px; }
@media (max-width: 720px) {
  .nf { padding-top: 56px; }
  .news li { gap: 2px; }
}
