:root {
  /* Blueline palette: white paper, indigo ink, and the non-photo blue
     pencil manga artists draw underdrawings with. */
  --paper: #ffffff;
  --paper-2: #f1f6f9;
  --ink: #13203a;
  --ink-soft: #56637a;
  --rule: #dce3ea;
  --blueline: #6cc4e8;   /* decorative strokes only (1.96:1) */
  --accent: #1677ae;     /* text-safe on paper and paper-2 (>= 4.5:1) */
  --accent-ink: #ffffff;

  --font-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-latin: "Space Grotesk", var(--font-ja);

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --space-section: clamp(4.5rem, 3rem + 7vw, 9rem);
  --text-hero: clamp(1.7rem, 1.1rem + 4.2vw, 4.6rem);
  --text-base: clamp(0.98rem, 0.94rem + 0.2vw, 1.06rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-draw: 1800ms;
  --duration-fast: 160ms;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1322;
    --paper-2: #121d31;
    --ink: #e9eff7;
    --ink-soft: #95a3b9;
    --rule: #24324a;
    --blueline: #2a5876;
    --accent: #6cc4e8;
    --accent-ink: #0b1322;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: var(--text-base);
  line-height: 1.9;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 200;
}
.skip-link:focus { top: 0.75rem; }

.sprite { position: absolute; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}
.brand-mark { width: 1.6rem; height: 1.6rem; }

.site-header ul {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2.2rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.site-header nav a {
  position: relative;
  text-decoration: none;
  padding-block: 0.25rem;
}
.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-fast) var(--ease-out);
}
.site-header nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(92svh, 820px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4rem, 10vh, 7rem) var(--gutter) 0;
  overflow: hidden;
  isolation: isolate;
}

.hero-curves {
  position: absolute;
  left: 0;
  bottom: 14%;
  width: 100%;
  height: 46%;
  z-index: -1;
}
.curve {
  fill: none;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw var(--duration-draw) var(--ease-out) forwards;
}
.curve-a { stroke: var(--blueline); }
.curve-b { stroke: var(--accent); animation-delay: 180ms; }
.node {
  fill: var(--accent);
  opacity: 0;
  transform-origin: 600px 300px;
  animation: pop 500ms var(--ease-out) 1100ms forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 1; transform: scale(1); }
}

.hero-inner { max-width: 62rem; }

.kicker {
  margin: 0 0 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0;
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  font-feature-settings: "palt";
}
.hero h1 span { display: inline-block; }
.hero h1 span:first-child { display: block; }

.lead {
  margin: 1.8rem 0 0;
  max-width: 30rem;
  color: var(--ink-soft);
}

.wordmark {
  margin: clamp(3rem, 8vh, 5rem) 0 0;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: clamp(4rem, 19.5vw, 19rem);
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--blueline);
  white-space: nowrap;
  transform: translateY(0.12em);
  user-select: none;
}

/* ---------- sections ---------- */
.section {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 3fr;
  gap: 2rem clamp(2rem, 6vw, 6rem);
  padding: var(--space-section) var(--gutter);
  border-top: 1px solid var(--rule);
}

.section-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-self: start;
  position: sticky;
  top: 6rem;
}
.section-num {
  font-family: var(--font-latin);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.14em;
}
.section-label h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* service */
.service {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem clamp(2rem, 5vw, 4rem);
  padding: clamp(1.8rem, 4vw, 3.2rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 10px 10px 0 -1px var(--paper), 10px 10px 0 0 var(--blueline);
}

.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.dot {
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

.service-name {
  margin: 0;
  font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
}
.service-tagline {
  margin: 0.8rem 0 0;
  font-weight: 500;
}

.service-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.6rem;
  color: var(--ink-soft);
}
.service-body p { margin: 0; }

.button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.3rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 2px;
  transition: background-color var(--duration-fast), transform var(--duration-fast) var(--ease-out);
}
.button svg {
  width: 0.95rem; height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  transition: transform var(--duration-fast) var(--ease-out);
}
.button:hover { background: var(--accent); color: var(--accent-ink); }
.button:hover svg { transform: translate(2px, -2px); }
.button:active { transform: translateY(1px); }

/* profile */
.profile { margin: 0; }
.profile > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.profile > div:first-child { border-top: 1px solid var(--ink); }
.profile dt { font-weight: 500; color: var(--ink-soft); font-size: 0.9rem; padding-top: 0.1em; }
.profile dd { margin: 0; }

/* contact */
.contact-body p { margin: 0 0 1.6rem; color: var(--ink-soft); }
.mail {
  display: inline-block;
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: clamp(1.5rem, 0.9rem + 3.2vw, 3.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size 400ms var(--ease-out), color var(--duration-fast);
  padding-bottom: 0.1em;
}
.mail:hover { background-size: 100% 2px; color: var(--accent); }

/* footer */
.site-footer {
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--rule);
  font-family: var(--font-latin);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.site-footer p { margin: 0; }

/* 404 */
.notfound {
  min-height: 70svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem var(--gutter);
}
.notfound .code {
  margin: 0;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: clamp(5rem, 20vw, 12rem);
  line-height: 1;
  color: var(--accent);
}
.notfound h1 { margin: 1rem 0 0.5rem; font-size: 1.4rem; }
.notfound a { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero { min-height: auto; padding-top: 5rem; }
  .hero-curves { bottom: 9%; height: 20%; }
  .wordmark { margin-top: 9rem; }
  .section { grid-template-columns: 1fr; }
  .section-label { position: static; flex-direction: row; align-items: baseline; gap: 0.9rem; }
  .service { grid-template-columns: 1fr; box-shadow: 6px 6px 0 -1px var(--paper), 6px 6px 0 0 var(--blueline); }
  .profile > div { grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
}

@media (max-width: 420px) {
  .site-header { flex-wrap: wrap; row-gap: 0.4rem; }
  .site-header ul { gap: 0.9rem; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .curve, .node { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .dot { animation: none; }
  * { transition-duration: 0ms !important; }
}
