:root {
  --bg: #07131f;
  --bg-soft: #102334;
  --panel: rgba(10, 18, 28, 0.78);
  --panel-strong: rgba(8, 15, 24, 0.92);
  --line: rgba(169, 195, 222, 0.18);
  --text: #f4f7fb;
  --muted: #9fb4c8;
  --accent: #7ca6ff;
  --accent-2: #81ddd1;
  --accent-3: #5d74f6;
  --shadow: 0 22px 60px rgba(0, 9, 18, 0.4);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(129, 221, 209, 0.14), transparent 28%),
    radial-gradient(circle at 78% 10%, rgba(124, 166, 255, 0.16), transparent 24%),
    radial-gradient(circle at 12% 90%, rgba(93, 116, 246, 0.1), transparent 22%),
    linear-gradient(180deg, #07131f 0%, #0a1a2a 48%, #06111b 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent);
}

body[data-room-theme="sunrise-desk"] {
  background:
    radial-gradient(circle at top left, rgba(140, 186, 255, 0.22), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(129, 221, 209, 0.14), transparent 24%),
    linear-gradient(180deg, #171e31 0%, #15273b 50%, #0c1626 100%);
}

body[data-room-theme="rain-study"] {
  background:
    radial-gradient(circle at top left, rgba(113, 163, 223, 0.18), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(129, 221, 209, 0.1), transparent 20%),
    linear-gradient(180deg, #09131f 0%, #10202f 50%, #09131d 100%);
}

body[data-room-theme="deep-ocean"] {
  background:
    radial-gradient(circle at top left, rgba(72, 146, 210, 0.2), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(129, 221, 209, 0.12), transparent 20%),
    linear-gradient(180deg, #05131d 0%, #082131 50%, #031019 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.site-shell {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.narrow {
  width: min(760px, 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(5, 12, 20, 0.74);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(169, 195, 222, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.brand-copy {
  display: flex;
  align-items: center;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-mark-ring,
.brand-mark-core {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.brand-mark-ring {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(124, 166, 255, 0.95);
  box-shadow: 0 0 18px rgba(124, 166, 255, 0.2);
}

.brand-mark-ring-secondary {
  width: 14px;
  height: 14px;
  border-color: rgba(129, 221, 209, 0.95);
}

.brand-mark-core {
  width: 6px;
  height: 6px;
  background: linear-gradient(180deg, var(--accent-2), #dff8f3);
  box-shadow: 0 0 14px rgba(129, 221, 209, 0.4);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 600;
}

.site-nav a.is-active,
.site-nav a:hover {
  color: #dce8ff;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
}

.hero,
.page-hero,
.section,
.site-footer,
.article-shell {
  position: relative;
}

.hero {
  padding: 4.25rem 0 2.4rem;
}

.hero-grid,
.two-column,
.tool-layout,
.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  grid-template-columns: 1.3fr 0.9fr;
  align-items: center;
}

.hero-copy h1,
.page-hero h1,
.section-heading h2,
.article-container h1 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
}

.page-hero {
  padding: 2.4rem 0 0.75rem;
}

.page-hero h1,
.article-container h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

.hero-text,
.page-hero p,
.section-heading p,
.article-lede {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-text-short,
.page-hero p {
  max-width: 34rem;
}

.hero-actions,
.button-row,
.preset-row,
.mode-row,
.theme-row,
.hero-points,
.compact-list,
.footer-links {
  display: flex;
  gap: 0.8rem;
}

.hero-actions,
.button-row,
.preset-row,
.mode-row,
.theme-row,
.footer-links {
  flex-wrap: wrap;
}

.hero-points,
.compact-list {
  padding: 0;
  margin: 1.3rem 0 0;
  list-style: none;
  flex-direction: column;
}

.hero-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.hero-points li,
.compact-list li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--muted);
}

.hero-points li::before,
.compact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

.button,
.pill-button,
.theme-chip,
.mode-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.pill-button:hover,
.theme-chip:hover,
.mode-button:hover {
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.3rem;
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #f7fbff;
}

.button-secondary,
.pill-button,
.theme-chip,
.mode-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pill-button,
.theme-chip,
.mode-button {
  padding: 0.72rem 1rem;
}

.pill-button.is-active,
.theme-chip.is-active,
.mode-button.is-active {
  border-color: rgba(124, 166, 255, 0.45);
  background: rgba(124, 166, 255, 0.14);
}

.eyebrow,
.card-label {
  margin: 0 0 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-2);
}

.hero-panel,
.stacked-cards,
.stack {
  display: grid;
  gap: 1rem;
}

.hero-grid-tight {
  align-items: stretch;
}

.hero-card,
.feature-card,
.pricing-card,
.tool-panel,
.faq-item,
.tip-box {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 25, 38, 0.88), rgba(9, 18, 29, 0.82));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-card,
.feature-card,
.pricing-card,
.faq-item,
.tip-box {
  padding: 1.35rem;
}

.hero-card-featured {
  padding: 1.6rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-row strong {
  display: block;
  font-size: 1.3rem;
}

.stat-row span {
  color: var(--muted);
  font-size: 0.92rem;
}

.mini-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.mini-timeline span {
  display: block;
  text-align: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.55rem 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.section {
  padding: 1.2rem 0 3.2rem;
}

.section-alt {
  padding-top: 0.5rem;
}

.section-alt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.5rem;
}

.section-heading-compact {
  max-width: 560px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin-bottom: 1rem;
}

.feature-grid,
.pricing-grid,
.faq-list {
  display: grid;
  gap: 1rem;
}

.home-dock,
.quick-grid {
  display: grid;
  gap: 1rem;
}

.home-dock {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card h3,
.feature-card h2,
.pricing-card h3,
.faq-item h3,
.tip-box h3,
.tool-panel h2 {
  margin-top: 0;
}

.feature-card p,
.pricing-card p,
.faq-item p,
.tip-box p,
.tool-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.text-link,
.card-link {
  color: var(--accent);
  font-weight: 700;
}

.launcher-card,
.home-card,
.quick-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 26, 39, 0.92), rgba(9, 18, 28, 0.84));
  box-shadow: var(--shadow);
}

.launcher-card {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
}

.launcher-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.launcher-tabs,
.launcher-stack,
.launcher-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.launcher-tab,
.launcher-pill {
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.launcher-tab.is-active {
  background: rgba(124, 166, 255, 0.16);
  color: var(--text);
}

.launcher-display {
  font-size: clamp(4rem, 10vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  font-weight: 800;
}

.launcher-footer {
  color: var(--muted);
  font-size: 0.95rem;
}

.home-card,
.quick-card {
  padding: 1.25rem;
}

.home-card-icon {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 0.9rem;
  font-size: 1.1rem;
}

.home-card p,
.quick-card span {
  color: var(--muted);
}

.quick-card strong {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  letter-spacing: -0.04em;
}

.two-column {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.tool-layout {
  grid-template-columns: 1.3fr 0.8fr;
  align-items: start;
}

.tool-panel {
  padding: 1.4rem;
}

.tool-panel-large {
  padding: 1.6rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.status-chip {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.timer-card {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 6px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  padding: 1.25rem;
}

.timer-display {
  margin: 1rem 0;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(3rem, 8vw, 5.8rem);
  letter-spacing: -0.06em;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  color: var(--muted);
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.field textarea {
  resize: vertical;
}

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

.preset-row-wrap {
  margin-bottom: 1rem;
}

.mode-row,
.theme-row {
  margin-bottom: 1rem;
}

.sleep-pane.hidden {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.result-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 1rem;
}

.result-card strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 0.2rem;
}

.result-card span {
  color: var(--muted);
}

.faq-shell {
  max-width: 980px;
}

.faq-list {
  grid-template-columns: 1fr 1fr;
}

.site-footer {
  padding: 1.7rem 0 2.6rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}

.footer-grid {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.footer-links {
  justify-content: flex-end;
}

.footer-links a,
.footer-note {
  color: var(--muted);
}

.brand-footer .brand-mark {
  width: 42px;
  height: 42px;
}

body[data-page="study"]::after {
  content: "";
  position: fixed;
  inset: auto 0 -12vh 0;
  height: 40vh;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(129, 221, 209, 0.1), transparent 58%);
  filter: blur(24px);
}

.study-app-section {
  padding: 1.5rem 0 3.5rem;
}

.study-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 340px);
  gap: 1rem;
  align-items: stretch;
}

.study-main-panel,
.study-side-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(169, 195, 222, 0.18);
  background: linear-gradient(180deg, rgba(10, 19, 30, 0.88), rgba(7, 15, 25, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.study-main-panel {
  border-radius: 32px;
  padding: 1.4rem;
}

.study-main-panel::before,
.study-side-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%);
}

.study-side-panel,
.study-side-card,
.study-stage-copy,
.study-stage-visual {
  display: grid;
  gap: 1rem;
}

.study-side-panel {
  gap: 1rem;
}

.study-side-card {
  border-radius: 28px;
  padding: 1.2rem;
}

.study-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.study-topbar h1 {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.study-strap {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.status-chip-glow {
  color: #e7f4ff;
  background: linear-gradient(180deg, rgba(124, 166, 255, 0.2), rgba(124, 166, 255, 0.08));
  border-color: rgba(124, 166, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(124, 166, 255, 0.05);
  max-width: 20rem;
}

.study-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.study-segment .pill-button,
.theme-row-soft .theme-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(169, 195, 222, 0.16);
}

.study-segment .pill-button.is-active,
.theme-row-soft .theme-chip.is-active {
  background: rgba(124, 166, 255, 0.18);
  border-color: rgba(124, 166, 255, 0.35);
  color: #f8fbff;
}

.study-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(240px, 0.92fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.study-stage-copy,
.study-stage-visual {
  min-height: 250px;
  padding: 1.15rem;
  border: 1px solid rgba(169, 195, 222, 0.14);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.04);
}

.study-stage-header h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.9rem);
  letter-spacing: -0.04em;
}

.theme-row-soft {
  align-content: start;
}

.study-stage-visual {
  position: relative;
  align-items: end;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.12), transparent 18%),
    linear-gradient(160deg, rgba(9, 19, 31, 0.94), rgba(12, 31, 42, 0.88));
}

body[data-room-theme="rain-study"] .study-stage-visual {
  background:
    radial-gradient(circle at 30% 24%, rgba(199, 230, 255, 0.22), transparent 18%),
    linear-gradient(160deg, rgba(10, 24, 35, 0.96), rgba(16, 41, 55, 0.88));
}

body[data-room-theme="sunrise-desk"] .study-stage-visual {
  background:
    radial-gradient(circle at 32% 24%, rgba(214, 228, 255, 0.26), transparent 18%),
    linear-gradient(160deg, rgba(29, 34, 54, 0.94), rgba(27, 49, 68, 0.88));
}

body[data-room-theme="deep-ocean"] .study-stage-visual {
  background:
    radial-gradient(circle at 34% 24%, rgba(149, 206, 255, 0.2), transparent 18%),
    linear-gradient(160deg, rgba(6, 18, 28, 0.96), rgba(7, 39, 56, 0.88));
}

.study-stage-visual::before,
.study-stage-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.study-stage-visual::before {
  inset: auto 16% 22% 16%;
  height: 34%;
  border-radius: 28px 28px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.study-stage-visual::after {
  right: 14%;
  top: 16%;
  width: 38%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(129, 221, 209, 0.42), rgba(129, 221, 209, 0));
  filter: blur(10px);
}

.study-ambient-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 28%, rgba(124, 166, 255, 0.28), transparent 18%),
    radial-gradient(circle at 26% 74%, rgba(129, 221, 209, 0.18), transparent 22%);
  mix-blend-mode: screen;
  animation: ambientPulse 8s ease-in-out infinite;
}

.study-ambient-card {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 1rem 1rem 0.95rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 16, 26, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(1, 8, 16, 0.3);
  animation: ambientFloat 10s ease-in-out infinite;
}

.study-ambient-label,
.study-side-mute {
  color: var(--muted);
  font-size: 0.84rem;
}

.study-ambient-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.study-ambient-caption {
  margin: 0.35rem 0 0;
  color: #d9eafc;
  font-size: 0.94rem;
}

.timer-card-study {
  padding: 1.1rem 1.2rem 1.2rem;
  background:
    radial-gradient(circle at top, rgba(124, 166, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
}

.field-inline {
  display: flex;
  justify-content: center;
  margin-bottom: 0.45rem;
}

.field-compact {
  width: min(220px, 100%);
}

.field-compact input {
  text-align: center;
  font-weight: 700;
}

.timer-display-study {
  margin: 0.4rem 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: clamp(4.2rem, 10vw, 7rem);
  font-weight: 780;
  text-align: center;
  letter-spacing: -0.08em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.button-row-centered {
  justify-content: center;
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.study-side-card textarea {
  min-height: 220px;
}

.study-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.study-mini-card {
  border: 1px solid rgba(169, 195, 222, 0.14);
  border-radius: 20px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.04);
}

.study-mini-card strong {
  display: block;
  margin-bottom: 0.28rem;
  letter-spacing: -0.03em;
}

.study-mini-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

@keyframes ambientPulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes ambientFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.article-shell {
  padding: 3.5rem 0 4rem;
}

.article-container {
  max-width: 800px;
}

.article-lede {
  margin-bottom: 2rem;
}

.article-body {
  display: grid;
  gap: 1.3rem;
  color: var(--muted);
  line-height: 1.8;
}

.article-body h2 {
  margin-bottom: 0;
  color: var(--text);
}

.article-cta {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

@media (max-width: 960px) {
  .hero-grid,
  .two-column,
  .tool-layout,
  .study-dashboard,
  .pricing-grid,
  .feature-grid,
  .home-dock,
  .quick-grid,
  .faq-list,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(7, 15, 24, 0.96);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .settings-grid,
  .result-grid,
  .stat-row,
  .study-mini-grid {
    grid-template-columns: 1fr;
  }

  .study-stage {
    grid-template-columns: 1fr;
  }

  .study-topbar {
    flex-direction: column;
  }

  .status-chip-glow {
    max-width: none;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 4rem;
  }

  .container {
    width: min(100% - 1.25rem, 1120px);
  }

  .hero-copy h1,
  .page-hero h1,
  .section-heading h2,
  .article-container h1,
  .timer-display {
    line-height: 1.02;
  }

  .timer-display {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }

  .tool-panel,
  .tool-panel-large,
  .study-main-panel,
  .study-side-card,
  .feature-card,
  .pricing-card,
  .faq-item,
  .tip-box,
  .hero-card {
    padding: 1.1rem;
  }

  .study-app-section {
    padding-top: 1rem;
  }

  .study-main-panel {
    border-radius: 28px;
  }

  .study-stage-copy,
  .study-stage-visual {
    min-height: 220px;
    padding: 1rem;
  }

  .timer-display-study {
    font-size: clamp(3.3rem, 17vw, 5.3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .study-ambient-glow,
  .study-ambient-card {
    animation: none;
  }
}

/* ── Focus stage (full-screen timer) ── */
body[data-page="focus"] .site-footer { display: none; }

.focus-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 78px);
  padding: 2rem 1rem 5rem;
}

.focus-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
  width: 100%;
}

.focus-room-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.focus-timer {
  font-size: clamp(5.5rem, 20vw, 13rem) !important;
  margin: 0 !important;
  line-height: 0.88 !important;
}

.focus-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.focus-controls { justify-content: center; }
.focus-presets  { justify-content: center; }

.js-hideable {
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.focus-stage.is-clean .js-hideable {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Settings FAB */
.focus-fabs {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
}

.focus-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 18, 28, 0.82);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  backdrop-filter: blur(14px);
  transition: color 0.2s, background 0.2s, transform 0.18s;
}

.focus-fab:hover {
  color: var(--text);
  background: rgba(20, 36, 54, 0.96);
  transform: scale(1.06);
}

.focus-fab.is-active {
  color: var(--accent);
  border-color: rgba(124, 166, 255, 0.4);
  background: rgba(20, 36, 54, 0.96);
}

/* Hide toggle (bottom-left) */
.focus-hide-toggle {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.52rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 18, 28, 0.72);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: color 0.2s, background 0.2s;
}

.focus-hide-toggle:hover { color: var(--text); }

/* Settings panel (slide from right) */
.sp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.sp-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.settings-panel {
  position: fixed;
  top: 78px;
  right: 0;
  width: min(380px, 100vw);
  height: calc(100vh - 78px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: rgba(7, 13, 22, 0.97);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(24px);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-panel.is-open {
  transform: translateX(0);
}

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sp-title {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.sp-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }

.sp-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.4rem 2rem;
}

.sp-section {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.sp-section:last-child { border-bottom: none; }

.sp-label {
  margin: 0 0 0.8rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ── YouTube video background ── */
.yt-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: none;
}

.yt-bg-layer.is-active {
  display: block;
}

.yt-bg-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100vh * 16 / 9);
  height: 100vh;
  min-width: 100%;
  min-height: calc(100vw * 9 / 16);
  border: 0;
}

.yt-bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 20, 0.35);
}

body.has-yt-bg {
  background: transparent;
}

body.has-yt-bg::before {
  opacity: 0;
}

/* ── YouTube panel ── */
.yt-panel {
  display: grid;
  gap: 0.65rem;
}

.yt-input-row {
  display: flex;
  gap: 0.5rem;
}

.yt-url-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.yt-set-btn {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 12px;
}

.yt-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.yt-controls[hidden] {
  display: none;
}

.yt-overlay-label {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.yt-controls input[type="range"] {
  flex: 1;
  min-width: 50px;
  accent-color: var(--accent);
}

.yt-overlay-val {
  color: var(--muted);
  font-size: 0.84rem;
  min-width: 2.4rem;
  text-align: right;
}

/* ── Session stats (tally + streak) ── */
.session-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.streak-badge strong {
  font-weight: 700;
  color: var(--text);
}

.streak-label {
  color: var(--muted);
}

.tally-row {
  display: flex;
  gap: 0.38rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tally-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.25s, box-shadow 0.25s;
}

.tally-dot.is-filled {
  background: var(--accent);
  box-shadow: 0 0 7px rgba(124, 166, 255, 0.5);
}
