/* TideWay — marketing site */
:root {
  --bg: #02070d;
  --ink: #eef2f7;
  --muted: #8592a6;
  --line: rgba(238, 242, 247, 0.12);
  --accent: #ffd27a;
  --aqua: #7fe3ff;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.serif, em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───── Background canvas, grain ───── */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
main, footer { position: relative; z-index: 2; }
.grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ───── Loader ───── */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; grid-template-rows: auto 1fr auto auto; padding: var(--gutter);
}
.loader__top, .loader__bottom { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.loader__count { align-self: end; font-size: clamp(96px, 26vw, 380px); font-weight: 800; line-height: 0.8; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.loader__bar { height: 1px; background: var(--line); margin: 24px 0; }
.loader__bar i { display: block; height: 100%; width: 0; background: var(--ink); }

/* ───── Cursor ───── */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--ink); mix-blend-mode: difference;
  display: grid; place-items: center;
  transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease);
}
.cursor__label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--bg); opacity: 0; transition: opacity .3s; }
.cursor.is-active { width: 84px; height: 84px; margin: -42px 0 0 -42px; mix-blend-mode: normal; }
.cursor.is-active .cursor__label { opacity: 1; }
.cursor.is-link { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ───── Nav ───── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px var(--gutter); mix-blend-mode: difference;
}
.nav__logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.star-glyph { width: 16px; height: 16px; fill: currentColor; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav__links { display: flex; gap: 28px; font-size: 14px; }
.nav__links a { position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__dev::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: currentColor; vertical-align: middle; opacity: .7; }
.pill { border: 1px solid currentColor; border-radius: 999px; padding: 10px 18px; font-size: 14px; display: inline-block; }
@media (max-width: 820px) { .nav__links { display: none; } }

/* ───── Shared type ───── */
.line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.1em; }
.split { display: inline-block; }
.split .ch { display: inline-block; will-change: transform; }
.h2 { font-size: clamp(44px, 7.4vw, 120px); line-height: 0.92; letter-spacing: -0.045em; font-weight: 500; margin: 0; }
.h2 em { letter-spacing: -0.02em; }
.serif-xl { font-size: clamp(30px, 3.6vw, 56px); line-height: 1.02; margin: 0; }
.section-tag { display: flex; gap: 18px; color: var(--muted); margin-bottom: clamp(28px, 5vw, 64px); }
section { padding: clamp(96px, 16vh, 180px) var(--gutter); }

/* ───── Hero ───── */
.hero { overflow-x: clip; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding-top: 96px; padding-bottom: 36px; position: relative; }
.hero__meta { display: flex; justify-content: space-between; color: var(--muted); }
.hero__title {
  align-self: center; margin: 0; font-weight: 500;
  font-size: clamp(64px, 14.4vw, 260px); line-height: 0.86; letter-spacing: -0.06em;
}
.hero__title { filter: url(#liquid); }
.hero__title em { letter-spacing: -0.03em; color: var(--accent); }
.line--indent { padding-left: 12vw; }
.hero__foot { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.hero__lede { max-width: 420px; font-size: 17px; line-height: 1.5; color: #c5cfdc; margin: 0; }
.hero__scroll { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.hero__scroll-line { width: 80px; height: 1px; background: var(--line); overflow: hidden; }
.hero__scroll-line i { display: block; width: 40%; height: 100%; background: var(--ink); animation: scrollLine 2.2s var(--ease) infinite; }
@keyframes scrollLine { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.hero__coords { position: absolute; right: var(--gutter); top: 50%; display: flex; flex-direction: column; gap: 8px; color: var(--muted); text-align: right; transform: translateY(-50%); }
@media (max-width: 820px) { .hero__coords { display: none; } .line--indent { padding-left: 8vw; } }
@media (max-width: 600px) { .hero__title { font-size: 21vw; } .join__title { font-size: 24vw; } .btn-round { width: 104px; height: 104px; } }

/* ───── Marquee ───── */
.marquee { padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: rgba(4, 7, 13, 0.55); backdrop-filter: blur(6px); }
.marquee__track { display: flex; gap: 40px; width: max-content; white-space: nowrap; font-size: clamp(26px, 4vw, 54px); letter-spacing: -0.03em; will-change: transform; }
.marquee { padding: 40px 0; }
.marquee__track > * { display: inline-block; will-change: transform; }
.marquee__track b { color: var(--aqua); font-weight: 400; }

/* ───── Manifesto ───── */
.manifesto { display: grid; grid-template-columns: 1fr; }
.manifesto__text { font-size: clamp(28px, 4.3vw, 70px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 400; margin: 0; max-width: 18em; }
.manifesto__text .w { opacity: 0.14; transition: none; }
.manifesto__aside { margin-top: clamp(60px, 10vw, 140px); margin-left: auto; max-width: 520px; display: grid; gap: 18px; }
.manifesto__aside p.muted { font-size: 17px; line-height: 1.55; margin: 0; }

/* ───── Layers (horizontal) ───── */
.layers { padding: 0; }
.layers__pin { height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 4vh, 56px); overflow: hidden; padding: 90px 0 40px; }
.layers__head { padding: 0 var(--gutter); display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; }
.layers__head .section-tag { margin-bottom: 0; }
.layers__track { display: flex; gap: clamp(14px, 2vw, 28px); padding: 0 var(--gutter); width: max-content; will-change: transform; }
.card {
  --c: #fff; position: relative; overflow: hidden;
  width: clamp(280px, 30vw, 440px); height: clamp(380px, 52vh, 560px);
  border: 1px solid var(--line); border-radius: 22px; padding: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
  transition: border-color .5s;
}
.card:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.card__num { position: absolute; top: 24px; left: 28px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card__orb {
  position: absolute; top: -20%; right: -25%; width: 80%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--c), transparent 65%); opacity: .5; filter: blur(10px);
  transition: transform 1s var(--ease), opacity .6s;
}
.card:hover .card__orb { transform: scale(1.25) translate(-8%, 8%); opacity: .85; }
.card h3 { font-size: clamp(32px, 3vw, 48px); letter-spacing: -0.04em; font-weight: 500; margin: 0; line-height: 1; }
.card p { margin: 0; color: #b9c3d1; line-height: 1.5; font-size: 15px; }
.card ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.card ul li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); }
.card--end { justify-content: center; background: none; border-style: dashed; backdrop-filter: none; }
.card--end .serif-xl { color: var(--accent); font-size: clamp(30px, 3.2vw, 48px); line-height: 1.04; }
.card--end .mono { font-size: 11px; line-height: 1.6; }

/* ───── Features (underwater) ───── */
.features { position: relative; }
.features .section-tag { color: var(--aqua); }
.features__head { display: grid; gap: 0; margin-bottom: clamp(60px, 9vw, 140px); }
.features__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); padding-top: 28px; max-width: 980px; }
.features__facts > div { display: grid; gap: 10px; color: var(--muted); }
.features__body { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.feat-index { position: sticky; top: 110px; }
.feat-index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feat-index a {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 20px; letter-spacing: -0.02em; color: var(--muted);
  transition: color .4s, padding .5s var(--ease);
}
.feat-index a .mono { color: inherit; opacity: .7; }
.feat-index a:hover, .feat-index a.is-active { color: var(--ink); padding-left: 10px; }
.feat-index a.is-active { border-bottom-color: var(--c); }
.feat-index a.is-active .mono:first-child { color: var(--c); opacity: 1; }
.chapters { display: grid; gap: clamp(90px, 12vw, 180px); }
.chapter__head { margin-bottom: clamp(28px, 4vw, 48px); }
.chapter__tag { color: var(--c); }
.chapter__title { font-size: clamp(44px, 6vw, 96px); line-height: .92; letter-spacing: -0.045em; font-weight: 500; margin: 16px 0 18px; }
.chapter__title em { color: var(--c); letter-spacing: -0.02em; }
.chapter__intro { font-size: 17px; line-height: 1.5; max-width: 520px; margin: 0; }
.feats { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.feat {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 8px 28px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--line); overflow: hidden;
}
.feat::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%);
  transform: translateX(-101%); transition: transform .8s var(--ease);
}
.feat:hover::before { transform: none; }
.feat__n { grid-area: 1 / 1; color: var(--c); padding-top: 4px; }
.feat__name { grid-area: 1 / 2; margin: 0; font-size: clamp(22px, 2.1vw, 32px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.08; transition: color .5s var(--ease); }
.feat:hover .feat__name { color: var(--c); }
.feat__desc { grid-area: 1 / 3; margin: 0; color: #b9c7d6; font-size: 15.5px; line-height: 1.55; }
.feat__tags { grid-area: 2 / 3; color: var(--muted); font-size: 10.5px; }
@media (max-width: 900px) {
  .features__body { grid-template-columns: minmax(0, 1fr); }
  .feat-index { top: 64px; z-index: 5; margin: 0 calc(var(--gutter) * -1); padding: 10px var(--gutter); background: rgba(2, 16, 28, .72); backdrop-filter: blur(12px); overflow-x: auto; }
  .feat-index ol { display: flex; gap: 8px; width: max-content; }
  .feat-index a { grid-template-columns: auto auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
  .feat-index a:hover, .feat-index a.is-active { padding-left: 14px; border-color: var(--c); }
  .feat-index__n { display: none; }
  .feat { grid-template-columns: 46px minmax(0, 1fr); }
  .feat__desc { grid-area: 2 / 2; }
  .feat__tags { grid-area: 3 / 2; }
  .features__facts { gap: 12px; }
}

/* ───── Live ───── */
.live { overflow-x: clip; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(40px, 6vw, 100px); align-items: center; }
.live__copy p.muted { max-width: 460px; font-size: 17px; line-height: 1.55; margin: 32px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; border-top: 1px solid var(--line); padding-top: 28px; }
.stat { display: grid; gap: 10px; color: var(--muted); }
.live .section-tag, .how .section-tag { color: var(--aqua); }
.how .step__n { color: var(--aqua); }
.illustrative { color: var(--muted); opacity: .7; margin: 18px 0 0; }
.stat__n { font-size: clamp(42px, 5vw, 80px); color: var(--ink); letter-spacing: -0.05em; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.phone {
  justify-self: center; width: min(320px, 84vw); aspect-ratio: 9 / 17.5; border-radius: 44px; padding: 11px;
  background: linear-gradient(145deg, #1a2233, #070b12); border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 120px -30px rgba(43, 124, 255, .45), inset 0 0 0 1px rgba(255,255,255,.04);
  will-change: transform;
}
.phone__screen { height: 100%; border-radius: 34px; overflow: hidden; background: #070d17; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.phone__status { display: flex; justify-content: space-between; padding: 15px 22px 8px; color: #d5deea; }
.phone__status span:last-child { color: #4fe0b0; }
.phone__map { position: relative; min-height: 0; overflow: hidden; }
.phone__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ping { transform-origin: 150px 140px; animation: ping 2.4s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4); opacity: 0; } }
.feed-wrap { --row: 40px; --gap: 7px; height: calc(var(--row) * 4 + var(--gap) * 3 + 26px); overflow: hidden; padding: 10px 11px 16px; clip-path: inset(10px 0 16px 0); }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap); will-change: transform; }
.feed li {
  flex: none; height: var(--row); box-sizing: border-box;
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 0 12px; font-size: 12.5px;
}
.feed li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed li i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.feed li small { font-family: var(--mono); font-size: 10px; color: var(--muted); }
@media (max-width: 900px) { .live { grid-template-columns: minmax(0, 1fr); } .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; } }

/* ───── How ───── */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: minmax(80px, 0.6fr) 1fr; gap: 24px; padding: clamp(32px, 5vw, 64px) 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.step__n { font-family: var(--serif); font-style: italic; font-size: clamp(56px, 9vw, 150px); line-height: .8; color: var(--accent); }
.step h3 { font-size: clamp(36px, 5.4vw, 88px); letter-spacing: -0.045em; font-weight: 500; margin: 0 0 14px; line-height: .95; }
.step p { font-size: 17px; line-height: 1.5; max-width: 460px; margin: 0; }

/* ───── Join ───── */
.join { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.join__title { font-size: clamp(72px, 17vw, 300px); line-height: 0.84; letter-spacing: -0.06em; font-weight: 500; margin: 0 0 clamp(36px, 6vw, 72px); }
.join__title em { color: var(--accent); letter-spacing: -0.03em; }
.join__form { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); padding-bottom: 18px; max-width: 900px; flex-wrap: wrap; }
.join__form input {
  flex: 1 1 260px; min-width: 0; background: none; border: 0; color: var(--ink); outline: none;
  font: 400 clamp(24px, 3.4vw, 46px)/1.1 var(--sans); letter-spacing: -0.03em; padding: 10px 0;
}
.join__form input::placeholder { color: #3c4658; }
.btn-round {
  width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--bg); font: 600 14px var(--sans);
  display: grid; place-items: center; align-content: center; gap: 6px; flex: 0 0 auto;
  transition: background-color .4s var(--ease);
}
.btn-round svg { width: 22px; height: 22px; }
.btn-round:disabled { opacity: .55; cursor: wait; }
.join__msg { min-height: 18px; margin: 18px 0 0; }
.join__msg.ok { color: #4fe0b0; } .join__msg.err { color: #ff8f84; }
.join__demo { margin-top: 36px; color: var(--muted); font-size: 15px; align-self: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: color .3s; }
.join__demo:hover { color: var(--ink); }

/* ───── Footer ───── */
.footer { padding: 0 var(--gutter) 10px; overflow: hidden; border-top: 1px solid var(--line); background: rgba(4,7,13,.6); }
.footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0; color: var(--muted); }
.made-by { color: var(--muted); display: inline-flex; align-items: baseline; gap: 6px; transition: color .4s; }
.made-by b { color: var(--ink); font-weight: 500; letter-spacing: .14em; position: relative; }
.made-by b::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--aqua); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.made-by i { font-style: normal; color: var(--aqua); display: inline-block; transition: transform .5s var(--ease); }
.made-by:hover { color: var(--ink); }
.made-by:hover b::after { transform: scaleX(1); transform-origin: left; }
.made-by:hover i { transform: translate(3px, -3px); }
.footer__word {
  font-size: 23vw; font-weight: 800; letter-spacing: -0.045em; line-height: .86; padding-bottom: .06em; text-align: center; margin: 2vw 0 0 -0.5vw; white-space: nowrap;
  /* the wordmark is a glass of water: two wave layers sloshing inside the letters */
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='400' preserveAspectRatio='none'><path d='M0 170 Q100 130 200 170 T400 170 T600 170 T800 170 V400 H0 Z' fill='%237fe3ff' fill-opacity='.55'/></svg>") 0 0 / 50% 100% repeat-x,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='400' preserveAspectRatio='none'><path d='M0 150 Q100 190 200 150 T400 150 T600 150 T800 150 V400 H0 Z' fill='%231e6fd9' fill-opacity='.9'/></svg>") 0 0 / 38% 100% repeat-x,
    rgba(238, 242, 247, 0.07);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: slosh 6s linear infinite;
}
@keyframes slosh { to { background-position: 200% 0, -152% 0, 0 0; } }
.ripple {
  position: fixed; z-index: 80; pointer-events: none; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 1px solid rgba(127, 227, 255, 0.75); box-shadow: 0 0 12px rgba(127, 227, 255, 0.35), inset 0 0 8px rgba(127, 227, 255, 0.25);
  animation: ripple 1.4s cubic-bezier(.2,.7,.3,1) forwards; opacity: 0;
}
@keyframes ripple { 0% { transform: scale(0.2); opacity: .9; } 100% { transform: scale(9); opacity: 0; } }

/* reveal defaults (JS animates in) */
.reveal { opacity: 0; transform: translateY(24px); }
.no-js .reveal, .reduced .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .footer__word,
  .grain, .star-glyph, .hero__scroll-line i, .ping { animation: none; }
}
