@font-face {
  font-family: "Brown";
  src: url("../lineto-brown-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Brown";
  src: url("../lineto-brown-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #1b1b1b;
  --surface: #212121;
  --surface-2: #282828;
  --surface-3: #2e2e2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.15);
  --magenta-rgb: 255, 0, 255;
  --magenta: rgb(var(--magenta-rgb));
  --magenta-soft: rgba(var(--magenta-rgb), 0.46);
  --magenta-glow: rgba(var(--magenta-rgb), 0.2);
  --magenta-dim: rgba(var(--magenta-rgb), 0.08);
  --white: #fff;
  --ink-2: rgba(255, 255, 255, 0.74);
  --gray: #8b8b99;
  --gray-2: #50505a;
  --display: "Brown", sans-serif;
  --body: "Brown", sans-serif;
  --mono: "Courier New", monospace;
  --radius: 4px;
  --radius-card: 8px;
  --nav-h: 64px;
  --maxw: 1180px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
ul,
ol,
h1,
h2,
h3,
h4 {
  margin-top: 0;
}

ul,
ol {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.42rem;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.35s, backdrop-filter 0.35s, border-color 0.35s;
}

.topbar.scrolled {
  background: rgba(20, 20, 20, 0.88);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 30px;
  height: 30px;
}

.brand-main {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.05;
}

.brand-tag {
  display: none;
  color: var(--gray);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.1;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 18px;
  color: var(--ink-2);
  font-size: 0.84rem;
}

.nav-links a {
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--white);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 14px 22px;
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s, background 0.22s, border-color 0.22s;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--magenta);
  color: #1b1b1b;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px var(--magenta-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--border-hi);
}

.btn-ghost:hover {
  border-color: var(--magenta-soft);
  transform: translateY(-2px);
}

.hero-scene {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
  height: 760px;
  background: url("japan-seo/hero-clay.webp") center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 54%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 54%, transparent 100%);
}

.page-hero {
  position: relative;
  min-height: 620px;
  padding: calc(var(--nav-h) + 86px) 0 96px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(var(--magenta-rgb), 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--magenta-rgb), 0.045) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 10%, transparent 95%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 10%, transparent 95%);
}

.hero-grid {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 34px;
}

.kicker,
.eyebrow,
.step {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--magenta);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.h-xl,
.h-lg,
.h-md {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0;
}

.h-xl {
  max-width: 900px;
  font-size: 3rem;
  line-height: 1.02;
  margin-bottom: 22px;
}

.h-lg {
  font-size: 2.3rem;
  line-height: 1.08;
}

.h-md {
  font-size: 1.45rem;
  line-height: 1.14;
}

.accent {
  color: var(--magenta);
}

.accent-line,
.heading-line {
  display: block;
}

.lead {
  color: var(--ink-2);
  font-size: 1.04rem;
  line-height: 1.72;
  max-width: 64ch;
}

.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.quick-answer {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: 24px;
}

.quick-answer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, var(--magenta-dim), transparent 55%);
  pointer-events: none;
}

.quick-answer > * {
  position: relative;
}

.quick-answer p {
  color: var(--ink-2);
  margin-bottom: 0;
}

.sec {
  position: relative;
  z-index: 2;
  padding: 72px 0;
}

.sec.surface {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.sec-head {
  max-width: 820px;
  margin-bottom: 34px;
}

.sec-head .lead {
  margin-top: 14px;
}

.resource-grid,
.phase-grid,
.source-grid,
.faq-grid,
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.resource-card,
.phase-card,
.source-card,
.faq-card,
.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 24px 22px;
  transition: border-color 0.3s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.surface .resource-card,
.surface .phase-card,
.surface .source-card,
.surface .faq-card,
.surface .info-card {
  background: var(--bg);
}

.resource-card:hover,
.phase-card:hover,
.source-card:hover,
.faq-card:hover,
.info-card:hover {
  border-color: var(--magenta-soft);
  transform: translateY(-3px);
}

.resource-card h3,
.phase-card h3,
.source-card h3,
.faq-card h3,
.info-card h3 {
  margin-bottom: 8px;
}

.resource-card p,
.phase-card p,
.source-card p,
.faq-card p,
.info-card p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.64;
  margin-bottom: 0;
}

.source-card a,
.body-copy a,
.callout a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--magenta-soft);
  text-underline-offset: 3px;
}

.launch-lineup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.launch-step {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.launch-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
}

.launch-art img {
  max-height: 96px;
  width: auto;
  filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.34));
}

.launch-copy h3 {
  margin-bottom: 5px;
}

.launch-copy p {
  color: var(--gray);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.guide-layout {
  display: grid;
  gap: 34px;
}

.guide-layout > * {
  min-width: 0;
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 22px;
  min-width: 0;
}

.toc strong {
  display: block;
  margin-bottom: 12px;
}

.toc a {
  display: block;
  color: var(--ink-2);
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--white);
}

.body-copy {
  max-width: 790px;
  min-width: 0;
}

.body-copy h2 {
  font-size: 2rem;
  line-height: 1.12;
  margin: 0 0 14px;
}

.body-copy h3 {
  font-size: 1.24rem;
  line-height: 1.2;
  margin: 30px 0 8px;
}

.body-copy p,
.body-copy li {
  color: var(--ink-2);
  font-size: 1.02rem;
}

.body-copy section + section {
  margin-top: 56px;
}

.callout {
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(var(--magenta-rgb), 0.09), rgba(255, 255, 255, 0.03));
  padding: 22px;
  margin: 24px 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.checklist li {
  position: relative;
  padding: 14px 14px 14px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 18px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--magenta);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  padding: 15px;
  color: var(--ink-2);
}

th {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
}

tr:last-child td {
  border-bottom: 0;
}

.market-band {
  position: relative;
  overflow: hidden;
  background: #181818;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.market-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(24, 24, 24, 0.08), rgba(24, 24, 24, 0.82)),
    url("japan-seo/market-mega/market-mega-seam-veil-1200.webp") center / cover no-repeat,
    url("japan-seo/hero-clay.webp") center / cover no-repeat,
    #181818;
  opacity: 0.64;
}

.market-band .wrap {
  position: relative;
  z-index: 1;
}

.cta-shell {
  position: relative;
  overflow: hidden;
  background: #151313;
}

.cta-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("japan-seo/cta-clay-waves.webp") center bottom / cover no-repeat;
}

.cta-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 49%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.44) 44%, rgba(0, 0, 0, 0.66) 100%),
    linear-gradient(180deg, rgba(15, 15, 15, 0.38) 0%, rgba(15, 15, 15, 0.16) 42%, rgba(15, 15, 15, 0.42) 100%);
}

.cta-band {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 110px 0 118px;
}

.cta-inner {
  max-width: 720px;
  margin: 0 auto;
}

.cta-inner p {
  color: var(--ink-2);
  max-width: 48ch;
  margin: 16px auto 0;
}

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 38px 0;
}

.foot-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.foot-links a {
  color: var(--gray);
  font-size: 0.82rem;
  transition: color 0.2s;
}

.foot-links a:hover {
  color: var(--white);
}

.foot-copy {
  color: var(--gray-2);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.petal {
  position: fixed;
  top: -12vh;
  width: 20px;
  height: 20px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: center / contain no-repeat url("japan-seo/sakura-flower-clay-128.png");
  filter: saturate(1.02) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
  transform: translate3d(0, -12vh, 0) rotate(var(--r0, 0deg)) scale(var(--scale, 1));
  animation: fall var(--dur, 18s) cubic-bezier(0.4, 0.1, 0.6, 0.9) var(--delay, 0s) infinite;
  will-change: transform, opacity;
}

@keyframes fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(var(--r0, 0deg)) scale(var(--scale, 1));
    opacity: 0;
  }
  8% {
    opacity: var(--op, 0.2);
  }
  34% {
    transform: translate3d(calc(var(--drift, 8vw) * 0.36 + var(--sway, 4vw)), 34vh, 0) rotate(80deg) scale(var(--scale, 1));
  }
  62% {
    transform: translate3d(calc(var(--drift, 8vw) * 0.62 - var(--sway, 4vw)), 64vh, 0) rotate(170deg) scale(calc(var(--scale, 1) * 0.9));
  }
  100% {
    transform: translate3d(var(--drift, 8vw), 114vh, 0) rotate(260deg) scale(var(--scale, 1));
    opacity: 0;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.d1 {
  transition-delay: 0.08s;
}

.d2 {
  transition-delay: 0.16s;
}

.d3 {
  transition-delay: 0.24s;
}

.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  transform: translateY(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-cta.show {
  transform: translateY(0);
}

.mobile-cta .btn {
  width: 100%;
}

@media (min-width: 620px) {
  .wrap {
    padding: 0 30px;
  }

  .h-xl {
    font-size: 4rem;
  }

  .resource-grid,
  .phase-grid,
  .source-grid,
  .faq-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .launch-lineup {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 28px;
  }
}

@media (min-width: 880px) {
  :root {
    --nav-h: 68px;
  }

  .wrap {
    padding: 0 40px;
  }

  .brand-tag,
  .nav-links {
    display: flex;
  }

  .page-hero {
    min-height: 700px;
    padding-top: calc(var(--nav-h) + 96px);
  }

  .hero-grid {
    grid-template-columns: 1.04fr 0.96fr;
    align-items: center;
    gap: 48px;
  }

  .h-xl {
    font-size: 4.5rem;
  }

  .h-lg {
    font-size: 3rem;
  }

  .sec {
    padding: 104px 0;
  }

  .guide-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
  }

  .launch-lineup {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
  }

  .launch-step {
    display: block;
    text-align: center;
  }

  .launch-art {
    min-height: 142px;
  }

  .launch-art img {
    max-height: 156px;
    margin: 0 auto;
  }

  .source-grid.three,
  .resource-grid.three,
  .card-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-cta {
    display: none;
  }
}

@media (max-width: 619px) {
  .topbar .btn {
    display: none;
  }

  .page-hero {
    min-height: 620px;
    padding-bottom: 64px;
  }

  .hero-scene {
    background-position: 74% top;
  }

  .h-xl {
    font-size: 2.55rem;
  }

  .h-lg {
    font-size: 2rem;
  }

  .hero-actions .btn,
  .cta-actions .btn {
    width: 100%;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .petal {
    display: none;
  }
}
