/* ============================================================
   grxffinn — minimal personal site
   Tokens live at the top. Change --accent to re-theme everything.
   ============================================================ */

:root {
  --bg: #f6f6fa;
  --surface: #ffffff;
  --surface-soft: #f1f1f7;
  --text: #0c0d14;
  --text-muted: #5c6172;
  --border: #e5e5ee;
  --border-strong: #d4d4e2;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --logo-tile: #26272f;

  --paypal: #0070ba;
  --paypal-hover: #005c99;
  --danger: #be123c;
  --success: #15803d;
  --star: #f59e0b;

  --shadow-sm: 0 1px 2px rgb(12 13 20 / 0.05);
  --shadow-md: 0 14px 34px -16px rgb(12 13 20 / 0.22), 0 2px 8px rgb(12 13 20 / 0.04);
  --radius: 18px;
  --radius-lg: 26px;
  --radius-full: 999px;

  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #08090f;
  --surface: #111320;
  --surface-soft: #171a2b;
  --text: #f2f3f8;
  --text-muted: #9aa0b4;
  --border: #222436;
  --border-strong: #2f3249;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1d2140;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);

  --success: #4ade80;
  --danger: #fb7185;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
  --shadow-md: 0 18px 40px -18px rgb(0 0 0 / 0.8), 0 2px 8px rgb(0 0 0 / 0.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
svg { display: block; }

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* Soft ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38rem 26rem at 12% -8%, color-mix(in srgb, #6366f1 13%, transparent), transparent 70%),
    radial-gradient(34rem 24rem at 92% 4%, color-mix(in srgb, #a855f7 11%, transparent), transparent 70%),
    radial-gradient(40rem 30rem at 50% 110%, color-mix(in srgb, #0ea5e9 7%, transparent), transparent 70%);
}

/* Faint dot texture, fading toward the top */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60rem 32rem at 50% -6%, black 20%, transparent 78%);
  mask-image: radial-gradient(60rem 32rem at 50% -6%, black 20%, transparent 78%);
  opacity: 0.7;
}

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.container {
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

/* ---------- Top bar ---------- */
.topbar {
  padding-block: 1.1rem;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.02rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  overflow: hidden;
  isolation: isolate;
  background: var(--logo-tile);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.55);
}
.brand-mark svg { width: 15px; height: 15px; }
.brand-mark-img {
  width: 100%;
  height: 100%;
  padding: 1px;
  object-fit: cover;
  mix-blend-mode: screen;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
}
.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-link:hover { color: var(--text); background: var(--surface-soft); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-soft); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: rotate(-12deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Home ---------- */
.home-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding-block: clamp(2rem, 6vh, 4.5rem) 3rem;
}
.profile {
  width: min(100% - 2.2rem, 33rem);
  text-align: center;
  animation: fadein 0.5s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes fadein {
  from { opacity: 0; }
}

.profile .avatar { animation: rise 0.65s var(--ease) both; }
.profile h1 { animation: rise 0.65s var(--ease) 0.05s both; }
.profile .tagline { animation: rise 0.65s var(--ease) 0.1s both; }
.profile .topic-badge { animation: rise 0.65s var(--ease) 0.15s both; }

.avatar {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  background: var(--logo-tile);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow: 0 20px 40px -18px rgb(0 0 0 / 0.6),
    0 0 46px -8px color-mix(in srgb, var(--accent) 50%, transparent);
}
.avatar-img {
  width: 100%;
  height: 100%;
  padding: 10%;
  object-fit: cover;
  mix-blend-mode: screen;
}

.profile h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 25%, #c3c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .profile h1 {
  background-image: linear-gradient(180deg, #0c0d14 30%, #4f46e5 135%);
}

.tagline {
  margin: 1rem auto 0;
  max-width: 26rem;
  font-size: 1rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}
.topic-badge:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  transform: translateY(-1px);
}
.topic-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 70%, transparent);
}

.links {
  display: grid;
  gap: 0.7rem;
  margin-top: 2.1rem;
  text-align: left;
}

.links .link-card {
  animation: rise 0.65s var(--ease) 0.22s both;
}
.links .link-card:nth-child(2) { animation-delay: 0.3s; }
.latest { animation: rise 0.65s var(--ease) 0.38s both; }
.reviews { animation: rise 0.65s var(--ease) 0.46s both; }

/* ---------- Hero: avatar left, text right ---------- */
.profile {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.25rem;
  align-items: center;
  text-align: left;
}
.profile .avatar { grid-row: 1 / 5; margin: 0; }
.profile h1 { line-height: 1.05; }
.profile .tagline { margin: 0.35rem 0 0; }
.profile .topic-badge { justify-self: start; margin-top: 0.65rem; }
.links, .latest, .reviews, .domain { grid-column: 1 / -1; }
.profile > * { min-width: 0; }
.links { margin-top: 1.8rem; }
@media (min-width: 700px) {
  .links { grid-template-columns: 1fr 1fr; }
  .links a[href*="discord.gg"] { grid-column: 1 / -1; }
}

/* ---------- Sidebar shell (desktop) ---------- */
@media (min-width: 960px) {
  body { padding-left: 292px; }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 292px;
    padding: 1.8rem 1.3rem 1.4rem;
    border-right: 1px solid var(--border);
    background: var(--surface);
    z-index: 50;
  }
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    max-width: none;
    padding: 0;
  }
  .brand { margin-bottom: 1.6rem; }
  .brand-name { font-size: 1.1rem; }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex: 1;
  }
  .nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.95rem;
    font-size: 0.95rem;
    position: relative;
  }
  .nav-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: -1.3rem;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
  }
  .nav-tools {
    margin: auto 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
  }

  .home-main {
    align-items: start;
    padding-block: clamp(2.5rem, 7vh, 4.5rem) 3.5rem;
  }
  .profile { width: min(100% - 3rem, 42rem); }
  .tip-main { width: min(100% - 3rem, 34rem); padding-block: 3rem; }
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease,
              border-color 0.25s ease, background-color 0.25s ease;
}
/* Soft top highlight for a premium card edge */
body .link-card, body .latest-card, body .reviews, body .tip-card {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / 0.07);
}
body .tip-card { box-shadow: var(--shadow-md), inset 0 1px 0 rgb(255 255 255 / 0.07); }
.link-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgb(255 255 255 / 0.07);
}
.link-card:active { transform: translateY(0) scale(0.985); }

.link-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
}
.link-icon svg { width: 21px; height: 21px; }
.link-icon-youtube { background: #fff0f3; color: #f0032b; }
[data-theme="dark"] .link-icon-youtube { background: #2a0d14; color: #ff4d6d; }
.link-icon-tip { background: var(--accent-soft); color: var(--accent); }
.link-icon-discord { background: #eceeff; color: #5865f2; }
[data-theme="dark"] .link-icon-discord { background: #20264d; color: #8b9dff; }

.link-text { display: grid; gap: 0.05rem; min-width: 0; }
.link-text strong { font-size: 0.97rem; font-weight: 650; letter-spacing: -0.015em; }
.link-text small { font-size: 0.8rem; color: var(--text-muted); }

.link-arrow {
  width: 18px;
  height: 18px;
  flex: none;
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease), color 0.25s ease;
}
.link-card:hover .link-arrow { transform: translate(2px, -2px); color: var(--accent); }
.link-card:last-child:hover .link-arrow { transform: translateX(3px); }

.domain {
  margin-top: 1.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Latest upload ---------- */
.latest { margin-top: 2rem; text-align: left; }

.latest-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.latest-head h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.latest-date {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.section-icon svg { width: 15px; height: 15px; }

.latest-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease,
              border-color 0.25s ease, background-color 0.25s ease;
}
.latest-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgb(255 255 255 / 0.07);
}
.latest-card:hover .link-arrow { transform: translate(2px, -2px); color: var(--accent); }
.latest-card:active { transform: translateY(0) scale(0.985); }

.latest-thumb {
  display: block;
  position: relative;
  flex: none;
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-soft);
}
.latest-thumb[hidden] { display: none; }
.latest-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%23fff'/%3E%3C/svg%3E") center / 15px 15px no-repeat,
    rgb(0 0 0 / 0.55);
  pointer-events: none;
}
.latest-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-text { display: grid; gap: 0.05rem; min-width: 0; }
.latest-text strong {
  font-size: 0.97rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-text small { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Reviews ---------- */
.reviews {
  margin-top: 2rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.reviews-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.reviews-head h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.reviews-summary {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.review-form { margin-top: 0.95rem; }

.rating-field {
  border: 0;
  padding: 0;
  margin: 0;
}
.rating-field legend {
  padding: 0;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 650;
}

.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
}

.star-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.star {
  display: grid;
  place-items: center;
  padding: 0.1rem;
  color: var(--border-strong);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s var(--ease);
}
.star svg { width: 26px; height: 26px; }
.star:hover { transform: translateY(-1px); }
.star:active { transform: scale(0.9); }
.star:hover,
.star:hover ~ .star,
.star-input:checked + .star,
.star-input:checked + .star ~ .star { color: var(--star); }
.star-input:focus-visible + .star {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.review-label {
  display: block;
  margin: 0.9rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
}
.review-label span {
  color: var(--text-muted);
  font-weight: 500;
}

.review-text {
  width: 100%;
  min-height: 4.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.review-text::placeholder { color: var(--text-muted); }
.review-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.review-hint {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-review {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.68rem 1rem;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s var(--ease);
}
[data-theme="dark"] .btn-review { color: #0b0c12; }
.btn-review:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-review:active { transform: scale(0.98); }
.btn-review:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.review-status {
  min-height: 1.1em;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}
.review-status.is-err { color: var(--danger); }
.review-status.is-ok { color: var(--success); }

.review-done {
  margin-top: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--success) 8%, transparent);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
}
.review-done[hidden] { display: none; }

.review-list { margin-top: 0.9rem; }

.review-item {
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}
.review-item:first-child {
  padding-top: 0.2rem;
  border-top: 0;
}

.review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.review-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.review-stars {
  color: var(--star);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}
.review-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.review-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.review-body {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.review-empty {
  padding-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 0;
}

/* ---------- Tip page ---------- */
.tip-main {
  flex: 1;
  width: min(100% - 2.2rem, 31rem);
  margin-inline: auto;
  padding-block: 1rem 3rem;
  animation: rise 0.7s var(--ease) both;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--accent); }

.sound-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.sound-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.sound-toggle svg { width: 16px; height: 16px; }
.sound-toggle .icon-sound-off { display: none; }
.sound-toggle.is-muted .icon-sound-on { display: none; }
.sound-toggle.is-muted .icon-sound-off { display: block; }

/* ---------- Header toggle tooltips ---------- */
.nav-tools button { position: relative; }
.nav-tools button::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 3px);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--text);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s var(--ease);
  z-index: 80;
}
.nav-tools button:hover::after,
.nav-tools button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* In the sidebar the buttons sit at the bottom, so open upward */
@media (min-width: 960px) {
  .nav-tools button::after {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translate(-50%, -3px);
  }
  .nav-tools button:hover::after,
  .nav-tools button:focus-visible::after {
    transform: translate(-50%, 0);
  }
}

/* The theme button playfully tilts on hover — keep its tooltip level */
.nav-tools .theme-toggle:hover::after {
  transform: translate(-50%, 0) rotate(12deg);
}

.tip-card {
  padding: clamp(1.5rem, 5vw, 2.4rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.tip-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 1.1rem;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tip-icon svg { width: 27px; height: 27px; }

.tip-card h1 {
  font-size: clamp(1.7rem, 5vw, 2.1rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.tip-sub {
  margin: 0.65rem auto 0;
  max-width: 23rem;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.tip-form {
  margin-top: 1.6rem;
  text-align: left;
}

.amount-group { border: 0; padding: 0; }
.amount-group legend {
  padding: 0;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.amounts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.amount {
  padding: 0.68rem 0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease,
              color 0.18s ease, transform 0.18s var(--ease);
}
.amount:hover { border-color: var(--accent); transform: translateY(-1px); }
.amount:active { transform: scale(0.95); }
.amount.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.custom-wrap {
  margin-top: 0.9rem;
  animation: rise 0.3s var(--ease) both;
}
.custom-wrap[hidden] { display: none; }
.custom-wrap label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
}
.custom-input {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.custom-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.custom-input span { color: var(--text-muted); font-weight: 600; }
.custom-input input {
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  background: transparent;
  font-size: 0.95rem;
  outline: none;
}
/* Hide number spinners */
.custom-input input::-webkit-outer-spin-button,
.custom-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.custom-input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.btn-paypal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border-radius: 13px;
  background: var(--paypal);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 24px -14px rgb(0 112 186 / 0.9);
  transition: background-color 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.btn-paypal:hover {
  background: var(--paypal-hover);
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -14px rgb(0 112 186 / 0.95);
}
.btn-paypal:active { transform: scale(0.98); }
.btn-paypal svg { width: 19px; height: 19px; }
.btn-paypal[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.secure-note {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.form-status {
  min-height: 1.2em;
  margin-top: 0.55rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
}
.form-status.is-ok { color: var(--success); }
.form-status.is-err { color: var(--danger); }

/* ---------- Thank-you state ---------- */
.tip-form[hidden],
.tip-success[hidden] { display: none; }

.tip-success {
  animation: rise 0.45s var(--ease) both;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0.2rem auto 1rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}
.success-icon svg { width: 31px; height: 31px; }

.tip-success h2 {
  font-size: clamp(1.6rem, 5vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.tip-success h2:focus { outline: none; }

.success-sub {
  margin: 0.6rem auto 0;
  max-width: 22rem;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.desc-body {
  margin: 0.9rem auto 0;
  max-width: 24rem;
  display: grid;
  gap: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

.success-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.5rem;
}
.success-actions .btn-paypal { margin-top: 0; }

.btn-quiet {
  width: 100%;
  padding: 0.78rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--ease);
}
.btn-quiet:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: translateY(-1px);
}
.btn-quiet:active { transform: scale(0.97); }

.success-home {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.success-home:hover { color: var(--accent); }

/* ---------- Confetti ---------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: -18px;
  display: block;
  border-radius: 2px;
  animation: confetti-fall var(--dur, 1.9s) cubic-bezier(0.22, 0.61, 0.36, 1) var(--delay, 0s) forwards;
}
@keyframes confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg));
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(var(--spin, 540deg));
    opacity: 0;
  }
}

.youtube-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.youtube-link span { transition: transform 0.2s var(--ease); }
.youtube-link:hover { color: var(--accent); }
.youtube-link:hover span { transform: translateX(3px); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 1.4rem 1.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin-top: 0.5rem;
}
.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent); }

/* ---------- Cursor trail ---------- */
.cursor-dot,
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  border-radius: 50%;
  transition: opacity 0.25s ease;
  will-change: transform;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: color-mix(in srgb, var(--bg) 70%, #fff);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent),
    0 0 8px color-mix(in srgb, var(--bg) 40%, #fff);
  transition: opacity 0.25s ease, width 0.2s var(--ease), height 0.2s var(--ease),
    margin 0.2s var(--ease), background-color 0.2s ease;
}

.cursor-glow {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--bg) 55%, #fff) 0%,
    color-mix(in srgb, var(--bg) 80%, #fff) 45%,
    transparent 72%
  );
  filter: blur(5px);
}

.cursor-dot.is-visible,
.cursor-glow.is-visible { opacity: 1; }
.cursor-glow.is-visible { opacity: 0.7; }

.cursor-dot.is-hover {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: color-mix(in srgb, var(--bg) 50%, #fff);
}

@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  .cursor-dot,
  .cursor-glow { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { flex-wrap: wrap; row-gap: 0.25rem; }
}
@media (max-width: 420px) {
  .brand-name { display: none; }
  .nav { gap: 0.1rem; }
  .nav-link { padding: 0.4rem 0.55rem; font-size: 0.86rem; }
  .amounts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .amount:last-child { grid-column: span 3; }
  .avatar { width: 74px; height: 74px; border-radius: 22px; font-size: 1.9rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
