/* ==========================================================================
   DeMemos — Home page
   ========================================================================== */

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 100px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}
.hero-copy h1 { margin-bottom: 26px; }
.hero-lead {
  max-width: 36ch;
  margin-bottom: 36px;
  font-size: clamp(1.1rem, 1.6vw, 1.28rem);
  color: var(--muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual { position: relative; }
.hero-visual > .device--tablet { transform: perspective(1600px) rotateY(-8deg) rotateX(3deg); transition: transform 1.2s var(--ease); }
.hero-visual:hover > .device--tablet { transform: perspective(1600px) rotateY(-2deg) rotateX(1deg); }

.hero-glow {
  position: absolute;
  inset: 4% 2%;
  z-index: -1;
  background: var(--grad);
  filter: blur(80px);
  opacity: 0.4;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.95); opacity: 0.32; }
  50% { transform: scale(1.04); opacity: 0.5; }
}

.hud-chip--attention { top: -6%; left: -8%; }
.hud-chip--suggest { bottom: 2%; right: -7%; animation-delay: -3.5s; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { max-width: 680px; margin: 30px auto 0; width: 100%; }
  .hud-chip--attention { left: 0; }
  .hud-chip--suggest { right: 0; }
}
@media (max-width: 560px) {
  .hud-chip { min-width: 0; padding: 9px 11px; font-size: 0.72rem; }
  .hud-chip--attention { top: -16%; }
  .hud-chip--suggest { bottom: -16%; }
  .hud-chip .meter { height: 16px; }
}

/* ---------- Spec strip ---------- */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.spec-strip div {
  padding: 26px 22px;
  border-left: 1px solid var(--line);
}
.spec-strip div:first-child { border-left: 0; }
.spec-strip span {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--link);
}
.spec-strip b { display: block; font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.spec-strip small { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 900px) {
  .spec-strip { grid-template-columns: 1fr 1fr; }
  .spec-strip div:nth-child(3) { border-left: 0; }
  .spec-strip div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .spec-strip { grid-template-columns: 1fr; }
  .spec-strip div { border-left: 0; border-top: 1px solid var(--line); }
  .spec-strip div:first-child { border-top: 0; }
}

/* ---------- How it works ---------- */
.how-stage {
  display: grid;
  grid-template-columns: 0.62fr 0.45fr 1.2fr;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
}
.how-col-label {
  display: block;
  margin-bottom: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.how-col-label small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.how-phone { max-width: 280px; margin: 0 auto; width: 100%; }

/* The AI core between the two sides */
.core {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 180px;
}
.core-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0.5;
  overflow: hidden;
}
.core-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -25%;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  animation: travel 2.6s linear infinite;
}
@keyframes travel { to { left: 100%; } }
.core-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--night);
  clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%);
}
.core-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, var(--teal), var(--blue), var(--sky), var(--pink), var(--teal));
  opacity: 0.35;
  animation: spin 6s linear infinite;
}
.core-chip span { position: relative; }
.core-chip b { display: block; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -0.02em; }
@keyframes spin { to { transform: rotate(360deg); } }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: clamp(48px, 7vw, 80px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { padding: 26px 24px; counter-increment: step; }
.steps h3::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--link);
}
.steps h3 { font-size: 1.15rem; }
.steps h3 .ai-badge { margin-left: 6px; vertical-align: 3px; }
.steps p { margin: 0; font-size: 0.96rem; color: var(--muted); }

@media (max-width: 1000px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 960px) {
  .how-stage { grid-template-columns: 1fr; }
  .core { min-height: 150px; }
  .core-line { top: 0; bottom: 0; left: 50%; right: auto; width: 2px; height: auto; background: linear-gradient(var(--teal), var(--sky), var(--pink)); }
  .core-line::after { display: none; }
  .how-tablet { max-width: 620px; margin: 0 auto; width: 100%; }
}
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- AI stages (dark) ---------- */
.stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.stage { padding: 30px 26px 32px; }
.stage-tag {
  display: inline-block;
  margin-bottom: 26px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--night);
  background: #8fe9ee;
}
.stage:nth-child(2) .stage-tag { background: #7fd6ff; }
.stage:nth-child(3) .stage-tag { color: #fff; background: linear-gradient(100deg, var(--sky), var(--pink)); }
.stage h3 { font-size: 1.7rem; }
.stage ul { margin: 18px 0 0; padding: 0; list-style: none; font-size: 0.95rem; }
.stage li { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); color: #b5dfe1; }
.stages-cta { margin-top: 40px; text-align: center; }
@media (max-width: 900px) { .stages { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; } }

/* ---------- Explore ---------- */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.explore-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s var(--ease);
}
.explore-card:hover { transform: translateY(-4px); }
.explore-visual {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.explore-visual > img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.explore-card:hover .explore-visual > img { transform: scale(1.06); }
.explore-body { padding: 24px 26px 28px; }
.explore-body p { margin-bottom: 18px; color: var(--muted); }
.explore-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--link);
}
.explore-link svg { width: 16px; height: 16px; transition: transform 0.4s var(--ease); }
.explore-card:hover .explore-link svg { transform: translateX(4px); }

.explore-visual--notes {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  background: linear-gradient(135deg, var(--teal-soft), var(--sky-soft) 60%, var(--pink-soft));
}
.note {
  max-width: 88%;
  padding: 10px 13px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  border-left: 3px solid var(--teal);
}
.note b { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--blue); }
.note:nth-child(2) { align-self: flex-end; border-left-color: var(--pink); }
.note:nth-child(2) b { color: var(--pink); }

.explore-visual--quiz { display: grid; place-items: center; background: var(--night); }
.explore-visual--quiz > img { position: absolute; inset: 0; opacity: 0.5; }
.quiz { position: relative; text-align: center; color: #fff; }
.quiz strong { display: block; margin-bottom: 14px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.quiz-options { display: flex; gap: 6px; justify-content: center; }
.quiz-options span {
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.quiz-options .is-right { animation: correct 4s ease-in-out infinite; }
@keyframes correct {
  0%, 40% { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); }
  55%, 90% { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 24px rgba(0, 194, 203, 0.8); }
  100% { background: rgba(255, 255, 255, 0.14); }
}

@media (max-width: 960px) { .explore-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; } }

/* ---------- Everywhere ---------- */
.everywhere {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding: clamp(32px, 5vw, 64px);
}
.everywhere h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.everywhere p { color: var(--muted); }
.device-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding-bottom: 26px;
}
.device-row img { width: 100%; height: 100%; object-fit: cover; }
.device-row .device--tv { width: 42%; padding: 5px; margin-bottom: 22px; }
.device-row .device--tv::after { height: 20px; bottom: -20px; }
.device-row .device--laptop { width: 30%; padding: 5px 5px 6px; border-radius: 6px 6px 0 0; margin-bottom: 8px; }
.device-row .device--laptop::after { height: 8px; bottom: -8px; }
.device-row .device--tablet { width: 18%; padding: 4px; border-radius: 8px; }
.device-row .device--tablet .device-screen { border-radius: 4px; }
.device-row .device--phone { width: 8%; padding: 3px; border-radius: 9px; }
.device-row .device--phone .device-screen { border-radius: 7px; }
.device-row .device--phone::before { display: none; }

@media (max-width: 860px) { .everywhere { grid-template-columns: 1fr; text-align: center; } }

/* ---------- Closing call to action ---------- */
.closing {
  position: relative;
  padding: clamp(48px, 8vw, 100px) clamp(24px, 6vw, 80px);
  text-align: center;
  overflow: hidden;
}
.closing h2 { max-width: 18ch; margin-left: auto; margin-right: auto; }
.closing p { max-width: 54ch; margin: 0 auto 32px; color: var(--muted); font-size: 1.1rem; }
.closing .hero-actions { justify-content: center; }
