/* ========================================
   Night Ledger — Landing Page
   夜のインクの記録帳。罫線と滲むネオンだけで語る。
   ======================================== */
:root {
  --bg-primary: #0b0c14;
  --bg-secondary: #101120;
  --bg-card: #171827;
  --bg-elevated: #1c1e30;

  --text-primary: #f4f2fb;
  --text-secondary: #a8a4c4;
  --text-muted: #6d6a8a;

  --accent-from: #38c6f4;
  --accent-to: #8b5cf6;
  --accent: #7b6bf5;
  --accent-glow: rgba(123, 107, 245, 0.4);
  --accent-gradient: linear-gradient(135deg, var(--accent-from), var(--accent-to));

  --success: #4ddba0;
  --success-glow: rgba(77, 219, 160, 0.35);
  --warning: #f2c168;

  --border-color: rgba(226, 222, 255, 0.1);
  --border-active: rgba(123, 107, 245, 0.55);

  --font-primary: 'Zen Kaku Gothic New', 'Hiragino Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Kaisei Decol', 'Hiragino Mincho ProN', serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-primary);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* ---- atmosphere: ruled lines + drifting ink glow + grain ---- */
.ledger-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(2.75rem - 1px),
    rgba(226, 222, 255, 0.055) calc(2.75rem - 1px),
    rgba(226, 222, 255, 0.055) 2.75rem
  );
  mask-image: linear-gradient(to bottom, transparent, black 8%, black 85%, transparent);
}

.ink-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ink-glow::before,
.ink-glow::after {
  content: '';
  position: absolute;
  width: min(70vw, 760px);
  height: min(70vw, 760px);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
}

.ink-glow::before {
  top: -18%;
  left: -12%;
  background: radial-gradient(circle, var(--accent-from), transparent 70%);
  animation: drift-a 26s var(--ease) infinite alternate;
}

.ink-glow::after {
  bottom: -22%;
  right: -14%;
  background: radial-gradient(circle, var(--accent-to), transparent 70%);
  animation: drift-b 30s var(--ease) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6%, 8%) scale(1.08); }
}
@keyframes drift-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-6%, -6%) scale(1.1); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 2; }

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

a { color: inherit; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem clamp(1.25rem, 5vw, 3.5rem);
}

.topbar-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-primary);
}

.topbar-mark svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  flex-shrink: 0;
}

.topbar-cta {
  display: none;
}

@media (min-width: 720px) {
  .topbar-cta { display: inline-flex; }
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 9999px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease), border-color 260ms var(--ease), background 260ms var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 8px 24px -6px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.05) inset;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -6px var(--accent-glow), 0 0 0 1px rgba(255,255,255,0.08) inset; }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-active); transform: translateY(-2px); }

.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.85rem; }

/* ---- hero ---- */
.hero {
  position: relative;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1.25rem, 5vw, 3.5rem) clamp(4rem, 10vw, 7rem);
  max-width: 1180px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-ornament {
  position: absolute;
  top: -4rem;
  right: -3rem;
  width: min(46vw, 420px);
  height: min(46vw, 420px);
  stroke: var(--text-primary);
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
  transform: rotate(8deg);
}

@media (max-width: 720px) {
  .hero-ornament { display: none; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  animation: fade-up 700ms var(--ease) 60ms forwards;
}

.eyebrow::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: var(--accent-gradient);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.9rem, 9vw, 6.2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-top: 1rem;
  max-width: 14ch;
  opacity: 0;
  animation: fade-up 800ms var(--ease) 150ms forwards;
}

.hero h1 .glow-word {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: var(--text-secondary);
  margin-top: 1.4rem;
  max-width: 32ch;
  opacity: 0;
  animation: fade-up 800ms var(--ease) 260ms forwards;
}

.hero p.lede {
  margin-top: 1.6rem;
  font-size: 1.02rem;
  color: var(--text-secondary);
  max-width: 46ch;
  opacity: 0;
  animation: fade-up 800ms var(--ease) 360ms forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
  opacity: 0;
  animation: fade-up 800ms var(--ease) 460ms forwards;
}

.hero-note {
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fade-up 800ms var(--ease) 540ms forwards;
}

.hero-note .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
  flex-shrink: 0;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- torn divider ---- */
.torn-divider {
  display: block;
  width: 100%;
  height: 34px;
  fill: var(--bg-secondary);
  position: relative;
  z-index: 2;
}

/* ---- section shell ---- */
.section {
  background: var(--bg-secondary);
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 5vw, 3.5rem);
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-head {
  max-width: 46ch;
  margin-bottom: clamp(2.4rem, 5vw, 3.6rem);
}

.section-head .eyebrow { animation: none; opacity: 1; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-top: 0.7rem;
  line-height: 1.3;
}

.section-head p {
  margin-top: 0.9rem;
  color: var(--text-secondary);
}

/* ---- features grid ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.7rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms var(--ease);
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-active);
  box-shadow: 0 16px 34px -14px rgba(2,2,10,0.55);
}
.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(123, 107, 245, 0.14);
  margin-bottom: 1.1rem;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ---- how it works ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  position: relative;
}

@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; gap: 2.2rem; }
}

.steps::before {
  content: '';
  position: absolute;
  top: 26px;
  left: 8%;
  right: 8%;
  height: 0;
  border-top: 2px dashed var(--border-color);
}

@media (max-width: 820px) {
  .steps::before {
    top: 0; bottom: 0; left: 26px; right: auto;
    width: 0; height: auto;
    border-top: none;
    border-left: 2px dashed var(--border-color);
  }
}

.step {
  position: relative;
  padding-left: 0;
}

@media (max-width: 820px) {
  .step { padding-left: 4.4rem; }
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  box-shadow: 0 0 0 6px var(--bg-secondary), 0 0 22px -4px var(--accent-glow);
  margin-bottom: 1.1rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 820px) {
  .step-num { position: absolute; left: 0; top: 0; margin-bottom: 0; }
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 34ch;
}

/* ---- closing CTA ---- */
.cta-panel {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: clamp(2.6rem, 7vw, 4.6rem) clamp(1.6rem, 6vw, 4rem);
  text-align: center;
  overflow: hidden;
}

.cta-panel::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.cta-panel > * { position: relative; z-index: 1; }

.cta-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  margin-bottom: 1rem;
}

.cta-panel p {
  color: var(--text-secondary);
  max-width: 40ch;
  margin: 0 auto 2rem;
}

/* ---- footer ---- */
.site-footer {
  padding: 2.4rem clamp(1.25rem, 5vw, 3.5rem) 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.82rem;
  max-width: 1180px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.site-footer a:hover { color: var(--accent); border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
