/* ycash.team: the start page and the product pages.
   Copyright (c) 2026 The Ycash developers. MIT licence (LICENSE).
   No inline styles or scripts anywhere and no style="" attributes, so the strict
   Content-Security-Policy (README, "How it is served") needs no 'unsafe-inline'. */

:root {
  --bg: #0b0b0f;
  --bg-2: #111118;
  --ink: #f4f1ea;
  --muted: #a39f97;
  --line: rgba(255, 255, 255, 0.09);
  --orange: #f56733;   /* the Ycash logo */
  --gold: #ffc247;
  --tile: rgba(255, 255, 255, 0.035);
  --radius: 28px;
  --col: 1112px;       /* the content column: five 208px tiles and four 18px gaps */
  --display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---------- the moving background ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.orb-a {
  width: 46vmax; height: 46vmax;
  left: -12vmax; top: -18vmax;
  background: radial-gradient(circle at 30% 30%, var(--orange), transparent 65%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.orb-b {
  width: 40vmax; height: 40vmax;
  right: -14vmax; top: 6vmax;
  background: radial-gradient(circle at 60% 40%, #ff9d2e, transparent 62%);
  opacity: 0.32;
  animation: drift-b 32s ease-in-out infinite alternate;
}

.orb-c {
  width: 52vmax; height: 52vmax;
  left: 22vmax; bottom: -34vmax;
  background: radial-gradient(circle at 50% 50%, #7a2bff, transparent 60%);
  opacity: 0.22;
  animation: drift-c 38s ease-in-out infinite alternate;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1.4px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 30%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 60% at 50% 30%, #000 20%, transparent 78%);
}

@keyframes drift-a { to { transform: translate3d(9vmax, 7vmax, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-8vmax, 9vmax, 0) scale(0.92); } }
@keyframes drift-c { to { transform: translate3d(-10vmax, -8vmax, 0) scale(1.1); } }

main, footer, .bar, .corner { position: relative; z-index: 1; }

main { flex: 1 0 auto; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- hero ---------- */

/* The corner line: "Ycash = Your" at the page's top-left gutter, the rotating phrase right after
   it. It scrolls away with the page. The slot always holds the longest phrase (.sizer), so the
   line's size never changes: nothing but the phrase moves. */
.corner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px clamp(16px, 3vw, 32px) 0;
}

.brandline {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0 0.28em;
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 700;
  /* sized so "Ycash = Your Electronic Cash" fits one line at 320 px */
  font-size: clamp(1.1rem, 0.85rem + 1.25vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* The hero: the logo alone, centred, the visual centrepiece. */
.hero {
  min-height: min(30vh, 290px);
  min-height: min(30svh, 290px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 16px 22px;
}

.logo {
  display: block;
  margin: 0 auto;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  box-shadow:
    0 0 0 10px rgba(245, 103, 51, 0.10),
    0 0 70px 12px rgba(245, 103, 51, 0.38);
  animation: heartbeat 1.7s cubic-bezier(0.3, 0, 0.3, 1) infinite;
}

/* A heartbeat: two quick beats (the second smaller), then a rest. The glow swells with each beat. */
@keyframes heartbeat {
  0%, 46%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 10px rgba(245, 103, 51, 0.10),
      0 0 70px 12px rgba(245, 103, 51, 0.38);
  }
  10% {
    transform: scale(1.085);
    box-shadow:
      0 0 0 17px rgba(245, 103, 51, 0.07),
      0 0 104px 26px rgba(245, 103, 51, 0.56);
  }
  21% {
    transform: scale(0.99);
    box-shadow:
      0 0 0 11px rgba(245, 103, 51, 0.10),
      0 0 74px 13px rgba(245, 103, 51, 0.40);
  }
  31% {
    transform: scale(1.05);
    box-shadow:
      0 0 0 14px rgba(245, 103, 51, 0.08),
      0 0 90px 20px rgba(245, 103, 51, 0.48);
  }
}

.fixed { white-space: nowrap; }

.eq { color: var(--muted); font-weight: 500; }

/* The slot holds the longest phrase, invisibly (.sizer), so its size never changes: the word sits
   on top of it at the slot's left edge and grows rightward. */
.slot {
  position: relative;
  display: inline-block;
}

.sizer {
  visibility: hidden;
  white-space: nowrap;
  padding-bottom: 0.08em;
}

.word {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  padding-bottom: 0.08em;
  background: linear-gradient(92deg, var(--gold) 0%, var(--orange) 55%, #ff4d6d 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(0.42em);
  filter: blur(10px);
  transition:
    opacity 0.42s ease,
    transform 0.52s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.42s ease;
}

/* Emoji keep their own colours. */
.word.is-emoji {
  background: none;
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}

.word.is-in { opacity: 1; transform: none; filter: none; }

.word.is-out { opacity: 0; transform: translateY(-0.42em); filter: blur(10px); }

/* ---------- product tiles, in two labelled rows ---------- */

.row {
  max-width: calc(var(--col) + 32px);
  margin: 0 auto;
  padding: 8px 16px 36px;
}

.row:last-of-type { padding-bottom: 88px; }

.row-label {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.row-label::before,
.row-label::after {
  content: "";
  height: 1px;
  width: min(80px, 12vw);
  background: linear-gradient(90deg, transparent, var(--line));
}

.row-label::after { background: linear-gradient(90deg, var(--line), transparent); }

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.tile {
  --mx: 50%;
  --my: 0%;
  position: relative;
  flex: 0 1 208px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(240px circle at var(--mx) var(--my), rgba(245, 103, 51, 0.20), transparent 62%),
    var(--tile);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.28s, box-shadow 0.28s;
}

/* The tiles rise into view only when the script runs (it adds .js, then .seen). */
.js .tile:not(.seen) { opacity: 0; translate: 0 22px; }

.js .tile.seen {
  transition:
    opacity 0.6s ease, translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.28s, box-shadow 0.28s;
}

.row-use .tile { flex-basis: 232px; }

.tile:hover,
.tile:focus-within {
  transform: translateY(-6px);
  border-color: rgba(255, 194, 71, 0.55);
  box-shadow: 0 22px 60px -22px rgba(245, 103, 51, 0.55);
}

.icon {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 52px;
  height: 52px;
  padding: 11px;
  border-radius: 17px;
  color: var(--gold);
  background: rgba(255, 194, 71, 0.10);
  border: 1px solid rgba(255, 194, 71, 0.22);
  transition: color 0.28s, background 0.28s, transform 0.28s;
}

.tile:hover .icon,
.tile:focus-within .icon {
  color: #1a0d05;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  transform: rotate(-6deg) scale(1.06);
}

.tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

/* In the flow, above the name: a long label never runs into the icon. */
.tile .tag {
  align-self: flex-start;
  margin-bottom: 10px;
  font-size: 0.62rem;
  padding: 3px 8px;
}

.tile h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 1.9vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile h3 a { text-decoration: none; }

/* The whole square is the link. */
.tile h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

/* The square shows the focus ring, not the small name. */
.tile h3 a:focus-visible { outline: none; }
.tile:has(a:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }

.tile p {
  margin: 6px 0 0;
  font-size: 0.93rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- the product pages ---------- */

.bar {
  padding: 22px 16px 0;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
}

.brand img { border-radius: 50%; }

.product main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 56px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 600px;
  border-radius: 32px;
  padding: 40px 36px 36px;
  background:
    radial-gradient(420px circle at 0% 0%, rgba(245, 103, 51, 0.16), transparent 60%),
    var(--tile);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}

.card .icon-lg {
  position: static;
  display: block;
  width: 72px;
  height: 72px;
  padding: 15px;
  border-radius: 22px;
  margin-bottom: 26px;
}

.card .tag {
  position: absolute;
  top: 40px;
  right: 34px;
}

.card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.card .what {
  margin: 18px 0 0;
  font-size: clamp(1.08rem, 2.2vw, 1.25rem);
  line-height: 1.5;
}

.card .how {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.button {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  color: #1a0d05;
  background: linear-gradient(120deg, var(--gold), var(--orange));
  box-shadow: 0 14px 40px -16px rgba(245, 103, 51, 0.8);
  transition: transform 0.2s, box-shadow 0.2s;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 18px 46px -14px rgba(245, 103, 51, 0.9); }

.button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.back {
  margin: 26px 0 0;
  font-size: 0.95rem;
}

.back a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 4px;
}

.back a::before { content: "\2190\00a0"; }

.back a:hover { color: var(--ink); }



/* ---------- footer ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  padding: 26px 20px 44px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

footer p { margin: 0; }

/* ---------- smaller screens ---------- */

@media (max-width: 720px) {
  .tiles { gap: 12px; }
  .tile, .row-use .tile { flex: 0 1 calc(50% - 6px); padding: 16px 14px 14px; border-radius: 22px; }
  .tile h3 a::after { border-radius: 22px; }
  .icon { top: 14px; left: 14px; width: 42px; height: 42px; padding: 9px; border-radius: 13px; }
  .tile .tag { margin-bottom: 8px; font-size: 0.56rem; padding: 2px 7px; }
  .tile p { font-size: 0.84rem; }
  .logo { width: 112px; height: 112px; }
  .card { padding: 30px 22px 26px; border-radius: 26px; }
  .card .tag { top: 30px; right: 20px; }
  .card .icon-lg { width: 60px; height: 60px; padding: 13px; border-radius: 18px; margin-bottom: 20px; }
  .button { width: 100%; justify-content: center; }
}

/* A narrow phone: the tiles are too small to stay square, so they grow with their content and the
   icon sits in the flow above the label. */
@media (max-width: 400px) {
  .tile, .row-use .tile { aspect-ratio: auto; justify-content: flex-start; }
  .icon { position: static; margin-bottom: 14px; }
}

/* ---------- people who prefer no motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb, .logo { animation: none; }
  .word { transition: opacity 0.2s linear; transform: none; filter: none; }
  .word.is-out { transform: none; filter: none; }
  .js .tile:not(.seen), .js .tile.seen { opacity: 1; translate: 0 0; transition: border-color 0.2s; }
  .tile:hover, .tile:focus-within, .button:hover { transform: none; }
  .tile:hover .icon, .tile:focus-within .icon { transform: none; }
}

/* ---------- forced colours (Windows high contrast) ---------- */

@media (forced-colors: active) {
  .word { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; }
  .tile, .card { border: 1px solid CanvasText; }
}

