:root {
  --ground: #F4F3EF;
  --surface: #FFFFFF;
  --ink: #0E0F12;
  --muted: #565A63;
  --faint: #8C9099;
  --rule: #E3E1DB;
  --accent: #3F7EF5;        /* NEAR blue, from the app icon */
  --accent-deep: #1F59D1;
  --accent-soft: #E4ECFD;
  --glow: #96C1FA;
  --night: #0B0C10;
  --night-2: #131826;
  --on-night: #E9EDF5;
  --on-night-muted: #99A2B4;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  font-variant-numeric: lining-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
address { font-style: normal; }
::selection { background: var(--accent-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--rule); box-shadow: 0 6px 24px -18px rgba(14, 15, 18, .35); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 38px; width: auto; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.05); }
.brand span { font-family: var(--serif); font-size: 19px; letter-spacing: .22em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; letter-spacing: .03em; }
.nav a { text-decoration: none; color: var(--muted); position: relative; transition: color .2s; }
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.nav .nav-cta { color: var(--ink); border: 1px solid var(--ink); border-radius: 999px; padding: 7px 16px; transition: background .25s, color .25s; }
.nav .nav-cta:hover { background: var(--ink); color: var(--ground); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 15px; font-weight: 500; padding: 13px 22px; border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, color .25s;
}
.btn span { transition: transform .25s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 10px 30px -12px rgba(63, 126, 245, .7); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--rule); background: rgba(255, 255, 255, .5); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--glow); transform: translateY(-2px); }

/* ---------- Type ---------- */
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-deep); margin: 0 0 16px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; margin: 0 0 20px; text-wrap: balance; }
h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 16px; }
.lead { color: var(--muted); max-width: 58ch; font-size: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; isolation: isolate; }
.aura { position: absolute; inset: -20% -10% auto; height: 140%; z-index: -1; pointer-events: none; filter: blur(70px); opacity: .75; }
.aura span { position: absolute; border-radius: 50%; animation: drift 22s ease-in-out infinite alternate; }
.aura span:nth-child(1) { width: 520px; height: 520px; background: #BFD5FC; top: 5%; right: 8%; }
.aura span:nth-child(2) { width: 420px; height: 420px; background: #E9D9F7; top: 35%; right: 34%; animation-duration: 28s; animation-delay: -6s; }
.aura span:nth-child(3) { width: 360px; height: 360px; background: #F7E6CF; top: 0; left: -4%; animation-duration: 25s; animation-delay: -12s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.12); }
  100% { transform: translate(-50px, 50px) scale(.95); }
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; min-height: min(640px, 78vh); }
.headline {
  font-family: var(--serif); font-weight: 400; margin: 0 0 24px;
  font-size: clamp(46px, 7.4vw, 92px); line-height: .98; letter-spacing: -.01em;
}
.headline em { font-style: italic; color: var(--accent-deep); }
.headline .w { display: inline-block; }

/* entrance animation */
.rise, .headline .w { opacity: 0; transform: translateY(28px); animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 90ms + 100ms); }
.headline .w { filter: blur(6px); animation-name: rise-blur; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes rise-blur { to { opacity: 1; transform: none; filter: blur(0); } }

/* phone */
.hero-visual { position: relative; justify-self: center; }
.phone {
  width: 290px; height: 590px; border-radius: 52px; padding: 12px;
  background: linear-gradient(145deg, #2A2D35, #0B0C10 60%);
  box-shadow: 0 50px 90px -30px rgba(20, 40, 90, .55), inset 0 0 0 1px rgba(255, 255, 255, .08);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-14px) rotate(.6deg); } }
.phone-screen {
  position: relative; height: 100%; border-radius: 41px; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 38%, #18203A 0%, var(--night) 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.island { position: absolute; top: 12px; width: 96px; height: 28px; border-radius: 20px; background: #000; }
.now {
  position: absolute; left: 16px; right: 16px; bottom: 22px; padding: 14px 16px; border-radius: 22px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px); color: var(--on-night); display: grid; gap: 2px;
}
.now-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--glow); }
.now-title { font-size: 14px; font-weight: 500; }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; margin-top: 8px; }
.bars b { width: 3px; height: 100%; border-radius: 2px; background: var(--glow); animation: eq 1.1s ease-in-out infinite; transform-origin: bottom; }
.bars b:nth-child(2) { animation-delay: -.2s; } .bars b:nth-child(3) { animation-delay: -.5s; }
.bars b:nth-child(4) { animation-delay: -.8s; } .bars b:nth-child(5) { animation-delay: -.35s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* pulse rings around the NEAR icon */
.pulse { position: relative; display: grid; place-items: center; width: 120px; height: 120px; margin-bottom: 70px; }
.pulse img { position: relative; width: 100%; border-radius: 26%; box-shadow: 0 16px 40px -10px rgba(63, 126, 245, .55); }
.pulse i {
  position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--glow);
  opacity: 0; animation: ring 3.6s cubic-bezier(.1, .6, .3, 1) infinite;
}
.pulse i:nth-child(2) { animation-delay: 1.2s; } .pulse i:nth-child(3) { animation-delay: 2.4s; }
@keyframes ring { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }
.pulse-lg { width: 200px; height: 200px; margin: 0; }
.pulse-sm { width: 112px; height: 112px; margin: 0; flex: none; }
.pulse-sm i { border-color: var(--accent); }

.chip {
  position: absolute; white-space: nowrap; font-size: 13.5px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 9px 15px;
  box-shadow: 0 14px 30px -16px rgba(14, 15, 18, .35); display: flex; align-items: center; gap: 8px;
  animation: float 6s ease-in-out infinite;
}
.chip-a { top: 18%; left: -68px; animation-delay: -2s; }
.chip-b { bottom: 24%; right: -54px; animation-delay: -4s; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34C27A; box-shadow: 0 0 0 0 rgba(52, 194, 122, .6); animation: blip 2s infinite; }
@keyframes blip { 70% { box-shadow: 0 0 0 8px rgba(52, 194, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 194, 122, 0); } }

/* ---------- Ticker ---------- */
.ticker { border-block: 1px solid var(--rule); overflow: hidden; background: var(--surface); }
.ticker-track { display: flex; width: max-content; animation: scroll 38s linear infinite; }
.ticker span {
  font-family: var(--serif); font-size: 26px; font-style: italic; padding: 18px 28px; white-space: nowrap; color: var(--muted);
  display: flex; align-items: center; gap: 56px;
}
.ticker span::after { content: "✦"; font-style: normal; font-size: 13px; color: var(--accent); margin-left: 28px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section { padding: 112px 0; }
.section-head { max-width: 720px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 22px; padding: 32px 28px 28px;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--glow));
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 28px 50px -30px rgba(31, 89, 209, .45); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }
.card p { color: var(--muted); font-size: 15.5px; margin: 0; }
.num { display: block; font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--accent); margin-bottom: 28px; }

/* NEAR band */
.night { background: radial-gradient(90% 120% at 15% 50%, #16203A 0%, var(--night) 60%); color: var(--on-night); }
.night .lead { color: var(--on-night-muted); }
.night .eyebrow { color: var(--glow); }
.near-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 72px; align-items: center; }
.near-art { display: grid; place-items: center; min-height: 380px; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: center; }
.ticks li::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(150, 193, 250, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5' fill='none' stroke='%2396C1FA' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.pill {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 8px 14px; color: var(--on-night-muted);
}

/* Contact */
.contact { display: grid; grid-template-columns: 1.3fr .7fr; gap: 48px; align-items: end; }
.contact-line {
  display: inline-block; font-family: var(--serif); font-size: clamp(26px, 3.6vw, 40px); text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 1px no-repeat; transition: background-size .5s var(--ease), color .3s;
  padding-bottom: 2px; word-break: break-word;
}
.contact-line:hover { background-size: 100% 1px; color: var(--accent-deep); }
.contact-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 22px; padding: 28px; }
.contact-card address { color: var(--muted); line-height: 1.7; }

/* Scroll reveal (only hidden once JS has confirmed it can show it again) */
.js [data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--d, 0) * 110ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Document pages ---------- */
.doc { padding: 72px 0 104px; }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 6vw, 56px); line-height: 1.05; margin: 0 0 8px; }
.doc h2 {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 52px 0 4px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.doc h3 { margin-top: 28px; }
.doc p, .doc ul { color: var(--muted); max-width: 66ch; margin: 16px 0; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc li { margin: 8px 0; }
.doc li::marker { color: var(--accent); }
.doc a { color: var(--accent-deep); }
.doc em { color: var(--faint); font-style: normal; font-size: 14.5px; }
.doc hr { border: none; border-top: 1px solid var(--rule); margin: 52px 0 0; }
.app-hero { display: flex; align-items: center; gap: 36px; margin-bottom: 28px; }
.app-hero .eyebrow { margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--on-night-muted); padding: 72px 0 32px; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.footer-brand img { width: 220px; margin-bottom: 22px; }
.footer-brand address { line-height: 1.7; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: var(--on-night); text-decoration: none; }
.site-footer a:hover { color: var(--glow); }
.footer-base { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 40px 0 72px; }
  .hero-grid, .near-grid, .contact { grid-template-columns: 1fr; gap: 56px; }
  .hero-grid { min-height: 0; }
  .near-art { min-height: 300px; }
  .cards { grid-template-columns: 1fr; }
  .chip-a { left: -30px; } .chip-b { right: -24px; }
}
@media (max-width: 560px) {
  .nav { gap: 16px; }
  .nav .hide-sm, .brand span { display: none; }
  section { padding: 80px 0; }
  .phone { width: 250px; height: 510px; }
  .chip { font-size: 12px; }
  .chip-a { left: -18px; } .chip-b { right: -14px; }
  .app-hero { gap: 24px; }
  .pulse-sm { width: 84px; height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rise, .headline .w, .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  html { scroll-behavior: auto; }
}

/* Nothing decorative may widen the page on small screens. */
html, body { overflow-x: clip; }
.night, .ticker, .hero { overflow: hidden; }
.hero-grid > *, .near-grid > *, .contact > * { min-width: 0; }
@media (max-width: 380px) {
  .phone { width: 220px; height: 450px; border-radius: 44px; }
  .phone-screen { border-radius: 34px; }
  .chip-a { left: -8px; } .chip-b { right: -8px; }
  .pulse-lg { width: 150px; height: 150px; }
  .pill { white-space: normal; }
}
section[id] { scroll-margin-top: 72px; }
