/* Wakatsuki & Partners — v2 */
:root {
  --paper: #ffffff;
  --fog: #f3f4f4;
  --charcoal: #383b3c;
  --ink: #1f2223;
  --slate: #737a7c;
  --line: #e3e5e6;
  --amber: #e89c3a;
  --max: 1200px;
  --dot: "Doto", "Zen Kaku Gothic New", monospace;
  --ja: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--ja); font-size: 16px; line-height: 1.9;
  font-feature-settings: "palt" 1; letter-spacing: .02em;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.wrap { width: min(100% - 40px, var(--max)); margin-inline: auto; }

/* Dot-matrix label — echoes the logo's dotted lettering */
.dot-label {
  font-family: var(--dot); font-weight: 800; font-size: 1.05rem;
  letter-spacing: .08em; color: var(--charcoal); margin: 0 0 20px;
  display: flex; align-items: center; gap: 10px;
}
.dot-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.on-dark .dot-label { color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo-h { height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: 34px; }
.nav a { text-decoration: none; font-size: .88rem; font-weight: 500; color: var(--charcoal); position: relative; }
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--charcoal);
  transition: right .25s;
}
.nav a:not(.nav-cta):hover::after { right: 0; }
.nav-cta { border: 1px solid var(--charcoal); padding: 8px 20px; border-radius: 999px; transition: background .2s, color .2s; }
.nav-cta:hover { background: var(--charcoal); color: #fff !important; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .site-header { background: rgba(255,255,255,.95); border-color: var(--line); }
  .site-header .wrap { height: 64px; }
  .logo-h { height: 28px; }
  .menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0 10px; border: 0; background: transparent; cursor: pointer;
  }
  .menu-btn span { display: block; height: 1.5px; background: var(--charcoal); transition: transform .25s; }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 64px 0 auto 0; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 24px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a::after { display: none; }
  .nav-cta { margin-top: 18px; text-align: center; border-radius: 999px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 120px 0 80px; overflow: hidden; background: var(--paper);
}
#dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; }
.hero-inner { max-width: 720px; }
.hero h1 {
  margin: 0; font-weight: 700; color: var(--ink);
  font-size: clamp(2.4rem, 6.4vw, 5.2rem); line-height: 1.28; letter-spacing: .03em;
}
.hero-lead {
  margin: 36px 0 0; max-width: 30em; color: var(--slate);
  font-size: clamp(.98rem, 1.3vw, 1.08rem);
}
.hero-actions { margin-top: 48px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--charcoal); color: #fff; text-decoration: none; font-weight: 700;
  padding: 16px 30px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--ja); font-size: .95rem; transition: background .2s;
}
.btn:hover { background: var(--ink); }
.btn .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.text-link { font-size: .92rem; font-weight: 500; color: var(--charcoal); text-underline-offset: 6px; }
.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 28px;
}
.hero-foot .wrap { display: flex; justify-content: space-between; font-size: .78rem; color: var(--slate); }

/* hero reveal — the page's single orchestrated motion */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal.d1 { animation-delay: .15s; } .reveal.d2 { animation-delay: .35s; } .reveal.d3 { animation-delay: .55s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
section { scroll-margin-top: 76px; }
.sec { padding: clamp(96px, 13vw, 168px) 0; }
.sec-title {
  margin: 0 0 clamp(48px, 7vw, 88px); font-weight: 700; color: var(--ink);
  font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.45;
}

/* Philosophy */
.philosophy { border-top: 1px solid var(--line); }
.statement {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px;
  padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line);
}
.statement:last-child { border-bottom: 1px solid var(--line); }
.statement .dot-label { margin: 6px 0 0; }
.statement p {
  margin: 0; font-size: clamp(1.15rem, 2.1vw, 1.55rem); line-height: 1.9; font-weight: 500; color: var(--charcoal);
  max-width: 34em;
}
@media (max-width: 720px) { .statement { grid-template-columns: 1fr; gap: 14px; } }

/* Services */
.services { background: var(--fog); }
.svc-row {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: baseline;
  padding: 40px 0; border-top: 1px solid #d7dadb;
}
.svc-row:last-child { border-bottom: 1px solid #d7dadb; }
.svc-row h3 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 700; color: var(--ink); }
.svc-row p { margin: 0; color: var(--slate); }
@media (max-width: 720px) { .svc-row { grid-template-columns: 1fr; gap: 10px; padding: 30px 0; } }

/* Projects — dark band */
.projects { background: var(--charcoal); color: #fff; }
.projects .sec-title { color: #fff; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.feature h3 { margin: 0 0 20px; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.5; font-weight: 700; }
.feature p { margin: 0; color: #c3c8ca; }
.chip {
  display: inline-block; font-size: .75rem; font-weight: 700; color: var(--amber);
  border: 1px solid rgba(232,156,58,.5); padding: 2px 12px; border-radius: 999px; margin-bottom: 18px;
}

.bridge { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; }
.node {
  width: clamp(84px, 9vw, 112px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  border: 1px solid rgba(255,255,255,.35); font-weight: 700; font-size: 1rem; line-height: 1.3;
}
.node small { display: block; font-size: .66rem; font-weight: 500; color: #aab1b3; }
.node.core {
  width: clamp(124px, 13vw, 160px); background: var(--amber); color: var(--ink); border: 0;
  box-shadow: 0 0 0 10px rgba(232,156,58,.14), 0 0 0 22px rgba(232,156,58,.06);
}
.node.core small { color: rgba(31,34,35,.7); }
.wire {
  height: 4px; margin: 0 6px;
  background-image: radial-gradient(circle, rgba(255,255,255,.7) 1.6px, transparent 2px);
  background-size: 10px 4px; background-repeat: repeat-x; background-position: 0 center;
  animation: flow 1.6s linear infinite;
}
.wire.rev { animation-direction: reverse; }
@keyframes flow { to { background-position: 20px center; } }
@media (prefers-reduced-motion: reduce) { .wire { animation: none; } }

.cases { margin-top: clamp(64px, 8vw, 104px); border-top: 1px solid rgba(255,255,255,.18); }
.case {
  display: grid; grid-template-columns: 220px 1fr auto; gap: 40px; align-items: baseline;
  padding: 30px 0; border-bottom: 1px solid rgba(255,255,255,.18);
}
.case .k { font-size: .8rem; color: #aab1b3; }
.case h4 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.case .what { color: #c3c8ca; font-size: .95rem; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 460px) {
  .bridge { grid-template-columns: 1fr; justify-items: center; }
  .wire { width: 4px; height: 36px; margin: 6px 0; background-size: 4px 10px; background-repeat: repeat-y; animation: none; }
}

/* Company */
.company-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.company-logo { width: min(100%, 260px); position: sticky; top: 120px; }
dl.profile { margin: 0; border-top: 1px solid var(--ink); }
dl.profile > div { display: grid; grid-template-columns: 8em 1fr; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); }
dl.profile dt { font-weight: 700; font-size: .9rem; color: var(--charcoal); }
dl.profile dd { margin: 0; }
.addr + .addr { margin-top: 20px; }
.addr .k { display: block; font-size: .78rem; font-weight: 700; color: var(--slate); }
.addr a { font-size: .82rem; color: var(--slate); text-underline-offset: 4px; }
.addr a:hover { color: var(--ink); }
@media (max-width: 820px) {
  .company-grid { grid-template-columns: 1fr; }
  .company-logo { position: static; width: 160px; }
}
@media (max-width: 480px) { dl.profile > div { grid-template-columns: 1fr; gap: 4px; } }

/* Contact */
.contact { background: var(--fog); }
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(40px, 7vw, 120px); }
.contact-note p { margin: 0 0 16px; color: var(--slate); }
.field { margin-bottom: 30px; }
.field label { display: block; font-size: .85rem; font-weight: 700; color: var(--charcoal); margin-bottom: 4px; }
.req { color: var(--amber); font-weight: 700; margin-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 0; border: 0; border-bottom: 1px solid #c4c9cb; background: transparent; border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--charcoal) 50%), linear-gradient(135deg, var(--charcoal) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--charcoal); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--slate); margin: 0 0 32px; }
.consent input { width: 18px; height: 18px; margin-top: 5px; flex: none; accent-color: var(--charcoal); }
.hidden { position: absolute; left: -9999px; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; gap: 0; } }

/* Footer */
.site-footer { background: var(--ink); color: #9aa1a3; padding: 56px 0 40px; font-size: .8rem; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.site-footer img { height: 40px; width: auto; }

/* Simple pages */
.simple { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px 20px 80px; }
.simple h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 16px; }
.simple p { color: var(--slate); margin: 0 0 40px; }

/* --- revisions: recent projects --- */
.fn { font-size: .55em; font-weight: 500; color: #aab1b3; margin-left: 2px; vertical-align: super; line-height: 0; }
.case-feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: end;
  margin-top: clamp(64px, 8vw, 104px); padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid rgba(255,255,255,.18);
}
.case-feature h3 { margin: 0; font-size: clamp(1.3rem, 2.3vw, 1.75rem); line-height: 1.5; font-weight: 700; }
.case-feature .chip { margin-bottom: 14px; }
.case-feature p { margin: 0; color: #c3c8ca; }
.notes {
  list-style: none; margin: clamp(56px, 7vw, 88px) 0 0; padding: 20px 0 0;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: .76rem; line-height: 1.8; color: #9aa1a3;
}
.notes li { padding-left: 2.2em; text-indent: -2.2em; }
@media (max-width: 860px) { .case-feature { grid-template-columns: 1fr; gap: 12px; } }

/* --- mobile tap targets & small labels --- */
.site-header .wrap > a { display: inline-flex; align-items: center; min-height: 44px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; }
.addr a { display: inline-block; padding: 10px 0; }
@media (max-width: 460px) { .node small { font-size: .72rem; } }

/* --- Japanese headings: break only at natural phrase boundaries --- */
h1, h2, h3, h4 { word-break: keep-all; overflow-wrap: anywhere; }
@supports (word-break: auto-phrase) { h1, h2, h3, h4 { word-break: auto-phrase; } }

/* --- mobile menu: keep the CTA pill's full outline --- */
@media (max-width: 820px) { .nav .nav-cta { border-bottom-color: var(--charcoal); } }
br.sp { display: none; }
@media (max-width: 520px) { br.sp { display: inline; } }
