:root {
  --ink: #182b36;
  --muted: #647783;
  --paper: #f3f6f3;
  --surface: #ffffff;
  --line: #dce5e2;
  --teal: #087e83;
  --coral: #e56755;
  --ice: #b7eeea;
  --gold: #f1d58a;
  --shadow: 0 18px 48px rgba(24, 43, 54, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    repeating-linear-gradient(135deg, transparent 0 46px, rgba(8, 126, 131, 0.025) 47px 48px),
    var(--paper);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

header {
  min-height: 78px;
  padding: 16px max(5%, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.logo {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.logo span {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
}

nav { display: flex; flex-wrap: wrap; gap: 8px; }

nav a {
  position: relative;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 180ms ease, transform 180ms ease;
}

nav a::after {
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: 12px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--teal), var(--coral));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

nav a:hover, nav a[aria-current="page"] { color: var(--teal); }
nav a:hover::after, nav a[aria-current="page"]::after { transform: scaleX(1); }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(58px, 10vw, 112px) 20px 82px;
  text-align: center;
  background:
    linear-gradient(120deg, rgba(255,255,255,.92), rgba(226,246,241,.88) 50%, rgba(255,239,229,.9)),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero::before, .hero::after {
  position: absolute;
  width: 110px;
  height: 110px;
  content: "";
  border: 1px solid rgba(8, 126, 131, 0.2);
  transform: rotate(45deg) skew(-8deg, -8deg);
  pointer-events: none;
}

.hero::before { top: 24px; left: 8%; }
.hero::after { right: 9%; bottom: -48px; border-color: rgba(229, 103, 85, 0.24); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.98;
}

.hero h1 span { color: var(--teal); }

.hero p {
  max-width: 610px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

main {
  width: min(100% - 36px, 1060px);
  margin: 0 auto;
  padding: 52px 0 72px;
}

.welcome-section { max-width: 900px; margin: auto; }
.section-title { margin: 10px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.subtitle, .hint, .prototype-note { color: var(--muted); line-height: 1.7; }
.subtitle { margin: 0 0 24px; }

.page-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }

.feature-card {
  position: relative;
  display: flex;
  min-height: 210px;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, #fff, #f3fbf9 58%, #fff8f2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.feature-card::before {
  position: absolute;
  top: -55%;
  left: -60%;
  width: 55%;
  height: 210%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(183, 238, 234, 0.55), rgba(255,255,255,.82), transparent);
  transform: rotate(24deg);
  transition: left 480ms ease;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(8, 126, 131, 0.42);
  box-shadow: 0 22px 48px rgba(8, 126, 131, 0.16);
}

.feature-card:hover::before { left: 120%; }
.feature-card:active { transform: translateY(-1px) scale(0.985); }
.feature-number { color: var(--coral); font-size: 0.76rem; font-weight: 900; letter-spacing: 0.12em; }
.feature-title { margin-top: 28px; font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 700; }
.feature-copy { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.feature-arrow { position: absolute; right: 20px; bottom: 18px; color: var(--teal); font-size: 1.3rem; }

.button {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 13px 20px;
  color: white;
  background: linear-gradient(115deg, var(--teal), #13636c 55%, #248e8d);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  box-shadow: 0 9px 18px rgba(8, 126, 131, .2), inset 0 1px rgba(255,255,255,.3);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.button::before {
  position: absolute;
  top: -80%;
  left: -45%;
  width: 32%;
  height: 260%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: rotate(25deg);
  transition: left 400ms ease;
}

.button:hover {
  filter: brightness(1.1) saturate(1.08);
  box-shadow: 0 13px 25px rgba(8, 126, 131, .3), 0 0 0 3px rgba(183, 238, 234, .32), inset 0 1px rgba(255,255,255,.42);
  transform: translateY(-2px);
}

.button:hover::before { left: 125%; }
.button:active { transform: translateY(2px) scale(.96); filter: brightness(.92); box-shadow: 0 3px 8px rgba(8, 126, 131, .25), inset 0 2px 5px rgba(0,0,0,.2); }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.card {
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: 24px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

label { display: block; margin: 18px 0 8px; font-weight: 800; }
textarea, select { width: 100%; padding: 14px; color: var(--ink); background: white; border: 1px solid #cbd9d6; border-radius: 10px; font: inherit; }
textarea { min-height: 150px; resize: vertical; }
textarea:focus, select:focus { border-color: var(--teal); }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: background 160ms ease, border-color 160ms ease; }
.choice:hover { background: #f1fbf9; border-color: rgba(8,126,131,.4); }
.choice input { margin-top: 4px; accent-color: var(--teal); }
.choice strong { display: block; margin-bottom: 5px; }
.choice span { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.notice { padding: 15px; margin: 18px 0; color: #67491b; background: #fff5df; border-left: 4px solid #e6b951; border-radius: 8px; font-size: .9rem; line-height: 1.65; }
.success { display: none; padding: 15px; margin-top: 16px; color: #15583b; background: #e7f7ee; border-radius: 10px; line-height: 1.6; }
.message { padding: 18px 0; border-bottom: 1px solid var(--line); line-height: 1.7; }
.message:last-child { border-bottom: 0; }
.tag { display: inline-block; padding: 5px 9px; margin-bottom: 8px; color: #075e64; background: #dff5f1; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.prototype-note { margin-top: 24px; font-size: .88rem; }

.sound-toggle {
  min-height: 40px;
  padding: 9px 13px;
  color: var(--teal);
  background: #f0faf8;
  border: 1px solid rgba(8, 126, 131, .25);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.sound-toggle:hover {
  background: #def5f1;
  box-shadow: 0 0 0 3px rgba(183, 238, 234, .35);
}

.sound-toggle:active { transform: scale(.96); }
.sound-toggle:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.crystal-trail {
  position: fixed;
  z-index: 20;
  width: var(--crystal-size, 16px);
  height: calc(var(--crystal-size, 16px) * 1.45);
  left: 0;
  top: 0;
  border: 1px solid rgba(255, 255, 255, .9);
  background: linear-gradient(145deg, rgba(255,255,255,.95) 0 12%, rgba(114,226,217,.82) 32%, rgba(255,255,255,.35) 49%, rgba(229,103,85,.72) 72%, rgba(255,255,255,.85));
  box-shadow: 0 0 12px rgba(80, 196, 190, .48), 0 0 22px rgba(255, 255, 255, .35);
  clip-path: polygon(50% 0, 100% 30%, 78% 100%, 22% 100%, 0 30%);
  pointer-events: none;
  animation: crystal-float 760ms ease-out forwards;
  will-change: transform, opacity;
}

.crystal-trail::after {
  position: absolute;
  inset: 1px 48% 1px 1px;
  content: "";
  background: rgba(255, 255, 255, .64);
  clip-path: polygon(100% 0, 100% 100%, 0 30%);
}

@keyframes crystal-float {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--crystal-angle)) scale(.35); }
  18% { opacity: .95; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--crystal-drift-x)), calc(-50% - 24px)) rotate(calc(var(--crystal-angle) + 70deg)) scale(1.05); }
}

footer {
  padding: 26px 18px;
  color: var(--muted);
  background: rgba(255,255,255,.86);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .88rem;
  line-height: 1.8;
}

@media (max-width: 700px) {
  header { align-items: flex-start; flex-direction: column; padding: 16px 5%; }
  nav { gap: 2px; }
  nav a { padding: 9px 8px; }
  .page-links { grid-template-columns: 1fr; }
  .feature-card { min-height: 175px; }
  .hero::before { left: -45px; }
  .sound-toggle { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .crystal-trail { display: none; }
}