/*
 * Glass, in the Apple sense: a translucent layer that samples what is behind it.
 *
 * Three things make it read as glass rather than a grey box, and all three are
 * required — drop any one and it looks like flat translucency:
 *   1. something worth refracting behind it (the aurora, below)
 *   2. blur AND saturation, so colour survives the blur instead of going milky
 *   3. a specular edge — a bright hairline on the lit side, dimmer opposite
 */
/* Palette sampled from turbo.co.th itself rather than eyeballed:
     #fa4786 pink, #002d72 navy, #ffedf3 pink wash, #e6eaf1 blue-grey. */
:root {
  --ink: #0f1c33;
  --muted: #5b6b86;
  --pink: #fa4786;
  --pink-deep: #d81f68;
  --navy: #002d72;
  --wash: #ffedf3;
  --glass-line: rgba(255, 255, 255, 0.75);
  --radius: 26px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  /* Light ground, because the brand is white-first with pink and navy on top. */
  background: #fdf7fa;
  color: var(--ink);
  font-family: 'IBM Plex Sans Thai', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Aurora ------------------------------------------------------------- */
/* Slow, large, low-opacity colour fields. They move far enough that the glass
   above them shifts hue over time, which is what sells the refraction. */
.aurora { position: fixed; inset: -20%; z-index: 0; filter: blur(80px) saturate(125%); }
/* Gentler than the dark-ground version: on white, a strong multiply blend
   swamps the card and flattens every edge. */
.blob { position: absolute; border-radius: 50%; opacity: 0.30; mix-blend-mode: multiply; }
.b1 { width: 48vw; height: 48vw; left: 4%;  top: 2%;  background: radial-gradient(circle, #fa4786 0%, transparent 68%); animation: drift1 24s ease-in-out infinite alternate; }
.b2 { width: 54vw; height: 54vw; right: 0%; top: 18%; background: radial-gradient(circle, #002d72 0%, transparent 70%); animation: drift2 31s ease-in-out infinite alternate; }
.b3 { width: 44vw; height: 44vw; left: 26%; bottom: -4%; background: radial-gradient(circle, #ff9ec4 0%, transparent 70%); animation: drift3 27s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(9vw, 7vh, 0) scale(1.16); } }
@keyframes drift2 { to { transform: translate3d(-11vw, 5vh, 0) scale(1.1); } }
@keyframes drift3 { to { transform: translate3d(6vw, -8vh, 0) scale(1.2); } }

#field { position: fixed; inset: 0; display: block; z-index: 1; }

.wrap { position: relative; z-index: 2; min-height: 100%; display: grid; place-items: center; padding: 24px; }

/* --- The glass card ----------------------------------------------------- */
.card {
  position: relative;
  width: min(400px, 100%);
  padding: 44px 38px 34px;
  text-align: center;
  border-radius: var(--radius);
  overflow: hidden;

  /* A gradient rather than a flat fill: glass is brighter where light enters.
     Tuned for a LIGHT ground — the first version was written for a dark one and
     at 0.13 white on white the card simply vanished into the aurora. */
  background: linear-gradient(155deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.78) 100%);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 40px 80px -26px rgba(0, 45, 114, 0.30),   /* navy cast shadow, far and soft */
    0 10px 24px -12px rgba(216, 31, 104, 0.26), /* pink contact shadow, near */
    inset 0 1px 0 rgba(255, 255, 255, 1),       /* specular: lit top edge */
    inset 0 -1px 0 rgba(0, 45, 114, 0.06);      /* faint bounce underneath */
  animation: rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

/* A highlight travelling across the surface, the way light crosses real glass. */
.sheen {
  position: absolute; inset: -60% -30%;
  background: linear-gradient(72deg, transparent 42%, rgba(255,255,255,0.55) 50%, transparent 58%);
  animation: sweep 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sweep { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

.mark-ring {
  width: 62px; height: 62px; margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 18px;
  /* White, not pink: the mark ITSELF is pink, and a pink badge behind a pink
     hexagon merges the two into one blob and loses the shape entirely. */
  background: linear-gradient(160deg, #ffffff 0%, var(--wash) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 12px 26px -14px rgba(216, 31, 104, 0.45);
}
.mark { width: 38px; height: 38px; border-radius: 10px; display: block; }

h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }
.th { margin: 5px 0 0; font-size: 14px; font-weight: 600; color: var(--pink-deep); }
.sub { margin: 16px 0 28px; font-size: 12.5px; color: var(--muted); letter-spacing: 0.01em; }

/* --- Glass button ------------------------------------------------------- */
.gbtn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 13px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 14.5px; font-weight: 600; color: #ffffff;
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%);
  box-shadow:
    0 14px 30px -12px rgba(216, 31, 104, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10);
  transition: transform 0.18s cubic-bezier(0.16,1,0.3,1), box-shadow 0.18s ease;
}
.gbtn:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px rgba(216, 31, 104, 0.62), inset 0 1px 0 rgba(255,255,255,0.5); }
.gbtn:active { transform: translateY(0); }
.gbtn:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.gbtn svg { width: 19px; height: 19px; flex: none; background: #fff; border-radius: 50%; padding: 3px; box-sizing: content-box; }
.gbtn-glass {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent 55%);
  pointer-events: none;
}
.gbtn > svg, .gbtn > span { position: relative; }

.note { margin: 22px 0 0; font-size: 11.5px; color: var(--muted); }
.note strong { color: var(--navy); font-weight: 700; }

/* --- 404 ---------------------------------------------------------------- */
.code { font-size: 62px; font-weight: 700; letter-spacing: -0.04em; margin: 0 0 4px;
        background: linear-gradient(180deg, var(--pink), var(--navy)); -webkit-background-clip: text;
        background-clip: text; color: transparent; }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 26px; padding: 12px 22px; width: 100%;
  border-radius: 14px; text-decoration: none;
  font-size: 14px; font-weight: 600; color: var(--ink);
  background: linear-gradient(160deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 12px 28px -12px rgba(0,0,0,0.8);
  transition: transform 0.18s cubic-bezier(0.16,1,0.3,1), background 0.18s ease;
}
.ghost-btn:hover { transform: translateY(-2px); background: linear-gradient(160deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08)); }
.ghost-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .sheen, .blob { animation: none; }
}
