/* ============================================================
   TILEHOOD — product homepage
   Palette from the app icon: deep navy verticals + electric
   blue gradient. Motif: the S2 tile lattice (vertical lines +
   slanted diagonals) exactly like the in-app map.
   Fonts: Outfit (Latin) / Zen Maru Gothic (JP)
   ============================================================ */

:root {
  --bg: #f6f9ff;
  --surface: #ffffff;
  --ink: #0b1f3f;
  --ink-dim: #51637f;
  --ink-faint: #9fb0c6;
  --blue: #1d6bff;
  --blue-light: #4da3ff;
  --grad: linear-gradient(135deg, #1d6bff, #4da3ff);
  --line: rgba(11, 31, 63, 0.1);
  --navy: #0b1f3f;
  --navy-deep: #071528;
  --font-latin: "Outfit", sans-serif;
  --font-jp: "Zen Maru Gothic", sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--blue);
  color: #ffffff;
}

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

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

img {
  max-width: 100%;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(246, 249, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  display: block;
  height: 22px;
  width: auto;
}

.brand .brand-icon {
  height: 34px;
  width: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(11, 31, 63, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  font-weight: 700;
  font-size: 13px;
}

.nav a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-dim);
  transition: color 0.25s;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}

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

.nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  background: var(--grad);
  border-radius: 999px;
  padding: 9px 20px !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(29, 107, 255, 0.3);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s !important;
}

.nav-cta::after {
  display: none;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(29, 107, 255, 0.4);
}

@media (max-width: 720px) {
  .nav a:not(.nav-cta) {
    display: none;
  }
}

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

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--pad) 80px;
  overflow: hidden;
}

.lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.lattice-lines line {
  stroke: rgba(29, 107, 255, 0.14);
  stroke-width: 1.5;
}

.cell-faint {
  fill: rgba(29, 107, 255, 0.09);
}

.cell-soft {
  fill: rgba(29, 107, 255, 0.06);
  animation: cell-soft 7s ease-in-out infinite;
  animation-delay: var(--cd, 0s);
}

@keyframes cell-soft {
  0%, 100% { fill: rgba(29, 107, 255, 0.05); }
  50% { fill: rgba(29, 107, 255, 0.12); }
}

.loc-dot {
  fill: var(--blue);
  stroke: #ffffff;
  stroke-width: 3.5;
}

.loc-ring {
  fill: none;
  stroke: rgba(29, 107, 255, 0.5);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: loc-pulse 2.6s ease-out infinite;
}

@keyframes loc-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}

.cell-hit {
  fill: rgba(29, 107, 255, 0.12);
  stroke: url(#tile-grad);
  stroke-width: 3;
  stroke-linejoin: round;
  animation: cell-breathe 4.5s ease-in-out infinite;
}

@keyframes cell-breathe {
  0%, 100% { fill: rgba(29, 107, 255, 0.12); }
  50% { fill: rgba(29, 107, 255, 0.22); }
}

/* sample posts floating on the lattice */

.demo-posts {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.demo-post {
  position: absolute;
  max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 14px 34px rgba(11, 31, 63, 0.1);
  animation: float 6s ease-in-out infinite;
  animation-delay: var(--fx);
}

.demo-post p {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.6;
  padding-left: 22px;
}

.demo-avatar {
  position: absolute;
  top: 15px;
  left: 16px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--a);
}

.demo-meta {
  display: block;
  padding-left: 22px;
  font-size: 11px;
  color: var(--ink-faint);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@media (max-width: 900px) {
  .demo-posts {
    display: none;
  }
}

.hero-copy {
  margin: 0 auto;
  position: relative;
  text-align: center;
  z-index: 2;
  max-width: 720px;
}

.hero-appicon {
  width: clamp(72px, 9vw, 104px);
  height: clamp(72px, 9vw, 104px);
  border-radius: 24%;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(11, 31, 63, 0.18);
  margin-bottom: clamp(20px, 4vh, 40px);
}

.hero-title {
  font-weight: 900;
  font-size: clamp(44px, 8.6vw, 104px);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.hero-title em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.line-inner {
  display: inline-block;
}

.hero-lead {
  margin-top: clamp(20px, 3.5vh, 36px);
  color: var(--ink-dim);
  font-weight: 500;
  font-size: clamp(14px, 1.7vw, 17px);
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  margin-top: clamp(26px, 4.5vh, 44px);
}

.preregister-cta {
  align-items: center;
  background: var(--blue);
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(29, 107, 255, 0.24);
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  gap: 14px;
  justify-content: space-between;
  font-size: 16px;
  min-height: 56px;
  padding: 0 22px;
  transition: box-shadow 0.25s, transform 0.25s var(--ease-out);
  width: min(430px, 100%);
}

.preregister-cta:hover {
  box-shadow: 0 12px 28px rgba(29, 107, 255, 0.32);
  transform: translateY(-2px);
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* store badges */

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--navy);
  color: #ffffff;
  border-radius: 14px;
  padding: 10px 22px 10px 18px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  box-shadow: 0 8px 22px rgba(11, 31, 63, 0.22);
}

.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 31, 63, 0.3);
}

.store-icon {
  font-family: var(--font-latin);
  font-size: 22px;
  line-height: 1;
}

.store-icon.play {
  font-size: 16px;
}

.store-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.store-text small {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.store-badge.on-dark {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: none;
  cursor: default;
}

/* ---------- load reveal ---------- */

.reveal-load {
  opacity: 0;
  transform: translateY(110%);
  animation: rise 1.1s var(--ease-out) forwards;
  animation-delay: calc(var(--d) * 0.13s + 0.15s);
}

img.reveal-load,
p.reveal-load,
div.reveal-load {
  transform: translateY(26px);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.section {
  padding: clamp(84px, 13vh, 150px) var(--pad);
  max-width: 1140px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}

.section-title {
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 44px);
  line-height: 1.4;
}

.section-lead {
  margin-top: 18px;
  max-width: 640px;
  color: var(--ink-dim);
  font-weight: 500;
  font-size: 15px;
}

/* ---------- concept steps ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  margin-top: clamp(36px, 6vh, 60px);
}

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

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(22px, 3vw, 32px);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.step:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(11, 31, 63, 0.1);
}

.step-no {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 14px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step h3 {
  font-weight: 900;
  font-size: 19px;
  margin: 10px 0 8px;
}

.step p {
  color: var(--ink-dim);
  font-size: 14px;
}

/* ---------- features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  margin-top: clamp(36px, 6vh, 60px);
}

@media (max-width: 720px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(24px, 3.4vw, 36px);
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(11, 31, 63, 0.1);
}

.feature-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad);
  color: #ffffff;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--ink-dim);
  font-size: 14px;
}

/* ---------- download band ---------- */

.download-band {
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #ffffff;
  overflow: hidden;
}

.band-lattice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.band-lattice line {
  stroke: rgba(77, 163, 255, 0.14);
  stroke-width: 1.5;
}

.download-inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(84px, 13vh, 150px) var(--pad);
  text-align: center;
}

.download-appicon {
  width: clamp(72px, 8vw, 96px);
  height: clamp(72px, 8vw, 96px);
  border-radius: 24%;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  margin-bottom: 28px;
}

.download-title {
  font-weight: 900;
  font-size: clamp(26px, 4.6vw, 46px);
  line-height: 1.5;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(26px, 4.5vh, 44px);
}

.download-note {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.nowrap {
  display: inline-block;
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 28px var(--pad) 36px;
  font-size: 13px;
  color: var(--ink-dim);
}

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

.site-footer a:hover {
  color: var(--blue);
}

.foot-nav {
  display: flex;
  gap: 24px;
}

/* ---------- scroll reveal ---------- */

.preregister-dialog {
  background: #fff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 30px 100px rgba(8, 21, 45, 0.28);
  color: #11213d;
  max-width: 560px;
  padding: 48px;
  width: calc(100% - 32px);
}

.preregister-dialog::backdrop { background: rgba(7, 17, 36, 0.62); backdrop-filter: blur(4px); }
.preregister-close { background: transparent; border: 0; color: #667085; cursor: pointer; font-size: 30px; position: absolute; right: 18px; top: 12px; }
.preregister-kicker { color: #1d6bff; font-size: 12px; font-weight: 800; letter-spacing: .12em; margin: 0 0 10px; }
.preregister-dialog h2 { font-size: clamp(30px, 7vw, 44px); line-height: 1.2; margin: 0 0 18px; }
.preregister-dialog h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.2; margin: 0 0 18px; }
.preregister-copy { color: #526078; line-height: 1.8; }
.preregister-dialog label { display: block; font-size: 13px; font-weight: 700; margin: 28px 0 8px; }
.preregister-fields { display: grid; gap: 10px; grid-template-columns: 1fr auto; }
.preregister-fields input { border: 1px solid #ccd5e3; border-radius: 5px; font: inherit; min-width: 0; padding: 14px; }
.preregister-fields input:focus { border-color: #1d6bff; outline: 2px solid rgba(29,107,255,.14); }
.preregister-fields button { background: #1d6bff; border: 0; border-radius: 5px; color: #fff; cursor: pointer; font: 700 14px/1 "Zen Maru Gothic", sans-serif; padding: 0 18px; }
.preregister-fields button:disabled { cursor: wait; opacity: .55; }
.preregister-status { color: #1d6bff; font-size: 14px; min-height: 24px; margin: 12px 0 0; }
.preregister-status.error { color: #c62828; }
.preregister-note { border-top: 1px solid #e5eaf1; color: #788397; font-size: 12px; line-height: 1.7; margin: 20px 0 0; padding-top: 16px; }

@media (max-width: 620px) {
  .preregister-cta { font-size: 15px; min-height: 54px; padding: 0 18px; }
  .preregister-dialog { padding: 38px 22px 28px; }
  .preregister-fields { grid-template-columns: 1fr; }
  .preregister-fields button { min-height: 48px; }
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cell-hit,
  .cell-soft,
  .loc-ring,
  .demo-post {
    animation: none !important;
  }
  .reveal-load {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
