/* ============================================================
   Cloudflare OS 導入 LP — Design System
   Direction: dark technical / retro-futurist, orange accent
   ============================================================ */

:root {
  /* color tokens */
  --bg: #0a0a10;
  --bg-raised: #101018;
  --bg-card: #12121c;
  --ink: #f4f1ea;
  --ink-dim: #a8a49b;
  --ink-faint: #6b6862;
  --line: rgba(244, 241, 234, 0.09);
  --accent: #f6821f;
  --accent-soft: #fbad41;
  --accent-dim: rgba(246, 130, 31, 0.14);
  --glow: rgba(246, 130, 31, 0.35);

  /* type tokens */
  --font-display: "Space Grotesk", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* rhythm */
  --space-section: clamp(6rem, 12vw, 10rem);
  --space-inner: clamp(1.25rem, 4vw, 2.5rem);
  --maxw: 72rem;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset / base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #0a0a10;
}

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

ul,
ol {
  list-style: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(244, 241, 234, 0.07);
  padding: 0.15em 0.45em;
  border-radius: 0.3em;
}

/* ---------- atmosphere ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(244, 241, 234, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 234, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 60% 45% at 75% -5%, var(--glow), transparent 65%),
    radial-gradient(ellipse 45% 35% at 10% 30%, rgba(246, 130, 31, 0.08), transparent 70%),
    var(--bg);
}

.bg-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(10, 10, 16, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem var(--space-inner);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 18px var(--glow);
  flex-shrink: 0;
}

.brand-sep {
  color: var(--accent);
  margin: 0 0.35em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.site-nav a {
  transition: color 0.25s;
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--accent);
  padding: 0.45em 1.1em;
  border-radius: 999px;
  transition: background 0.25s, box-shadow 0.25s;
}

.nav-cta:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 20px var(--glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 8rem var(--space-inner) 4rem;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

.hero-line {
  display: block;
}

.accent {
  color: var(--accent);
  text-shadow: 0 0 40px var(--glow);
}

.hero-lead {
  max-width: 38rem;
  color: var(--ink-dim);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  margin-bottom: 2.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 4.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.9em 2em;
  border-radius: 999px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  will-change: transform;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #140b02;
  box-shadow: 0 8px 32px var(--glow);
}

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

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(244, 241, 234, 0.03);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.stat dt {
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.stat dd {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink-dim);
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-right: 0.2em;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 56px;
  background: var(--line);
  overflow: hidden;
}

.hero-scroll span {
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--accent);
  animation: scrollHint 2.2s var(--ease-out) infinite;
}

@keyframes scrollHint {
  0% { top: -50%; }
  60%, 100% { top: 110%; }
}

/* ---------- sections common ---------- */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-section) var(--space-inner) 0;
}

.section-head {
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.section-index::after {
  content: "";
  display: inline-block;
  width: 3rem;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 1rem;
  opacity: 0.5;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.section-sub {
  margin-top: 1.25rem;
  color: var(--ink-dim);
  max-width: 40rem;
}

/* ---------- problem ---------- */

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.problem-card:hover {
  border-color: rgba(246, 130, 31, 0.4);
  transform: translateY(-4px);
}

.problem-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.problem-card h3::before {
  content: "—";
  color: var(--accent);
  margin-right: 0.5em;
}

.problem-card p {
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.problem-conclusion {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 2;
  color: var(--ink-dim);
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
  max-width: 46rem;
}

.problem-conclusion strong {
  color: var(--ink);
}

/* ---------- platform pillars (asymmetric) ---------- */

.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pillar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  max-width: 56rem;
  transition: border-color 0.3s;
}

.pillar:hover {
  border-color: rgba(246, 130, 31, 0.35);
}

.pillar-alt {
  align-self: flex-end;
}

.pillar-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  user-select: none;
}

.pillar-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.pillar-body > p {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}

.pillar-points {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pillar-points li {
  font-size: 0.88rem;
  color: var(--ink-dim);
  padding-left: 1.4rem;
  position: relative;
}

.pillar-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 1px;
  background: var(--accent);
}

/* ---------- use cases ---------- */

.usecase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.usecase {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 2.25rem 2rem 2rem;
  background: linear-gradient(160deg, var(--bg-raised), var(--bg-card));
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.usecase::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.usecase:hover {
  border-color: rgba(246, 130, 31, 0.4);
  transform: translateY(-4px);
}

.usecase:hover::before {
  opacity: 1;
}

.usecase-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  border: 1px solid rgba(246, 130, 31, 0.35);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  margin-bottom: 1.2rem;
}

.usecase h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.usecase p {
  font-size: 0.9rem;
  color: var(--ink-dim);
}

/* ---------- security ---------- */

.security-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.security-points {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.sec-point h3 {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.sec-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sec-point p {
  font-size: 0.9rem;
  color: var(--ink-dim);
  padding-left: 2.8rem;
}

.code-window {
  background: #0d0d14;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(246, 130, 31, 0.06);
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 234, 0.02);
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--ink-faint);
  opacity: 0.4;
}

.dot:first-child {
  background: var(--accent);
  opacity: 0.8;
}

.code-filename {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.code-window pre {
  padding: 1.5rem 1.4rem;
  overflow-x: auto;
}

.code-window code {
  background: none;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--ink);
}

.c-kw { color: var(--accent-soft); }
.c-prop { color: #7dd3fc; }
.c-fn { color: #c4b5fd; }
.c-str { color: #86efac; }
.c-comment { color: var(--ink-faint); }

.code-caption {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.9;
}

/* ---------- gateway ---------- */

.gateway-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  background: linear-gradient(150deg, rgba(246, 130, 31, 0.08), transparent 55%), var(--bg-card);
  border: 1px solid rgba(246, 130, 31, 0.22);
  border-radius: 1.5rem;
  padding: clamp(2rem, 5vw, 4rem);
}

.gateway-text .section-title {
  margin-bottom: 1.25rem;
}

.gateway-text p:not(.section-index) {
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.gateway-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.gateway-list li {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1.1rem 1.3rem;
  font-size: 0.88rem;
  color: var(--ink-dim);
  background: rgba(10, 10, 16, 0.5);
}

.gw-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 0.35rem;
}

/* ---------- deploy ---------- */

.deploy-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
  margin-bottom: 3rem;
}

.deploy-step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 2.25rem 1.75rem 1.75rem;
  background: var(--bg-card);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.deploy-step:hover {
  border-color: rgba(246, 130, 31, 0.4);
  transform: translateY(-4px);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 1.1rem;
}

.deploy-step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.deploy-step p {
  font-size: 0.88rem;
  color: var(--ink-dim);
}

.deploy-note {
  font-size: 0.9rem;
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  border-radius: 0.9rem;
  padding: 1.4rem 1.6rem;
  line-height: 1.9;
}

/* ---------- cta ---------- */

.cta {
  padding-bottom: var(--space-section);
}

.cta-inner {
  text-align: center;
  border: 1px solid rgba(246, 130, 31, 0.25);
  border-radius: 1.5rem;
  padding: clamp(3rem, 8vw, 6rem) var(--space-inner);
  background:
    radial-gradient(ellipse 55% 60% at 50% 110%, rgba(246, 130, 31, 0.16), transparent 70%),
    var(--bg-card);
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 1.25rem;
}

.cta-lead {
  color: var(--ink-dim);
  margin-bottom: 2.5rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--space-inner);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.footer-src a {
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s;
}

.footer-src a:hover {
  color: var(--accent-soft);
}

/* ---------- reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* staggered hero entrance */
.hero .reveal:nth-child(1) { transition-delay: 0.05s; }
.hero .reveal:nth-child(2) { transition-delay: 0.15s; }
.hero .reveal:nth-child(3) { transition-delay: 0.3s; }
.hero .reveal:nth-child(4) { transition-delay: 0.45s; }
.hero .reveal:nth-child(5) { transition-delay: 0.6s; }

/* ---------- responsive ---------- */

@media (max-width: 56rem) {
  .problem-grid,
  .deploy-steps {
    grid-template-columns: 1fr;
  }

  .usecase-grid,
  .security-layout,
  .gateway-inner {
    grid-template-columns: 1fr;
  }

  .pillar,
  .pillar-alt {
    align-self: stretch;
    max-width: none;
  }

  .sec-point p {
    padding-left: 0;
  }
}

@media (max-width: 40rem) {
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(78vw, 20rem);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(13, 13, 20, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-left: 1px solid var(--line);
    font-size: 1.05rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
    z-index: 110;
  }

  .pillar {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-stats {
    gap: 1.75rem;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .hero-scroll span {
    animation: none;
  }

  .btn,
  .problem-card,
  .usecase,
  .deploy-step,
  .pillar {
    transition: none;
  }
}
