/* ============================================================
   Chiritsumo — Modern Redesign · Shared stylesheet
   ------------------------------------------------------------
   Neutral, editorial, type-led. CSS-generated abstract imagery.
   Three color palettes toggleable via [data-palette] on <html>.
   ============================================================ */

/* Palettes ---------------------------------------------------*/
:root,
:root[data-palette="warm"] {
  --bg:         oklch(0.985 0.006 80);
  --bg-2:       oklch(0.955 0.008 80);
  --ink:        oklch(0.18 0.01 70);
  --ink-2:      oklch(0.38 0.008 70);
  --ink-3:      oklch(0.58 0.006 70);
  --rule:       oklch(0.88 0.005 70);
  --rule-2:     oklch(0.93 0.004 70);
  --accent:     oklch(0.55 0.13 48);   /* terracotta */
  --accent-ink: oklch(0.98 0.006 80);
  --grad-a:     oklch(0.88 0.08 60);
  --grad-b:     oklch(0.78 0.10 35);
  --grad-c:     oklch(0.92 0.03 80);
}
:root[data-palette="cool"] {
  --bg:         oklch(0.985 0.003 240);
  --bg-2:       oklch(0.955 0.005 240);
  --ink:        oklch(0.18 0.01 250);
  --ink-2:      oklch(0.38 0.008 250);
  --ink-3:      oklch(0.58 0.006 250);
  --rule:       oklch(0.88 0.005 240);
  --rule-2:     oklch(0.93 0.004 240);
  --accent:     oklch(0.52 0.12 240);  /* navy */
  --accent-ink: oklch(0.98 0.003 240);
  --grad-a:     oklch(0.85 0.06 220);
  --grad-b:     oklch(0.75 0.09 260);
  --grad-c:     oklch(0.92 0.02 240);
}
:root[data-palette="mono"] {
  --bg:         oklch(0.98 0.002 0);
  --bg-2:       oklch(0.95 0.002 0);
  --ink:        oklch(0.15 0.002 0);
  --ink-2:      oklch(0.38 0.002 0);
  --ink-3:      oklch(0.60 0.002 0);
  --rule:       oklch(0.88 0.002 0);
  --rule-2:     oklch(0.93 0.002 0);
  --accent:     oklch(0.18 0.002 0);
  --accent-ink: oklch(0.98 0.002 0);
  --grad-a:     oklch(0.90 0.002 0);
  --grad-b:     oklch(0.75 0.002 0);
  --grad-c:     oklch(0.95 0.002 0);
}

/* Reset + base ----------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Typography ------------------------------------------------*/
.serif { font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif; font-weight: 500; letter-spacing: 0.01em; }
.mono  { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ink-3);
  display: inline-block;
}

h1.display, .display {
  font-family: "Noto Serif JP", serif;
  font-weight: 500;
  font-size: clamp(42px, 6.2vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
h2.section {
  font-family: "Noto Serif JP", serif;
  font-weight: 500;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h3.sub {
  font-family: "Noto Serif JP", serif;
  font-weight: 500;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
p.lead {
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.8;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 60ch;
}
p.body {
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 62ch;
}

/* Layout ----------------------------------------------------*/
.wrap {
  --pad: clamp(20px, 4vw, 56px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.hairline { height: 1px; background: var(--rule); width: 100%; }
.section-pad { padding-block: clamp(80px, 10vw, 160px); }

/* Navigation ------------------------------------------------*/
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Noto Serif JP", serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}
.brand img.logo {
  height: 28px; width: auto;
  display: block;
}
:root[data-palette="mono"] .brand img.logo { filter: none; }
.brand .tld {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
/* Footer bigger mark */
.footer .brand img.logo { height: 34px; }
.nav-links {
  display: flex; gap: 32px; justify-content: center;
  font-size: 14px;
  color: var(--ink-2);
}
.nav-links a {
  position: relative; padding: 6px 2px;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
}
.nav-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  transition: all .25s ease;
  justify-self: end;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--ink); color: var(--bg);
}
.nav-cta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transition: transform .25s ease;
}
.nav-cta:hover .dot { transform: scale(1.4); background: var(--accent-ink); }

/* Hero ------------------------------------------------------*/
.hero {
  position: relative;
  padding-top: clamp(60px, 8vw, 120px);
  padding-bottom: clamp(80px, 10vw, 140px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.hero h1 { margin-bottom: 32px; }
.hero .lead { margin-bottom: 48px; }

.hero-meta {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.hero-meta .cell .k {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block; margin-bottom: 8px;
}
.hero-meta .cell .v {
  font-family: "Noto Serif JP", serif;
  font-size: 20px;
  color: var(--ink);
}

.hero-art {
  aspect-ratio: 4 / 5;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg-2);
}

/* CSS-generated abstract imagery ----------------------------*/
.art-gradient {
  background:
    radial-gradient(60% 50% at 70% 30%, var(--grad-b) 0%, transparent 60%),
    radial-gradient(80% 70% at 20% 80%, var(--grad-a) 0%, transparent 65%),
    linear-gradient(180deg, var(--grad-c) 0%, var(--bg-2) 100%);
}
.art-rings {
  background:
    radial-gradient(circle at 50% 60%, transparent 0 28%, var(--ink) 28% 28.3%, transparent 28.3% 40%, var(--ink-3) 40% 40.3%, transparent 40.3% 58%, var(--rule) 58% 58.3%, transparent 58.3%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
.art-grid {
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg-2);
  position: relative;
}
.art-grid::after {
  content: "";
  position: absolute; inset: 20% 25% 30% 15%;
  background: radial-gradient(60% 60% at 40% 50%, var(--grad-b), transparent 70%);
  filter: blur(20px);
  mix-blend-mode: multiply;
  opacity: .7;
}

/* Stats strip -----------------------------------------------*/
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stats .cell {
  padding: 40px 32px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 8px;
}
.stats .cell:last-child { border-right: 0; }
.stats .n {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stats .n sup {
  font-family: "JetBrains Mono", monospace;
  font-size: .3em;
  color: var(--ink-3);
  vertical-align: top;
  margin-left: 4px;
}
.stats .k {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* Service cards ---------------------------------------------*/
.service-list { display: grid; gap: 0; }
.service-row {
  display: grid;
  grid-template-columns: 80px 1.2fr 1.4fr 120px;
  gap: 32px;
  align-items: start;
  padding: 56px 0;
  border-top: 1px solid var(--rule);
  position: relative;
  transition: background .3s ease;
}
.service-row:last-child { border-bottom: 1px solid var(--rule); }
.service-row:hover { background: var(--bg-2); }
.service-row .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  padding-top: 10px;
}
.service-row .title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.service-row .title small {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-weight: 400;
}
.service-row .desc {
  color: var(--ink-2);
  padding-top: 8px;
  font-size: 15px;
  line-height: 1.8;
}
.service-row .tag {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.service-row .tag span {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.service-row .go {
  justify-self: end; align-self: center;
  width: 52px; height: 52px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: all .3s ease;
}
.service-row:hover .go {
  background: var(--ink); color: var(--bg);
  transform: rotate(-45deg);
}

/* Process / steps -------------------------------------------*/
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  counter-reset: step;
}
.process .step {
  border-top: 1px solid var(--ink);
  padding-top: 24px;
}
.process .step .n {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  display: block;
}
.process .step h4 {
  font-family: "Noto Serif JP", serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.process .step p { color: var(--ink-2); font-size: 14px; line-height: 1.7; }

/* CTA block -------------------------------------------------*/
.cta-block {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(60px, 8vw, 120px) clamp(32px, 5vw, 80px);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.cta-block h2 { color: var(--bg); }
.cta-block p { color: color-mix(in oklch, var(--bg) 75%, var(--ink)); max-width: 50ch; }
.cta-block .cta-row { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }
.cta-block::before {
  content: "";
  position: absolute;
  right: -10%; top: -30%;
  width: 60%; height: 160%;
  background:
    radial-gradient(40% 40% at 50% 50%, color-mix(in oklch, var(--accent) 60%, transparent) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* Buttons ---------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 14px;
  transition: all .25s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--bg);
}
.btn-ghost:hover { background: color-mix(in oklch, var(--bg) 15%, transparent); }

/* Footer ----------------------------------------------------*/
.footer {
  padding-block: 80px 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-grid h5 {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
  font-weight: 400;
}
.footer-grid a { display: block; padding: 4px 0; color: var(--ink-2); transition: color .2s; }
.footer-grid a:hover { color: var(--ink); }
.footer-mark {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(60px, 8vw, 120px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-block: 60px 24px;
  overflow: hidden;
}
.footer-bottom {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  color: var(--ink-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* Scroll reveal ---------------------------------------------*/
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

.parallax { will-change: transform; transition: transform .05s linear; }

/* Tweaks panel ----------------------------------------------*/
.tweaks {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 100;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 20px;
  display: none;
  min-width: 240px;
  box-shadow: 0 20px 40px -20px oklch(0 0 0 / .15);
}
.tweaks.active { display: block; }
.tweaks h6 {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
  font-weight: 400;
  display: flex; justify-content: space-between;
}
.tweaks .swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tweaks .sw {
  height: 52px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s;
}
.tweaks .sw:hover { transform: translateY(-2px); }
.tweaks .sw.active { outline: 2px solid var(--ink); outline-offset: 2px; }
.tweaks .sw-label {
  position: absolute; left: 6px; bottom: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-transform: uppercase;
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  padding: 2px 4px;
  border-radius: 2px;
}
.sw-warm { background: linear-gradient(135deg, oklch(0.985 0.006 80) 50%, oklch(0.55 0.13 48) 50%); }
.sw-cool { background: linear-gradient(135deg, oklch(0.985 0.003 240) 50%, oklch(0.52 0.12 240) 50%); }
.sw-mono { background: linear-gradient(135deg, oklch(0.98 0.002 0) 50%, oklch(0.15 0.002 0) 50%); }

/* Responsive ------------------------------------------------*/
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { aspect-ratio: 4/3; }
  .service-row { grid-template-columns: 60px 1fr; gap: 20px; }
  .service-row .desc, .service-row .go { grid-column: 2 / -1; }
  .service-row .go { justify-self: start; margin-top: 12px; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .cell:nth-child(2) { border-right: 0; }
  .stats .cell:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
