/* 2027 style: aurora mesh, glass, bento grid, oklch, scroll-driven motion */
:root {
  --bg: oklch(98% .01 270);
  --fg: oklch(20% .03 270);
  --muted: oklch(45% .03 270);
  --glass: oklch(100% 0 0 / .55);
  --stroke: oklch(20% .03 270 / .1);
  --a: oklch(72% .17 220);
  --b: oklch(65% .22 295);
  --c: oklch(78% .17 350);
  --shadow: 0 20px 60px -20px oklch(40% .15 280 / .35);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: oklch(14% .02 280);
  --fg: oklch(96% .01 270);
  --muted: oklch(72% .03 270);
  --glass: oklch(100% 0 0 / .06);
  --stroke: oklch(100% 0 0 / .12);
  --shadow: 0 20px 60px -20px oklch(0% 0 0 / .8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(14% .02 280); --fg: oklch(96% .01 270); --muted: oklch(72% .03 270);
    --glass: oklch(100% 0 0 / .06); --stroke: oklch(100% 0 0 / .12);
    --shadow: 0 20px 60px -20px oklch(0% 0 0 / .8); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg);
  font: 400 1.05rem/1.7 "Anuphan", "Space Grotesk", system-ui, sans-serif;
  padding-inline: clamp(1rem, 4vw, 3rem); overflow-x: hidden;
  transition: background .4s, color .4s;
}
a { color: inherit; text-decoration: none; }
.glass {
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow);
}

/* Background */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.aurora i {
  position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  filter: blur(90px); opacity: .55; animation: drift 24s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { background: var(--a); top: -20%; left: -10%; }
.aurora i:nth-child(2) { background: var(--b); top: 10%; right: -20%; animation-delay: -8s; }
.aurora i:nth-child(3) { background: var(--c); bottom: -25%; left: 25%; animation-delay: -16s; opacity: .4; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15) rotate(30deg); } }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 28rem; height: 28rem; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in oklch, var(--a) 35%, transparent), transparent 65%);
  transform: translate(calc(var(--mx, -50vw) - 50%), calc(var(--my, -50vh) - 50%));
  transition: transform .25s ease-out; opacity: .6;
}

/* Nav */
.nav {
  position: sticky; top: .8rem; z-index: 10; margin-top: .8rem; max-width: 62rem; margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem .7rem .55rem 1rem; border-radius: 999px;
}
.nav nav { display: flex; gap: 1.4rem; font-size: .95rem; color: var(--muted); }
.nav nav a:hover { color: var(--fg); }
.brand { display: flex; align-items: center; gap: .6rem; font-family: "Space Grotesk", sans-serif; font-weight: 600; }
.brand em { font-style: normal; color: var(--muted); font-weight: 400; }
.logo {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .7rem; color: #0b0b14;
  background: linear-gradient(135deg, var(--a), var(--b)); font-weight: 700;
}
.tools { display: flex; gap: .4rem; }
.chip {
  font: inherit; font-size: .85rem; color: var(--fg); cursor: pointer; padding: .3rem .8rem;
  border-radius: 999px; border: 1px solid var(--stroke); background: transparent; transition: background .2s;
}
.chip:hover { background: var(--glass); }
@media (max-width: 640px) { .nav nav { display: none; } }

/* Hero */
.hero { min-height: 82dvh; display: grid; align-content: center; justify-items: center; text-align: center; padding-block: 5rem 3rem; position: relative; }
.pill { display: inline-flex; align-items: center; gap: .6rem; padding: .35rem 1rem; border-radius: 999px; font-size: .85rem; color: var(--muted); }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: oklch(75% .2 150); box-shadow: 0 0 0 0 oklch(75% .2 150 / .6); animation: ping 2s infinite; }
@keyframes ping { to { box-shadow: 0 0 0 .7rem transparent; } }
h1 {
  font-size: clamp(3.2rem, 11vw, 8rem); line-height: 1.05; letter-spacing: -.04em; margin: 1.5rem 0 1rem; font-weight: 650;
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}
.grad {
  background: linear-gradient(100deg, var(--a), var(--b), var(--c), var(--a)); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 250% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(2rem); filter: blur(12px); } }
.lead { max-width: 38rem; color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.3rem); margin: 0 0 2rem; }
.lead b { color: var(--fg); }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.btn {
  display: inline-block; padding: .85rem 1.7rem; border-radius: 999px; font-weight: 500;
  border: 1px solid var(--stroke); transition: transform .2s, box-shadow .3s; will-change: transform;
}
.btn.primary { background: linear-gradient(120deg, var(--a), var(--b)); color: #0b0b14; border: 0; box-shadow: 0 10px 40px -10px var(--b); }
.btn.ghost { background: var(--glass); backdrop-filter: blur(12px); }
.btn:hover { box-shadow: 0 14px 50px -8px var(--a); }
.scroll-hint { position: absolute; bottom: 1rem; width: 1.6rem; height: 2.6rem; border: 2px solid var(--stroke); border-radius: 1rem; }
.scroll-hint span { position: absolute; left: 50%; top: .5rem; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--muted); animation: wheel 1.6s infinite; }
@keyframes wheel { to { transform: translateY(1rem); opacity: 0; } }

/* Sections */
.section { max-width: 46rem; margin: 6rem auto; text-align: center; }
h2 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.03em; margin: 0 0 .5rem; line-height: 1.2; }
.sub { color: var(--muted); margin: 0 auto 1.5rem; }

/* Bento */
.bento {
  max-width: 62rem; margin: 0 auto; display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(12rem, auto);
}
.card { position: relative; overflow: hidden; border-radius: 1.8rem; padding: 1.6rem; display: flex; flex-direction: column; justify-content: flex-end; container-type: inline-size; transition: transform .3s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.card.big { grid-column: span 2; grid-row: span 2; }
.card.wide { grid-column: span 2; }
.card h3 { margin: .4rem 0 .3rem; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.card.big h3 { font-size: clamp(1.8rem, 4cqi, 2.6rem); }
.tag { align-self: flex-start; font-size: .75rem; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--stroke); color: var(--muted); }
.clock { font: 600 clamp(2.2rem, 8cqi, 3.6rem) "Space Grotesk", monospace; font-variant-numeric: tabular-nums; }
.orb {
  position: absolute; right: -4rem; top: -4rem; width: 16rem; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--a), var(--b), var(--c), var(--a)); filter: blur(30px); opacity: .7; animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .bento { grid-template-columns: 1fr; } .card.big, .card.wide { grid-column: auto; grid-row: auto; min-height: 15rem; } }

.contact { padding: 3rem 1.5rem; border-radius: 2rem; }
footer { max-width: 62rem; margin: 4rem auto 2rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; color: var(--muted); font-size: .9rem; }

/* Scroll-driven reveal (progressive) */
.reveal { opacity: 0; transform: translateY(2rem); transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
@supports (animation-timeline: view()) {
  .reveal { opacity: 1; transform: none; transition: none; animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
  @keyframes reveal { from { opacity: 0; transform: translateY(2.5rem) scale(.97); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
