/* Flux - base: fonts, tokens, reset, body, ambient bg, layout, skip link */

/* fonts */
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Regular.woff2?v=1777700707') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-SemiBold.woff2?v=1777700707') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Bold.woff2?v=1777700707') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins-Black.woff2?v=1777700707') format('woff2');
  font-weight: 900; font-display: swap;
}

/* tokens (colors mapped to the official Resonite brand gradient) */
:root {
  --bg-0:     #0b0a14;
  --bg-1:     #15131f;
  --bg-2:     #1e1b2c;
  --line:     rgba(255,255,255,0.10);
  --text:     #ffffff;
  --text-mut: rgba(255,255,255,0.62);
  --text-dim: rgba(255,255,255,0.40);

  --purple:   #A940F2;
  --mid:      #405EF2;
  --blue:     #409FF3;
  --grad:     linear-gradient(135deg, #A940F2 0%, #405EF2 50%, #409FF3 100%);

  --font:     'Poppins', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --pad-x:    clamp(1.25rem, 5vw, 4rem);
  --pad-y:    clamp(1.5rem, 3vw, 2.5rem);
  --section-y: clamp(2.5rem, 6vw, 5rem);
  --radius:    14px;
  --radius-sm: 10px;
}

/* reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; }

body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(0.9375rem, 0.85rem + 0.4vw, 1.0625rem);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ambient drifting wash */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 15% 10%,  rgba(169, 64,242,0.22), transparent 60%),
    radial-gradient(ellipse 45% 35% at 85% 30%,  rgba( 64,159,243,0.18), transparent 60%),
    radial-gradient(ellipse 55% 45% at 50% 95%,  rgba( 64, 94,242,0.14), transparent 65%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: drift 32s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0)        scale(1.00); }
  50%  { transform: translate3d(2%, -1%, 0)     scale(1.06); }
  100% { transform: translate3d(-1.5%, 1.5%, 0) scale(1.02); }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* skip link */
.skip {
  position: absolute; top: -100px; left: 1rem;
  background: var(--text); color: var(--bg-0);
  padding: 0.5rem 1rem; text-decoration: none;
  font-weight: 600; border-radius: var(--radius-sm); z-index: 100;
}
.skip:focus { top: 0.75rem; }

/* global motion override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Flux - components: nav, tabs, about, channel rows, friend cards, modal, footer */

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* tabs - centered, with breathing room from the viewport top */
.tab-bar {
  display: flex; gap: 0.5rem;
  padding: 0.375rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: fit-content;
  margin: clamp(1.25rem, 3vw, 2.5rem) auto var(--section-y);
}

.tab {
  background: none; border: none; color: var(--text-mut);
  font-family: var(--font); font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: color 150ms, background 150ms;
}
.tab[aria-selected="true"] {
  background: var(--grad);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(169,64,242,0.30);
}
.tab:hover:not([aria-selected="true"]) { color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

[role="tabpanel"][hidden] { display: none; }

/* about */
.about-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: var(--section-y);
}

.eyebrow {
  font-size: 0.75rem; font-weight: 600;
  /* explicit color (not --text-dim) so we hit WCAG AA 4.5:1 on bg-0 */
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.display-name {
  font-size: clamp(3rem, 4vw + 2rem, 6.5rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #A940F2, #405EF2, #409FF3, #A940F2);
  background-size: 300% 300%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  margin-bottom: 1.25rem;
  animation: shimmer 18s ease-in-out infinite;
}

.blurb {
  font-size: clamp(1rem, 0.4vw + 0.95rem, 1.125rem);
  color: var(--text-mut);
  max-width: 60ch;
  line-height: 1.65;
}
.blurb strong { color: var(--text); font-weight: 600; }

.section-label {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* explicit color (not --text-dim) so we hit WCAG AA 4.5:1 on bg-0 */
  color: rgba(255, 255, 255, 0.66);
  margin-bottom: 1.25rem;
}

/* channel cards */
.channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.875rem;
}

.channel-row {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 220ms, background 220ms, box-shadow 220ms;
  position: relative;
  overflow: hidden;
}
.channel-row::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity 220ms;
  pointer-events: none;
}
.channel-row:hover {
  background: var(--bg-2);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(64,94,242,0.18);
}
.channel-row:hover::after { opacity: 0.85; }
.channel-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.ch-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 900; font-size: 0.8125rem;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.ch-text { display: flex; flex-direction: column; min-width: 0; }
.ch-platform {
  font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ch-handle {
  font-size: 0.9375rem; font-weight: 600;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* image / svg icons inside channel rows */
.ch-icon.icon-img {

  background: rgba(255,255,255,0.04);
  padding: 4px;
}
.ch-icon.icon-img img,
.ch-icon.icon-img svg {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.ch-icon.icon-img svg { fill: var(--text); }

/* friends panel */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding-bottom: var(--section-y);
}

.friend-card {
  --c1: #A940F2;
  --c2: #405EF2;
  --c3: #409FF3;
  /* flex column so excerpt absorbs slack and read-more sits at the bottom */
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  font-family: var(--font); color: var(--text);
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 240ms, background 240ms, box-shadow 240ms;
  width: 100%;
  /* baseline height so cards with short excerpts don't shrink in a row */
  min-height: 280px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: card-in 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.friend-card:nth-child(2) { animation-delay: 60ms; }
.friend-card:nth-child(3) { animation-delay: 120ms; }
.friend-card:nth-child(4) { animation-delay: 180ms; }
.friend-card:nth-child(5) { animation-delay: 240ms; }
.friend-card:nth-child(n+6) { animation-delay: 300ms; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ambient theme wash, tinted by per-friend --c vars */
.friend-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%,  color-mix(in oklab, var(--c1) 55%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, color-mix(in oklab, var(--c3) 40%, transparent), transparent 70%);
  opacity: 0.18;
  transition: opacity 280ms;
  z-index: -1;
}

/* pixel-bone motif: two-layer mask over the theme gradient.
   Layer 1 = single rotated 8-bit bone in the top-right corner.
   Layer 2 = repeating pixel-block dot grid backdrop.
   shape-rendering=crispEdges keeps each pixel square through rotation. */
.friend-card[data-motif="pixel-bone"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--c1) 65%, transparent),
    color-mix(in oklab, var(--c2) 55%, transparent),
    color-mix(in oklab, var(--c3) 65%, transparent));
  -webkit-mask-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' shape-rendering='crispEdges'%3E%3Cg transform='translate(72 28) rotate(-40) scale(3.5) translate(-7 -3)'%3E%3Crect x='1' y='0' width='2' height='1' fill='white'/%3E%3Crect x='11' y='0' width='2' height='1' fill='white'/%3E%3Crect x='0' y='1' width='4' height='1' fill='white'/%3E%3Crect x='10' y='1' width='4' height='1' fill='white'/%3E%3Crect x='1' y='2' width='12' height='2' fill='white'/%3E%3Crect x='0' y='4' width='4' height='1' fill='white'/%3E%3Crect x='10' y='4' width='4' height='1' fill='white'/%3E%3Crect x='1' y='5' width='2' height='1' fill='white'/%3E%3Crect x='11' y='5' width='2' height='1' fill='white'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6' shape-rendering='crispEdges'%3E%3Crect x='0' y='0' width='2' height='2' fill='white' fill-opacity='0.55'/%3E%3C/svg%3E");
          mask-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' shape-rendering='crispEdges'%3E%3Cg transform='translate(72 28) rotate(-40) scale(3.5) translate(-7 -3)'%3E%3Crect x='1' y='0' width='2' height='1' fill='white'/%3E%3Crect x='11' y='0' width='2' height='1' fill='white'/%3E%3Crect x='0' y='1' width='4' height='1' fill='white'/%3E%3Crect x='10' y='1' width='4' height='1' fill='white'/%3E%3Crect x='1' y='2' width='12' height='2' fill='white'/%3E%3Crect x='0' y='4' width='4' height='1' fill='white'/%3E%3Crect x='10' y='4' width='4' height='1' fill='white'/%3E%3Crect x='1' y='5' width='2' height='1' fill='white'/%3E%3Crect x='11' y='5' width='2' height='1' fill='white'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6' shape-rendering='crispEdges'%3E%3Crect x='0' y='0' width='2' height='2' fill='white' fill-opacity='0.55'/%3E%3C/svg%3E");
  -webkit-mask-position: top right, 0 0;
          mask-position: top right, 0 0;
  -webkit-mask-size: 140px 140px, 6px 6px;
          mask-size: 140px 140px, 6px 6px;
  -webkit-mask-repeat: no-repeat, repeat;
          mask-repeat: no-repeat, repeat;
  opacity: 0.42;
  mix-blend-mode: screen;
  transition: opacity 320ms, transform 600ms ease,
              -webkit-mask-position 240ms, mask-position 240ms;
  z-index: -1;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}
.friend-card[data-motif="pixel-bone"]:hover::after {
  opacity: 0.62;
  /* dot grid jogs on hover; bone stays anchored */
  -webkit-mask-position: top right, 3px 3px;
          mask-position: top right, 3px 3px;
}

/* crystal motif: faceted conic + radial gradient overlay */
.friend-card[data-motif="crystal"]::after {
  content: '';
  position: absolute; inset: 0;
  background:
    conic-gradient(from 200deg at 110% -10%,
      color-mix(in oklab, var(--c1) 45%, transparent) 0deg,
      transparent 60deg,
      color-mix(in oklab, var(--c2) 35%, transparent) 120deg,
      transparent 180deg,
      color-mix(in oklab, var(--c3) 40%, transparent) 240deg,
      transparent 300deg,
      color-mix(in oklab, var(--c1) 30%, transparent) 360deg);
  opacity: 0.22;
  mix-blend-mode: screen;
  transition: opacity 320ms, transform 600ms ease;
  z-index: -1;
  pointer-events: none;
}

.friend-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--c1) 65%, var(--line));
  box-shadow:
    0 14px 40px color-mix(in oklab, var(--c1) 22%, transparent),
    0 4px 14px  color-mix(in oklab, var(--c3) 18%, transparent);
}
.friend-card:hover::before { opacity: 0.34; }
.friend-card[data-motif="crystal"]:hover::after {
  opacity: 0.45;
  transform: rotate(8deg) scale(1.05);
}
.friend-card:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }

/* min-heights on name/role reserve 2-line slots so 1-line entries align
   with 2-line entries at the same Y across a row */
.card-name {
  font-size: 1.25rem; font-weight: 800;
  line-height: 1.2; margin-bottom: 0.375rem;
  min-height: 3em;
  display: flex;
  align-items: flex-start;
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.card-role {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em;
  color: color-mix(in oklab, var(--c3) 70%, var(--text));
  min-height: 2.4em;
  margin-bottom: 1rem;
}
.card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-mut);
  line-height: 1.55;
  flex: 1 1 auto;   /* absorbs slack so read-more sits at card bottom */
}
.card-expand-hint {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.75rem; font-weight: 700;
  color: color-mix(in oklab, var(--c2) 60%, var(--text));
  letter-spacing: 0.02em;
}
.card-expand-hint::after {
  content: ' →';
  display: inline-block;
  transition: transform 220ms;
}
.friend-card:hover .card-expand-hint::after { transform: translateX(4px); }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 10, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  animation: fade-in 220ms ease-out;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  --c1: #A940F2; --c2: #405EF2; --c3: #409FF3;
  background: var(--bg-1);
  border: 1px solid color-mix(in oklab, var(--c1) 30%, var(--line));
  border-radius: var(--radius);
  width: 100%; max-width: 580px; max-height: 86vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.55),
    0 0 0 1px color-mix(in oklab, var(--c1) 20%, transparent);
  animation: pop 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in oklab, var(--c1) 40%, transparent), transparent 60%),
    radial-gradient(ellipse 70% 40% at 0% 100%, color-mix(in oklab, var(--c3) 30%, transparent), transparent 70%);
  opacity: 0.22;
  pointer-events: none;
  border-radius: var(--radius);
}
.modal > * { position: relative; }
@keyframes pop {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  gap: 1rem;
}
.modal-name {
  font-size: clamp(1.5rem, 1vw + 1.25rem, 2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.modal-role {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em;
  color: color-mix(in oklab, var(--c3) 65%, var(--text));
  margin-top: 0.375rem;
}
.modal-close {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font); font-weight: 700;
  font-size: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 44px; min-height: 44px;
  flex-shrink: 0;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.modal-close:hover {
  background: var(--c1);
  border-color: var(--c1);
}
.modal-close:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }

.modal-body { padding: 1.5rem 1.75rem 1.75rem; }
.modal-bio {
  font-size: 0.9375rem;
  color: var(--text-mut);
  line-height: 1.65;
  max-width: 56ch;
  margin-bottom: 1.5rem;
}

.modal-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.625rem;
}
.modal-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none; color: inherit;
  transition: border-color 150ms, background 150ms, transform 180ms;
}
.modal-link .ch-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  padding: 3px;
}
/* full-width section divider inside the modal-links grid */
.modal-link-section {
  grid-column: 1 / -1;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.625rem 0 0.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.375rem;
}
.modal-link-section:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
/* country-flag chip on the right of a modal link */
.modal-link .link-flag {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px; height: 18px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  display: block;
  line-height: 0;
}
.modal-link .link-flag img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.modal-link:hover {
  border-color: color-mix(in oklab, var(--c1) 55%, var(--line));
  background: color-mix(in oklab, var(--c1) 10%, var(--bg-2));
  transform: translateY(-1px);
}
.modal-link:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
.modal-link .ch-platform { margin-bottom: 0.125rem; }
.modal-link .ch-handle  { font-size: 0.875rem; }

/* footer */
footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.8125rem;
}
footer .grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-weight: 700;
}
/* Flux - phone + touch tweaks (paddings, single-column grids, no-hover state) */

/* tablet and narrower */
@media (max-width: 720px) {
  :root {
    --pad-x:      1rem;
    --pad-y:      1.125rem;
    --section-y:  2rem;
  }

  /* tab bar scrolls horizontally if labels overflow */
  .tab-bar {
    width: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }

  .tab {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .channels      { grid-template-columns: 1fr; }
  .friends-grid  { grid-template-columns: 1fr; gap: 1rem; }
  .modal-links   { grid-template-columns: 1fr; }

  /* touch device: render the active state by default since hover never fires */
  .friend-card           { transform: none; }
  .friend-card::before   { opacity: 0.28; }
  .channel-row::after    { opacity: 0.45; }
}

/* phone (TikTok / Reels typical viewport) */
@media (max-width: 480px) {
  body {
    /* tighter line-height fits the blurb in fewer scroll positions */
    line-height: 1.55;
  }

  .display-name {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
    margin-bottom: 1rem;
  }
  .blurb {
    font-size: 1rem;
    line-height: 1.6;
  }

  .tab {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
  .tab-bar { gap: 0.25rem; padding: 0.25rem; }

  /* tighter channel-row padding so two-line text doesn't blow up height */
  .channel-row {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }
  .ch-icon { width: 32px; height: 32px; font-size: 0.75rem; }

  .friend-card { padding: 1.25rem; }
  .card-name   { font-size: 1.125rem; }

  /* modal fills more of the viewport on tiny screens */
  .modal-backdrop { padding: 0.75rem; }
  .modal {
    max-height: 92vh;
    border-radius: 12px;
  }
  .modal-header { padding: 1.25rem 1.25rem 1rem; gap: 0.75rem; }
  .modal-name   { font-size: 1.375rem; }
  .modal-body   { padding: 1.25rem; }
  .modal-bio    { font-size: 0.9375rem; margin-bottom: 1.25rem; }
  .modal-close  { padding: 0.5rem 0.625rem; font-size: 0.6875rem; }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 0 2rem;
  }
}

/* coarse pointer (any width): drop hover affordances */
@media (hover: none) {
  .friend-card:hover           { transform: none; }
  .friend-card:hover::before   { opacity: 0.28; }
  .channel-row:hover           { transform: none; box-shadow: none; }
  .channel-row:hover::after    { opacity: 0.55; }
  .friend-card:hover .card-expand-hint::after { transform: none; }
}

/* iOS Safari: fixed-position drift can stutter on scroll, slow it */
@supports (-webkit-touch-callout: none) {
  body::before { animation-duration: 48s; }
}
