/* Home page: the real app in the hero, then a short run of readouts.
   Shared tokens, type and buttons live in styles.css. */

/* The home page runs a little wider than the inner pages, so the app window
   beside the hero's words stays readable; everything on it shares that edge. */
.home {
  --wrap: 1360px;
}

.home .bar {
  background: rgba(11, 10, 10, 0.6);
  border-bottom-color: transparent;
}

.home .bar-download {
  display: none;
}

/* ---------- the hero: the app as it ships ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 6vw, 88px) 0 clamp(72px, 9vw, 128px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 3.7vw, 3.5rem);
  line-height: 1.2;
}

/* The Thai headline is two short words a line: it can be set much larger. */
html[lang='th'] .hero-copy h1 {
  font-size: clamp(2.75rem, 5vw, 4.75rem);
  line-height: 1.15;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-side {
  margin-top: 24px;
}

.hero-side .lede {
  max-width: 24em;
  font-size: 1.125rem;
  color: var(--text-2);
}

.hero-side .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-side .meta {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* The whole window, lit from below by the app's own red. */
.hero-app {
  position: relative;
  margin: 0;
}

.hero-app::before {
  content: '';
  position: absolute;
  inset: 18% 8% -14% 4%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 59, 48, 0.22), transparent);
  filter: blur(24px);
}

.hero-app img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 12px 24px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- the hero curve ----------
   "หูฟังเดิม เสียงใหม่" drawn: the line starts flat, the original sound, and
   rises into the preset the window below is on (main.js animates it). */

.hero-curve {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  margin-top: 22px;
  overflow: visible;
}

.hero-curve .zero {
  stroke: var(--line-2);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.hero-curve .fill {
  fill: url(#hero-curve-fill);
}

.hero-curve .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-curve circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
}

/* ---------- the hero's entrance ----------
   One sequence: the headline, then the curve takes shape (main.js), then the
   line of copy and the buttons, while the window rises into place in depth. */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: perspective(1600px) translateY(48px) rotateX(9deg) scale(0.97);
  }
}

@keyframes glow-in {
  from {
    opacity: 0;
  }
}

.motion .hero-copy h1 {
  animation: rise-in 0.8s var(--ease) both;
}

.motion .hero-curve {
  animation: rise-in 0.6s var(--ease) 0.15s both;
}

.motion .hero-side {
  animation: rise-in 0.8s var(--ease) 0.9s both;
}

.motion .hero-app img {
  animation: window-in 1.2s var(--ease) 0.3s both;
}

.motion .hero-app::before {
  animation: glow-in 1.6s var(--ease) 0.8s both;
}

/* ---------- standout features ----------
   Three rows, words beside a crop of the real app, the side swapping each row;
   then a strip of three smaller ones, divided by hairlines rather than boxed. */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(48px, 6vw, 88px);
}

.feature-flip .feature-copy {
  order: 2;
}

.feature-copy h3 {
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.feature-copy p {
  max-width: 28em;
  margin-top: 16px;
  font-size: 1.0625rem;
  color: var(--text-2);
}

.feature-copy .feature-tag {
  display: inline-block;
  margin-top: 20px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 59, 48, 0.5);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.feature-shot {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 560px;
  margin: 0;
}

/* The same red underglow as the hero window, smaller. */
.feature-shot::before {
  content: '';
  position: absolute;
  inset: 20% 10% -8% 10%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 59, 48, 0.16), transparent);
  filter: blur(20px);
}

.feature-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9), 0 10px 20px -10px rgba(0, 0, 0, 0.6);
}

/* As a row arrives, its crop opens top to bottom, the way a panel opens in
   the app, and the words settle beside it. */
.motion .feature-shot {
  clip-path: inset(0 0 100% 0 round 12px);
  transform: translateY(24px);
  transition: clip-path 1s var(--ease), transform 1s var(--ease);
}

.motion .feature-copy {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}

.motion .feature.in .feature-shot {
  clip-path: inset(0 0 0 0 round 12px);
  transform: none;
}

.motion .feature.in .feature-copy {
  opacity: 1;
  transform: none;
}

/* The three small ones arrive as the list they are. */
.motion .extras li {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.motion .extras li:nth-child(2) {
  transition-delay: 0.08s;
}

.motion .extras li:nth-child(3) {
  transition-delay: 0.16s;
}

.motion .extras.in li {
  opacity: 1;
  transform: none;
}

/* Pointing at a screenshot brings it a little closer. The hero window's
   entrance animates the img itself, so its zoom sits on the picture around it. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero-app picture,
  .feature-shot img {
    display: block;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  }

  .hero-app:hover picture {
    transform: scale(1.02);
  }

  .feature-shot:hover img {
    transform: scale(1.03);
    box-shadow: 0 40px 70px -26px rgba(0, 0, 0, 0.95), 0 14px 26px -12px rgba(0, 0, 0, 0.7);
  }
}

/* A list that carries on past the crop. */
.feature-shot.fade img {
  -webkit-mask-image: linear-gradient(#000 72%, transparent);
  mask-image: linear-gradient(#000 72%, transparent);
}

.extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(56px, 7vw, 104px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.extras li {
  padding: 28px 28px 0 0;
}

.extras li + li {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.extras h3 {
  font-size: 1.125rem;
  line-height: 1.4;
}

.extras .tag {
  margin-left: 6px;
  vertical-align: 2px;
}

.extras p {
  margin-top: 8px;
  font-size: 0.9375rem;
  color: var(--text-2);
}

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

.home .section {
  padding: clamp(64px, 8vw, 112px) 0;
  border-top: 1px solid var(--line);
}

.home .section h2,
.closing h2 {
  font-size: clamp(2.25rem, 4.6vw, 4rem);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: clamp(36px, 4.5vw, 64px);
}

/* Readouts */
.readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 96px);
}

.readouts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.readouts dt {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.readouts dd {
  font-size: 1.125rem;
  letter-spacing: 0.03em;
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

.readouts a {
  color: var(--text);
}

/* Plans */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
}

.plan {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  padding: clamp(28px, 3.5vw, 48px);
  border: 1px solid var(--line-2);
  border-radius: 26px;
  background: var(--bg-1);
}

.plan h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-2);
}

.plan .plan-price {
  font-size: 1rem;
  color: var(--text-2);
}

.plan .amount {
  font-size: clamp(3.25rem, 5.5vw, 4.75rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: lining-nums;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 32px;
}

.plan li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
}

.plan .btn {
  justify-self: start;
}

.plan-premium {
  border-color: rgba(255, 59, 48, 0.45);
  box-shadow: 0 40px 90px -60px rgba(255, 59, 48, 0.45);
}

.plan-premium h3 {
  color: var(--accent);
}

/* Closing: one ring, one line, one action. */
.closing {
  position: relative;
  padding: clamp(120px, 16vw, 220px) 0;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.closing::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, 110vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 210deg, #ff8a4c, #f1ece9 18%, #ff3b30 38%, #ff3b30 52%, transparent 72%, #ff8a4c);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  opacity: 0.7;
}

.home .closing-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.closing h2 {
  margin-bottom: 36px;
}

.closing .meta {
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* ---------- smaller screens ---------- */

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

  .hero-app {
    margin-top: 16px;
  }
}

@media (max-width: 767px) {
  .feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-flip .feature-copy {
    order: 0;
  }

  .extras {
    grid-template-columns: minmax(0, 1fr);
  }

  .extras li,
  .extras li + li {
    padding: 24px 0 0;
    border-left: 0;
  }

  .hero-copy h1 {
    font-size: clamp(2.25rem, 10vw, 3rem);
  }

  .readouts,
  .plans {
    grid-template-columns: 1fr;
  }

  .readouts > div {
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 14px 0;
  }
}
