:root {
  --bg: #000;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --card: rgba(28, 28, 32, 0.72);
  --card-solid: #141417;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --violet: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #38bdf8;
  --radius: 30px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(139, 92, 246, 0.45); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 12px; }

/* ---------- Ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; will-change: transform; }
.aurora .a1 { width: 60vw; height: 42vw; left: 8vw; top: 38vh; background: radial-gradient(closest-side, #1d4ed8, transparent); animation: drift1 26s var(--ease) infinite alternate; }
.aurora .a2 { width: 55vw; height: 40vw; right: 2vw; top: 30vh; background: radial-gradient(closest-side, #7c3aed, transparent); animation: drift2 30s var(--ease) infinite alternate; }
.aurora .a3 { width: 40vw; height: 30vw; left: 35vw; top: 55vh; background: radial-gradient(closest-side, #c026d3, transparent); opacity: 0.32; animation: drift1 34s var(--ease) infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(6vw, -6vh, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-8vw, 4vh, 0) scale(0.94); } }
.stars { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: 0.7; }

/* ---------- Nav ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 50; padding: 18px clamp(14px, 6vw, 88px) 0; }
.nav {
  max-width: 1360px; margin: 0 auto; height: 64px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 22px; border: 1px solid var(--line-2);
  background: linear-gradient(100deg, rgba(40,40,46,.62), rgba(30,30,36,.5) 40%, rgba(50,40,70,.45) 70%, rgba(30,30,36,.55));
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  transition: background .4s var(--ease), height .4s var(--ease);
}
.nav-wrap.scrolled .nav { height: 56px; background: rgba(22,22,26,.72); }
.brand { font-size: 1.45rem; letter-spacing: -0.02em; color: var(--ink-2); font-weight: 400; }
.brand strong { color: var(--ink); font-weight: 600; }
.nav-links { display: flex; gap: clamp(16px, 3vw, 44px); }
.nav-links a { font-size: 1.02rem; color: #d2d2d7; transition: color .2s; }
.nav-links a:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: clamp(64px, 11vh, 120px) 24px 0; max-width: 1180px; margin: 0 auto; }
.hero-title {
  margin: 0; font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8ed 42%, #a7a7b0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.hero-sub { margin: 26px auto 0; max-width: 780px; font-size: clamp(1.08rem, 1.6vw, 1.42rem); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.hero-cta { margin-top: 38px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 30px; border-radius: 999px; font-size: 1.08rem; font-weight: 500;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn:active { transform: scale(.97); }
.btn-light { background: #f5f5f7; color: #000; }
.btn-light:hover { background: #fff; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line-2); color: #d2d2d7; background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.06); }

/* ---------- Cards (shared) ---------- */
.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, rgba(44,44,50,.78), rgba(22,22,26,.82));
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: transform .5s var(--ease), border-color .4s, box-shadow .5s var(--ease);
  cursor: pointer; isolation: isolate;
}
.card::after { /* soft light following pointer */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(140,120,255,.16), transparent 60%);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 40px 80px -30px rgba(40,20,120,.55), inset 0 1px 0 rgba(255,255,255,.08); }
.card:hover::after { opacity: 1; }
.pill {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 12px;
  font-size: .95rem; color: #e8e8ed; background: rgba(40,40,46,.78);
  border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px; font-size: .92rem; color: #e8e8ed; background: rgba(255,255,255,.08); }
.card h3 { margin: 0; font-size: clamp(1.5rem, 2.1vw, 2.15rem); letter-spacing: -0.025em; font-weight: 600; line-height: 1.08; }
.card .meta { margin-top: 8px; color: var(--ink-2); font-size: 1.02rem; }

/* ---------- Bento ---------- */
.bento {
  max-width: 1360px; margin: clamp(64px, 10vh, 110px) auto 0; padding: 0 clamp(14px, 4vw, 40px);
  display: grid; gap: 22px;
  grid-template-columns: minmax(0,1.55fr) minmax(0,.9fr) minmax(0,1.08fr) minmax(0,.66fr);
  grid-template-rows: 280px 290px;
}
.bento .card { display: flex; flex-direction: column; padding: 26px; }
.b-feature { grid-row: span 2; }
.b-feature .pill { position: absolute; top: 26px; left: 26px; z-index: 3; }
.b-feature .stage { flex: 1; display: grid; place-items: center; position: relative; min-height: 0; margin: 0 -4px 18px; }
.b-feature .foot { position: relative; z-index: 2; }
.b-feature .foot .chips { margin-top: 12px; }
.b-tile { justify-content: flex-end; }
.b-tile .icon { width: 50px; height: 50px; margin-bottom: auto; color: #c7c7cc; }
.b-tile h3 { font-size: clamp(1.25rem, 1.55vw, 1.7rem); }
.b-tile .meta { font-size: .95rem; }

/* Laptop mockup */
.stage-laptop { background: radial-gradient(120% 90% at 30% 20%, rgba(124,58,237,.55), rgba(30,58,138,.4) 45%, rgba(20,20,30,.2) 80%); border-radius: 22px; padding: 10% 6% 9%; }
.laptop { width: 100%; max-width: 560px; }
.laptop .lid { background: #0b0b0d; border-radius: 16px 16px 4px 4px; padding: 2.4% 2.4% 3%; border: 1px solid #2a2a30; box-shadow: 0 30px 60px rgba(0,0,0,.6); }
.laptop .lid img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 4px; }
.laptop .base { height: 12px; margin: 0 -7%; background: linear-gradient(#3a3a40, #1a1a1e); border-radius: 0 0 14px 14px; position: relative; }
.laptop .base::before { content: ""; position: absolute; left: 42%; right: 42%; top: 0; height: 5px; background: #111; border-radius: 0 0 8px 8px; }

/* Phone mockup */
.stage-phone { overflow: visible; }
.phone {
  width: min(62%, 210px); aspect-ratio: 9/19.3; border-radius: 34px; padding: 7px; background: #0b0b0d;
  border: 1px solid #34343a; box-shadow: 0 0 0 2px #1c1c20, 0 30px 60px rgba(0,0,0,.65); position: relative;
  transform: rotate(-2deg);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 27px; }
.phone::before { content: ""; position: absolute; top: 14px; left: 50%; width: 30%; height: 18px; transform: translateX(-50%); background: #000; border-radius: 12px; z-index: 2; }

/* Screen (app window) */
.stage-screen { padding: 18% 0 0; }
.window { width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid #2c2c34; background: #0b0b10; box-shadow: 0 30px 60px rgba(0,0,0,.6); }
.window .bar { height: 22px; display: flex; gap: 6px; align-items: center; padding: 0 10px; background: #18181d; }
.window .bar i { width: 8px; height: 8px; border-radius: 50%; background: #3a3a42; }
.window img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top left; }

/* ---------- Catalog ---------- */
.catalog { max-width: 1360px; margin: clamp(110px, 16vh, 170px) auto 0; padding: 0 clamp(14px, 4vw, 40px); }
.section-head h2, .about h2, .contact h2 { margin: 0; font-size: clamp(2.2rem, 4.6vw, 4rem); letter-spacing: -0.04em; font-weight: 700; line-height: 1.04; }
.section-head p { margin: 14px 0 0; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.3rem); max-width: 640px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 36px 0 30px; }
.filter {
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03);
  color: #d2d2d7; font: 500 1rem var(--font); cursor: pointer; transition: all .25s var(--ease);
}
.filter:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.filter[aria-selected="true"] { background: #f5f5f7; color: #000; border-color: #f5f5f7; }
.filter .n { margin-left: 6px; opacity: .55; font-variant-numeric: tabular-nums; }

.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.p-card { display: flex; flex-direction: column; }
.p-card .media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #0d0d12; }
.p-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.p-card:hover .media img { transform: scale(1.04); }
.p-card:hover .media.m-phone img, .p-card:hover .media.m-icon img { transform: translateY(-6px); }
.p-card .media .pill { position: absolute; top: 16px; left: 16px; height: 30px; font-size: .86rem; }
.p-card .media .pill.right { left: auto; right: 16px; }
.p-card .info { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.p-card h3 { font-size: 1.55rem; }
.p-card p { margin: 0; color: var(--ink-2); line-height: 1.45; font-size: 1.02rem; }
.p-card .chips { margin-top: auto; padding-top: 6px; }
.p-card .chip { height: 28px; font-size: .84rem; }
.p-card.hide { display: none; }
.p-card.enter { animation: cardIn .6s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* media variants inside catalog cards */
.media.m-phone, .media.m-icon { display: grid; place-items: center; background: radial-gradient(90% 90% at 50% 10%, rgba(59,130,246,.35), rgba(124,58,237,.18) 50%, #0d0d12 85%); }
.media.m-phone { align-items: start; }
.media.m-phone img { width: 38%; height: auto; aspect-ratio: 1/2; margin-top: 9%; border-radius: 22px; border: 6px solid #0b0b0d; box-shadow: 0 0 0 1px #34343a, 0 20px 40px rgba(0,0,0,.6); object-fit: cover; }
.media.m-icon img { width: 44%; height: auto; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 24px 50px rgba(0,0,0,.6); }
.media.m-cover img { object-fit: cover; }
.media.m-cover.contain { display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 50%, rgba(234,179,8,.18), #0d0d12 75%); }
.media.m-cover.contain img { width: 82%; height: auto; object-fit: contain; }
.media.m-cover.fit { display: block; background: #07070b; }
.media.m-cover.fit img { width: 100%; height: 100%; object-fit: contain; }
.sheet-media.m-cover.fit img { object-fit: contain; }
.media.m-glyph { display: grid; place-items: center; }
.media.m-glyph svg { width: 46%; height: auto; overflow: visible; }
.g-wave { background: radial-gradient(80% 90% at 50% 40%, rgba(34,197,94,.22), rgba(56,189,248,.14) 50%, #0d0d12 85%); }
.g-bridge { background: radial-gradient(80% 90% at 50% 40%, rgba(244,114,182,.24), rgba(139,92,246,.18) 50%, #0d0d12 85%); }
.g-orbit { background: radial-gradient(80% 90% at 50% 40%, rgba(56,189,248,.26), rgba(59,130,246,.14) 50%, #0d0d12 85%); }
.g-spark { background: radial-gradient(80% 90% at 50% 40%, rgba(232,121,249,.26), rgba(168,85,247,.16) 50%, #0d0d12 85%); }

/* ---------- About & Contact ---------- */
.about { max-width: 1180px; margin: clamp(120px, 18vh, 200px) auto 0; padding: 0 clamp(18px, 4vw, 40px); }
.eyebrow { margin: 0 0 14px; color: var(--ink-3); font-size: 1rem; font-weight: 600; letter-spacing: .02em; }
.grad { background: linear-gradient(90deg, #a78bfa, #60a5fa 55%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-cols { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); }
.about-cols p { margin: 0; color: var(--ink-2); font-size: clamp(1.05rem, 1.35vw, 1.24rem); line-height: 1.55; }

.contact { max-width: 1360px; margin: clamp(110px, 16vh, 180px) auto 0; padding: 0 clamp(14px, 4vw, 40px); }
.contact-card {
  text-align: center; padding: clamp(56px, 9vw, 110px) 24px; border-radius: 36px; border: 1px solid var(--line);
  background: radial-gradient(70% 120% at 50% 0%, rgba(124,58,237,.32), rgba(29,78,216,.16) 45%, rgba(20,20,24,.85) 80%);
}
.contact-card p { margin: 16px 0 0; color: var(--ink-2); font-size: clamp(1.05rem, 1.5vw, 1.3rem); }
.contact-links { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.footer { max-width: 1360px; margin: 80px auto 0; padding: 28px clamp(18px, 4vw, 40px) 44px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--ink-3); font-size: .95rem; border-top: 1px solid var(--line); }
.footer a:hover { color: var(--ink); }

/* ---------- Sheet (project detail) ---------- */
.sheet {
  width: min(880px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line-2); border-radius: 30px;
  background: #121216; color: var(--ink); overflow: auto; box-shadow: 0 50px 120px rgba(0,0,0,.7);
}
.sheet::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sheet[open] { animation: sheetIn .5s var(--ease); }
.sheet[open]::backdrop { animation: fade .4s ease; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
.sheet-close { position: absolute; top: 16px; right: 16px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: rgba(40,40,46,.8); backdrop-filter: blur(10px); cursor: pointer; }
.sheet-close:hover { background: rgba(70,70,78,.9); }
.sheet-media { aspect-ratio: 16/8.5; overflow: hidden; }
.sheet-media.m-cover img { width: 100%; height: 100%; object-fit: cover; }
.sheet-media.m-cover.contain img { width: 70%; height: auto; object-fit: contain; }
.sheet-media.m-phone { align-items: start; }
.sheet-media.m-phone img { width: min(30%, 240px); height: auto; aspect-ratio: auto; margin-top: 5%; }
.sheet-media.m-icon img { width: min(30%, 240px); }
.sheet-media.m-glyph svg { width: 26%; }
.sheet-body { padding: 30px clamp(22px, 4vw, 44px) 40px; }
.sheet-kicker { margin: 0; color: var(--ink-2); font-size: 1rem; }
.sheet h3 { margin: 6px 0 14px; font-size: clamp(1.9rem, 3.4vw, 2.8rem); letter-spacing: -0.035em; line-height: 1.05; }
.sheet-text { margin: 0 0 20px; color: #d2d2d7; font-size: 1.12rem; line-height: 1.55; }
.sheet-links { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { opacity: 1; transform: none; transition: none; animation: heroIn 1.2s var(--ease) both; }
.hero .reveal:nth-child(2) { animation-delay: .12s; }
.hero .reveal:nth-child(3) { animation-delay: .24s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: auto; }
  .b-feature { grid-row: auto; grid-column: 1 / -1; min-height: 560px; }
  .b-phone, .b-screen { min-height: 520px; }
  .b-tile { min-height: 230px; }
}
@media (max-width: 760px) {
  .nav { padding: 0 18px; height: 56px; }
  .brand { font-size: 1.15rem; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: .95rem; }
  .bento { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
  .b-tile h3 { font-size: 1.2rem; }
  .b-feature, .b-phone, .b-screen { grid-column: 1 / -1; }
  .b-feature { min-height: 460px; }
  .b-tile { min-height: 190px; padding: 20px !important; }
  .b-tile .icon { width: 38px; height: 38px; }
  .about-cols { grid-template-columns: 1fr; }
  .btn { min-height: 48px; padding: 0 24px; font-size: 1rem; }
}
@media (max-width: 420px) {
  .nav-links a:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
