/* sor.page landing. Light theme only; loaded after the shared public stylesheet. */

body.landing {
  --gutter: clamp(20px, 5vw, 64px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
  overflow-x: hidden;
}

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

.l-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px var(--gutter) 0;
}

.l-brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  animation: l-fade 0.8s var(--ease-out) both;
}

body.landing main.l-main {
  display: block;
  padding: 0;
  overflow-x: clip;
}

/* --- Hero --- */

.l-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  max-width: 1200px;
  min-height: calc(100svh - 90px);
  margin: 0 auto;
  padding: 48px var(--gutter) 96px;
}

.l-corner {
  position: absolute;
  z-index: -1;
  width: clamp(220px, 26vw, 380px);
  height: auto;
  fill: #eceef1;
  fill-rule: evenodd;
  animation: l-corner 1.6s var(--ease-out) both;
}

.l-corner-a {
  top: -22%;
  right: -10vw;
  animation-delay: 0.2s;
}

.l-corner-b {
  bottom: -22%;
  left: -18vw;
  animation-delay: 0.45s;
}

.l-title {
  margin: 0 0 28px;
  font-size: clamp(40px, 5.4vw, 76px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

/* Masked line reveal. Padding keeps Thai marks above and below the line inside the mask. */
.l-line {
  display: block;
  overflow: hidden;
  padding: 0.12em 0 0.06em;
  margin: -0.12em 0 -0.06em;
}

.l-line > span {
  display: inline-block;
  animation: l-rise 1.1s var(--ease-out) both;
}

.l-line:nth-child(1) > span {
  animation-delay: 0.15s;
}

.l-line:nth-child(2) > span {
  animation-delay: 0.27s;
}

.l-line:nth-child(3) > span {
  animation-delay: 0.39s;
  color: var(--muted);
}

.l-lead {
  max-width: 36ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.75;
  animation: l-fade 1s var(--ease-out) 0.7s both;
}

/* --- Stage --- */

.l-stage {
  display: grid;
  justify-items: start;
  gap: clamp(24px, 3vw, 36px);
  min-width: 0;
  animation: l-fade 1s var(--ease-out) 0.55s both;
}

.l-slot {
  position: relative;
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 64px;
}

.l-slot > * {
  grid-area: 1 / 1;
}

.l-long {
  overflow: hidden;
  opacity: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 18px);
  white-space: nowrap;
  transform-origin: left center;
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent);
  mask-image: linear-gradient(90deg, #000 72%, transparent);
}

.l-short {
  position: relative;
  justify-self: start;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.l-host {
  display: inline-block;
  color: var(--muted);
}

.l-slug {
  font-weight: 600;
}

.l-slug > span {
  display: inline-block;
}

.l-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left center;
}

.l-qr {
  display: block;
  width: clamp(200px, 22vw, 290px);
  height: auto;
  aspect-ratio: 1;
}

/* The link stays hidden until the script decides between the animated and the static frame;
   a <noscript> style and the reduced-motion query reveal the HTML fallback without it. */
.l-short {
  visibility: hidden;
}

.is-animated .l-short,
.is-static .l-short {
  visibility: visible;
}

.is-animated .l-host,
.is-animated .l-underline {
  opacity: 0;
}

/* --- Facts --- */

.l-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.l-fact {
  padding: 40px clamp(20px, 3vw, 44px) 56px 0;
  border-top: 1px solid var(--hairline-strong);
}

.l-fact + .l-fact {
  padding-left: clamp(20px, 3vw, 44px);
  border-left: 1px solid var(--hairline);
}

.l-fact h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 600;
  line-height: 1.4;
}

.l-fact p {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.l-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 96px;
  margin-bottom: 28px;
}

.l-count {
  font-size: 88px;
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.l-unit {
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 16px;
}

.l-mini {
  width: 96px;
  height: 96px;
  fill: var(--ink);
  fill-rule: evenodd;
}

.l-scanline {
  position: absolute;
  left: -8px;
  width: 112px;
  top: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 18px 2px rgba(194, 65, 12, 0.35);
  opacity: 0;
}

.l-fact.is-in .l-scanline {
  animation: l-scan 2.4s cubic-bezier(0.45, 0, 0.55, 1) 0.2s infinite;
}

.l-bar {
  width: 14px;
  height: var(--h, 50%);
  border-radius: 3px 3px 0 0;
  background: var(--ink);
  transform-origin: bottom;
}

.l-bar:nth-child(1) { --h: 34%; }
.l-bar:nth-child(2) { --h: 58%; }
.l-bar:nth-child(3) { --h: 46%; }
.l-bar:nth-child(4) { --h: 82%; }
.l-bar:nth-child(5) { --h: 64%; }
.l-bar:nth-child(6) { --h: 100%; }

.is-animated .l-fact:not(.is-in) .l-bar {
  transform: scaleY(0);
}

.is-animated .l-fact .l-bar {
  transition: transform 0.9s var(--ease-out);
}

.l-fact.is-in .l-bar:nth-child(2) { transition-delay: 0.06s; }
.l-fact.is-in .l-bar:nth-child(3) { transition-delay: 0.12s; }
.l-fact.is-in .l-bar:nth-child(4) { transition-delay: 0.18s; }
.l-fact.is-in .l-bar:nth-child(5) { transition-delay: 0.24s; }
.l-fact.is-in .l-bar:nth-child(6) { transition-delay: 0.3s; }

.l-fact.is-in .l-bar {
  animation: l-breathe 3.2s ease-in-out 1.2s infinite;
}

.l-fact.is-in .l-bar:nth-child(odd) {
  animation-delay: 1.8s;
}

.is-animated .l-fact:not(.is-in) .l-mini {
  opacity: 0;
  transform: scale(0.8);
}

.is-animated .l-fact .l-mini {
  transition: opacity 0.6s var(--ease-out), transform 0.9s var(--ease-out);
}

/* --- Trust statement --- */

.l-trust {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(96px, 18vh, 200px);
}

.l-statement {
  max-width: 18em;
  margin: 0 0 32px;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* A phrase wraps as one unit, so a line never breaks inside a Thai word group. */
.l-phrase {
  display: inline-block;
  transition: opacity 0.5s ease, color 0.5s ease;
}

/* The orange underline marks a short link, as in the hero. */
.l-phrase strong {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: none;
}

.is-animated .l-phrase {
  opacity: 0.16;
}

.is-animated .l-phrase.is-lit {
  opacity: 1;
}

.l-note {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

body.landing footer {
  position: relative;
  background: var(--canvas);
}

/* --- Keyframes --- */

@keyframes l-rise {
  from {
    transform: translateY(110%);
  }
}

@keyframes l-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes l-corner {
  from {
    opacity: 0;
    transform: scale(0.86) rotate(-6deg);
  }
}

@keyframes l-scan {
  0% {
    top: 0;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  70% {
    top: 93px;
    opacity: 1;
  }
  85%,
  100% {
    top: 93px;
    opacity: 0;
  }
}

@keyframes l-breathe {
  50% {
    transform: scaleY(0.82);
  }
}

/* --- Narrow screens --- */

@media (max-width: 880px) {
  .l-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 40px;
    padding-bottom: 72px;
  }

  .l-corner {
    display: none;
  }

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

  .l-fact,
  .l-fact + .l-fact {
    padding: 32px 0 40px;
    border-left: 0;
  }

  .l-art {
    height: 80px;
    margin-bottom: 20px;
  }

  .l-count {
    font-size: 72px;
  }

  .l-mini {
    width: 80px;
    height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .l-short {
    visibility: visible;
  }

  .is-animated .l-phrase,
  .is-animated .l-host,
  .is-animated .l-underline {
    opacity: 1;
  }

  .is-animated .l-fact:not(.is-in) .l-bar,
  .is-animated .l-fact:not(.is-in) .l-mini {
    opacity: 1;
    transform: none;
  }
}
