/* Layout: 門 — one left-aligned axis, oversized type, 160px of 間 between sections, hairlines instead of boxes. Dark-first (Sumi), light = Washi. */
:root {
  --surface: #0a0a0b; --raised: #141416; --sunken: #050506;
  --line: #2a2a2d; --line-strong: #646469;
  --ink: #f4f3ef; --muted: #8e8e93; --on-ink: #0a0a0b;
  --beni: #e0102f; --beni-text: #ff3b55; --on-beni: #ffffff;
  --ghost: #151517; --nav-bg: rgba(10,10,11,.74);
  --f-sans: "Geist", "SF Pro Display", -apple-system, system-ui, sans-serif;
  --f-mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --f-jp: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --f-min: "Shippori Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --ease-out: cubic-bezier(.16,1,.3,1); --ease-ink: cubic-bezier(.7,0,.2,1);
  --gutter: clamp(16px, 5vw, 64px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --surface: #f4f3ef; --raised: #ffffff; --sunken: #eae9e4;
    --line: #d8d7d2; --line-strong: #85858a;
    --ink: #0a0a0b; --muted: #5e5e63; --on-ink: #f4f3ef;
    --beni: #e0102f; --beni-text: #c80a27; --on-beni: #ffffff;
    --ghost: #e9e8e3; --nav-bg: rgba(244,243,239,.8);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --surface: #f4f3ef; --raised: #ffffff; --sunken: #eae9e4;
  --line: #d8d7d2; --line-strong: #85858a;
  --ink: #0a0a0b; --muted: #5e5e63; --on-ink: #f4f3ef;
  --beni: #e0102f; --beni-text: #c80a27; --on-beni: #ffffff;
  --ghost: #e9e8e3; --nav-bg: rgba(244,243,239,.8);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--surface); color: var(--ink); font-family: var(--f-sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.label { font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.jp { font-family: var(--f-jp); letter-spacing: .3em; }
.period { color: var(--beni-text); }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }

/* nav */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--nav-bg); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.brand { display: inline-flex; color: var(--ink); line-height: 0; }
.brand svg { height: 22px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .16s var(--ease-out); }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-color .16s var(--ease-out); }
.icon-btn:hover { border-color: var(--line-strong); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 26px; border-radius: 999px; font: 500 15px/1 var(--f-sans); letter-spacing: -.01em; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: opacity .16s var(--ease-out), border-color .16s var(--ease-out), background-color .16s var(--ease-out); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-beni { background: var(--beni); color: var(--on-beni); }
.btn-primary:hover, .btn-beni:hover { opacity: .88; }
.btn-secondary { color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--ink); }
.custom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; padding: 22px 24px; border-radius: 20px; border: 1px solid var(--line); }
.custom p { color: var(--muted); }
.custom b { color: var(--ink); font-weight: 500; }
.btn .arr { transition: transform .16s var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }

/* hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 10vw, 128px) clamp(72px, 10vw, 140px); }
.hero-kanji { position: absolute; right: var(--gutter); top: clamp(40px, 7vw, 96px); writing-mode: vertical-rl; white-space: nowrap; font-family: var(--f-min); font-weight: 600; font-size: clamp(96px, 15vw, 210px); line-height: 1; color: var(--ghost); user-select: none; pointer-events: none; }
.hero-inner { position: relative; display: flex; flex-direction: column; gap: 32px; max-width: 980px; }
.gate { width: clamp(76px, 10vw, 120px); height: auto; color: var(--ink); overflow: visible; }
.gate .k { transform-box: fill-box; transform-origin: 0 50%; animation: drawX .9s var(--ease-ink) .15s both; }
.gate .pl { transform-box: fill-box; transform-origin: 50% 0; animation: drawY .8s var(--ease-ink) .75s both; }
.gate .pr { transform-box: fill-box; transform-origin: 50% 0; animation: drawY .8s var(--ease-ink) .84s both; }
@keyframes drawX { from { transform: scaleX(0) } to { transform: scaleX(1) } }
@keyframes drawY { from { transform: scaleY(0) } to { transform: scaleY(1) } }
.hero h1 { font-size: clamp(52px, 11vw, 150px); line-height: .92; letter-spacing: -.055em; }
.reveal-line { display: block; overflow: hidden; padding-bottom: .06em; }
.reveal-line > span { display: inline-block; animation: rise .9s var(--ease-out) .1s both; }
@keyframes rise { from { transform: translateY(100%) } to { transform: none } }
.lead { font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: var(--muted); max-width: 34ch; }
.lead strong { color: var(--ink); font-weight: 500; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 640px; }

/* sections */
.section { padding-block: clamp(88px, 12vw, 160px); border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 820px; }
.sec-head h2 { font-size: clamp(38px, 6vw, 72px); line-height: 1; letter-spacing: -.045em; }
.sec-head p { font-size: 19px; color: var(--muted); max-width: 52ch; }

/* products */
.prods { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.prod { display: grid; grid-template-columns: 120px minmax(0, 1.1fr) minmax(0, 1.4fr) 40px; align-items: center; gap: 24px; padding: 36px 20px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background-color .32s var(--ease-out); }
.prod:hover { background: var(--raised); }
.prod-kanji { font-family: var(--f-min); font-weight: 600; font-size: 56px; line-height: 1; white-space: nowrap; transition: transform .32s var(--ease-out); }
.prod:hover .prod-kanji { transform: translateX(6px); }
.prod-name { display: flex; flex-direction: column; gap: 8px; }
.prod-name h3 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; line-height: 1.05; }
.prod-desc { font-size: 17px; color: var(--muted); }
.prod-arr { justify-self: end; font-size: 22px; color: var(--muted); transition: transform .32s var(--ease-out), color .32s var(--ease-out); }
.prod:hover .prod-arr { transform: translateX(4px); color: var(--ink); }

/* dev */
.dev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.dev .sec-head { margin-bottom: 0; }
.code { background: var(--sunken); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font: 12px var(--f-mono); color: var(--muted); }
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-strong); }
.code pre { margin: 0; padding: 28px 24px; overflow-x: auto; font: 14.5px/1.75 var(--f-mono); color: var(--ink); }
.code .c { color: var(--muted); }
.code-note { padding: 0 24px 22px; font-size: 13px; color: var(--muted); }

/* principles */
.princ { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.p { padding: 32px 28px 8px 0; display: flex; flex-direction: column; gap: 14px; }
.p + .p { padding-left: 28px; border-left: 1px solid var(--line); }
.p-k { font-family: var(--f-min); font-weight: 600; font-size: 64px; line-height: 1; }
.p h3 { font-size: 20px; letter-spacing: -.01em; }
.p p { font-size: 15px; color: var(--muted); }

/* founders */
.team { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.member { display: flex; flex-direction: column; gap: 22px; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--raised); }
.seal { align-self: flex-start; font-family: var(--f-jp); font-weight: 700; font-size: 22px; letter-spacing: .06em; line-height: 1; padding: 12px 14px; border-radius: 6px; }
.seal-head { background: var(--beni); color: var(--on-beni); }
.seal-crew { color: var(--beni-text); box-shadow: inset 0 0 0 2px var(--beni-text); }
.member h3 { font-size: 26px; letter-spacing: -.02em; }
.member .role { display: flex; flex-direction: column; gap: 6px; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.contact h2 { font-size: clamp(52px, 10vw, 128px); line-height: .92; letter-spacing: -.055em; }
.mailbox { display: flex; flex-direction: column; gap: 16px; }
.mail { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 22px; border: 1px solid var(--line-strong); border-radius: 999px; font: 16px var(--f-mono); min-width: 0; }
.mail span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.socials { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.socials a { color: var(--muted); text-decoration: none; }
.socials a:hover { color: var(--ink); }

/* footer */
footer { border-top: 1px solid var(--line); padding-block: 40px 56px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
footer .brand svg { height: 18px; }
.foot-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); }
.foot-meta a { color: var(--muted); text-decoration: none; }
.foot-meta a:hover { color: var(--ink); }

/* scroll reveal: content is visible at rest; only below-the-fold blocks get .pre at load */
.pre { opacity: 0; transform: translateY(24px); }
[data-reveal] { transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .prod { grid-template-columns: 76px minmax(0, 1fr) 24px; padding: 28px 8px; row-gap: 12px; }
  .prod-arr { grid-row: 1; grid-column: 3; }
  .prod-desc { grid-column: 2 / 4; }
  .prod-kanji { font-size: 34px; }
  .dev, .contact { grid-template-columns: minmax(0, 1fr); }
  .princ, .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p:nth-child(3) { padding-left: 0; border-left: 0; }
  .p:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .princ, .team { grid-template-columns: minmax(0, 1fr); }
  .p + .p { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .hero-kanji { opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .pre { opacity: 1; transform: none; }
}
