:root {
  --bg-start: #efc0bc;
  --bg-mid: #e1a8a3;
  --bg-end: #b76a67;
  --surface: rgba(255, 251, 247, 0.82);
  --surface-strong: rgba(255, 248, 239, 0.94);
  --text: #22181a;
  --muted: #68565d;
  --line: rgba(34, 24, 26, 0.1);
  --accent: #d94c52;
  --accent-deep: #8f2c2f;
  --accent-soft: #ef9ea1;
  --glow-one: rgba(217, 76, 82, 0.34);
  --glow-two: rgba(143, 44, 47, 0.28);
  --shadow: 0 24px 80px rgba(83, 42, 28, 0.14);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 18px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg-start: #35181d;
  --bg-mid: #27161b;
  --bg-end: #130b0f;
  --surface: rgba(30, 24, 29, 0.82);
  --surface-strong: rgba(38, 31, 36, 0.94);
  --text: #f8ece7;
  --muted: #c3afb0;
  --line: rgba(255, 236, 231, 0.1);
  --accent: #f07268;
  --accent-deep: #c85b62;
  --accent-soft: rgba(240, 114, 104, 0.2);
  --glow-one: rgba(240, 114, 104, 0.25);
  --glow-two: rgba(151, 66, 77, 0.28);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 36%),
    radial-gradient(circle at right 18%, var(--glow-one) 0%, transparent 24%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-mid) 52%, var(--bg-end) 100%);
}

.page-shell {
  position: relative;
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
}

.backdrop {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
}

.backdrop-one {
  top: 8%;
  left: -8rem;
  width: 18rem;
  height: 18rem;
  background: var(--glow-one);
}

.backdrop-two {
  right: -6rem;
  bottom: 10%;
  width: 20rem;
  height: 20rem;
  background: var(--glow-two);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 1.5rem));
  margin: 0 auto;
  height: 100vh;
  padding: 1rem 0;
  display: grid;
  gap: 1rem;
  align-content: stretch;
}

.profile-card,
.stream-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.profile-card {
  min-height: 0;
  overflow: hidden;
  padding: 0.35rem;
}

.profile-scroll {
  height: 100%;
  padding: 1.4rem 0.8rem 1.4rem 1.4rem;
  border-radius: calc(var(--radius-xl) - 6px);
  text-align: center;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 40%, transparent) transparent;
}

.profile-scroll::-webkit-scrollbar {
  width: 9px;
}

.profile-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin-block: 0.35rem;
}

.profile-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.profile-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent-deep) 58%, transparent);
  background-clip: padding-box;
}

.theme-toggle-row {
  display: flex;
  justify-content: flex-end;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.stream-card {
  margin-bottom: 0.9rem;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.avatar-image {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 36px rgba(83, 42, 28, 0.16);
}

.eyebrow,
.handle,
.bio {
  color: var(--muted);
}

.eyebrow {
  margin: 1rem 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 0.95;
}

h1 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(2.7rem, 7vw, 4.75rem);
  font-weight: 400;
}

h2 {
  font-family: "Instrument Serif", serif;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 400;
}

.handle {
  margin: 0.4rem 0 0;
  font-size: 1rem;
}

.bio {
  margin: 1rem 0 0;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  line-height: 1.6;
}

.links-grid {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.9rem;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: var(--surface-strong);
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: 0 14px 34px rgba(83, 42, 28, 0.11);
  background: color-mix(in srgb, var(--surface-strong) 85%, white);
}

.link-main {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.link-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--text);
}

.link-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.link-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.link-title,
.link-arrow {
  font-weight: 700;
}

.link-title,
.link-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-subtitle {
  margin-top: 0.12rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.link-arrow {
  font-size: 1.15rem;
}

.stream-header {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.stream-body {
  display: grid;
}

.stream-embed {
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent) 16%, transparent), transparent 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 70%, white), var(--surface));
  aspect-ratio: 16 / 9;
}

#twitch-player,
#twitch-player iframe {
  width: 100%;
  height: 100%;
}

.hidden {
  display: none;
}

@media (min-width: 720px) {
  .layout {
    padding: 1.5rem 0;
  }

  .profile-card {
    padding: 0.45rem;
  }

  .profile-scroll {
    padding: 2rem 0.85rem 2rem 2rem;
  }

  .stream-card {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .profile-card,
  .stream-card,
  .link-card {
    animation: rise-in 520ms ease both;
  }

  .stream-card {
    animation-delay: 110ms;
  }

  .link-card:nth-child(2) {
    animation-delay: 70ms;
  }

  .link-card:nth-child(3) {
    animation-delay: 110ms;
  }

  .link-card:nth-child(4) {
    animation-delay: 150ms;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
