:root {
  color-scheme: dark;
  --paper: #171815;
  --paper-soft: #1c1d19;
  --card: #22231f;
  --card-raised: #282923;
  --ink: #e9e4d8;
  --muted: #aaa599;
  --line: #414139;
  --line-soft: #34352f;
  --accent: #b86b50;
  --accent-dark: #98513d;
  --moss: #8f9c80;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.32), 0 3px 12px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% 3%, rgba(184, 107, 80, 0.09), transparent 34rem),
    radial-gradient(circle at 10% 62%, rgba(143, 156, 128, 0.055), transparent 28rem),
    linear-gradient(155deg, #1c1d19 0%, var(--paper) 48%, #141512 100%);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.motif {
  position: absolute;
  width: min(52vw, 690px);
  height: auto;
  fill: none;
  stroke: rgba(190, 178, 157, 0.075);
  stroke-width: 1;
}

.motif-one { top: 110px; right: -210px; transform: rotate(9deg); }
.motif-two { bottom: -220px; left: -190px; transform: rotate(-17deg); opacity: .6; }
.motif .inner-ring { stroke: rgba(184, 107, 80, .15); }
.motif .inner-path { stroke: rgba(143, 156, 128, .065); }
.motif-points { fill: rgba(184, 107, 80, .18); stroke: none; }

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 36px, 940px);
  margin: 0 auto;
}

.masthead {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border-bottom: 1px solid rgba(196, 187, 170, 0.15);
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: "Newsreader", serif;
  font-size: 16px;
  line-height: 1;
}

.about-button, .install-button, .test-button, .pause-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #b8b3a8;
  font-size: 13px;
}

.about-button svg, .install-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.about-button .fill-dot { fill: currentColor; stroke: none; }
.install-button {
  min-height: 36px;
  border: 1px solid rgba(196, 187, 170, .18);
  border-radius: 3px;
  background: rgba(34, 35, 31, .72);
  padding: 0 12px;
  color: var(--ink);
}
.install-button[hidden] { display: none; }

.intro {
  padding: 80px 0 51px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
  width: 18px;
  height: 1px;
  margin: 0 8px 3px 0;
  background: currentColor;
}

.intro h1 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.02;
}

.intro h1 em { color: var(--accent); font-style: normal; }

.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
}

.practice-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(34, 35, 31, 0.96);
  box-shadow: var(--shadow);
}

.status-block {
  min-height: 107px;
  padding: 28px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(27, 28, 25, .72);
}

.status-copy { display: flex; align-items: center; gap: 16px; }

.status-indicator {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #716f68;
  box-shadow: 0 0 0 5px rgba(164, 159, 147, .08);
  transition: .25s ease;
}

.status-indicator.active {
  background: var(--moss);
  box-shadow: 0 0 0 5px rgba(143, 156, 128, .12);
}

.status-indicator.active::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--moss);
  border-radius: 50%;
  animation: breathe 2.8s ease-out infinite;
}

@keyframes breathe { 0%, 40% { opacity: .6; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.55); } }

.status-label { margin: 0 0 4px; color: var(--muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.status-copy h2 { margin: 0; font-size: 16px; font-weight: 600; }
.status-meta { color: var(--muted); font-size: 12px; }

.settings-section { padding: 34px 38px; border-bottom: 1px solid var(--line-soft); }

.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.section-heading > div { display: flex; align-items: baseline; gap: 16px; }
.section-heading h3, .sound-section strong { margin: 0; font-size: 14px; font-weight: 600; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.section-number { color: var(--accent); font-family: "Newsreader", serif; font-size: 12px; font-variant-numeric: tabular-nums; }

.time-range { display: grid; grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr); align-items: end; }
.time-field { min-width: 0; }
.field span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.time-field input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: "Newsreader", serif;
  font-size: 22px;
  transition: border-color .2s, box-shadow .2s;
}
.time-field input:focus, select:focus { border-color: #77786d; box-shadow: 0 0 0 3px rgba(184, 107, 80, .09); }
.range-line { align-self: center; padding-top: 19px; }
.range-line span { display: block; width: 28px; height: 1px; margin: 0 auto; background: #68675f; }

.settings-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.setting-copy { display: flex; align-items: center; gap: 16px; }
.setting-copy label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; }
.setting-copy p { margin: 0; color: var(--muted); font-size: 12px; }

.stepper { display: flex; height: 42px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper-soft); }
.stepper button { width: 40px; border: 0; background: transparent; color: var(--muted); font-size: 19px; transition: background .2s, color .2s; }
.stepper button:hover { background: #30312b; color: var(--ink); }
.stepper input { width: 50px; border: 0; border-inline: 1px solid var(--line-soft); outline: none; background: transparent; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }

.select-wrap { position: relative; }
.select-wrap select {
  width: 178px;
  height: 42px;
  padding: 0 39px 0 14px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 12px;
}
.select-wrap svg { position: absolute; top: 12px; right: 13px; width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.5; pointer-events: none; }

.sound-section {
  min-width: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
}
.sound-section legend { display: flex; align-items: flex-start; gap: 16px; padding: 0; }
.sound-section legend span:last-child { display: flex; flex-direction: column; gap: 5px; }
.sound-section legend small { color: var(--muted); font-size: 12px; font-weight: 400; }
.sound-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 25px; }
.sound-option {
  position: relative;
  min-height: 112px;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  column-gap: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-soft);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.sound-option:hover { transform: translateY(-1px); border-color: #737269; background: #20211d; }
.sound-option:has(input:checked) { border-color: var(--accent); background: #2d2521; box-shadow: inset 0 0 0 1px var(--accent); }
.sound-option input { position: absolute; opacity: 0; }
.sound-icon { grid-row: 1; width: 27px; height: 27px; color: #aaa69b; }
.sound-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sound-option > span:last-child { grid-column: 1 / -1; align-self: end; }
.sound-option strong, .sound-option small { display: block; }
.sound-option strong { margin-bottom: 4px; font-size: 12px; }
.sound-option small { color: var(--muted); font-size: 10px; }
.radio-mark { position: absolute; top: 14px; right: 14px; width: 13px; height: 13px; border: 1px solid #716f68; border-radius: 50%; }
.sound-option input:checked + .radio-mark { border: 4px solid var(--accent); }
.audio-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.volume-control, .vibration-control {
  min-height: 76px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(28, 29, 25, .72);
}
.volume-copy strong, .vibration-control strong { display: block; margin-bottom: 4px; font-size: 12px; }
.volume-copy small, .vibration-control small { display: block; color: var(--muted); font-size: 10px; }
.volume-slider { min-width: 190px; display: flex; align-items: center; gap: 11px; }
.volume-slider input {
  width: 140px;
  height: 3px;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to right, var(--accent) 0 86%, var(--line) 86% 100%);
}
.volume-slider input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: #d48869;
  box-shadow: 0 0 0 1px var(--accent);
}
.volume-slider input::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: #d48869;
  box-shadow: 0 0 0 1px var(--accent);
}
.volume-slider output { min-width: 34px; color: #d8d2c5; font-size: 11px; font-variant-numeric: tabular-nums; }
.vibration-control { position: relative; cursor: pointer; }
.vibration-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  border: 1px solid #5f6057;
  border-radius: 999px;
  background: #282923;
  transition: .2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8a887f;
  transition: .2s ease;
}
.vibration-control input:checked + .switch { border-color: var(--accent); background: #392a24; }
.vibration-control input:checked + .switch::after { transform: translateX(16px); background: #d48869; }
.vibration-control input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(184, 107, 80, .18); }
.test-button { margin: 18px auto 0; border-bottom: 1px solid #5e5d55; padding: 6px 2px; transition: color .2s, border-color .2s; }
.test-button.playing { color: #c99075; border-color: var(--accent); }
.test-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.form-error { min-height: 0; margin: 0; padding: 0 38px; color: var(--accent); font-size: 12px; text-align: center; }
.form-error:not(:empty) { padding-top: 18px; }

.actions { padding: 30px 38px 34px; display: flex; gap: 12px; }
.primary-button, .pause-button {
  height: 50px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .035em;
}
.primary-button {
  flex: 1;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  transition: background .2s, transform .2s;
}
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button-dot { display: inline-block; width: 6px; height: 6px; margin: 0 9px 1px 0; border: 1px solid currentColor; border-radius: 50%; }
.pause-button { width: 144px; border: 1px solid var(--line); background: transparent; }
.pause-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pause-button:disabled { cursor: not-allowed; opacity: .42; }
.pause-button:not(:disabled):hover { border-color: #77766e; color: var(--ink); }

.principle { padding: 71px 20px 64px; text-align: center; }
.principle-line { display: block; width: 1px; height: 26px; margin: 0 auto 26px; background: var(--accent); }
.principle blockquote { margin: 0; font-family: "Newsreader", Georgia, serif; font-size: clamp(20px, 3vw, 25px); line-height: 1.45; }
.principle blockquote em { color: var(--accent); }
.principle p { margin: 20px 0 0; color: var(--muted); font-size: 11px; }

footer { height: 87px; display: flex; align-items: center; justify-content: center; gap: 18px; border-top: 1px solid rgba(196, 187, 170, .15); color: #77756d; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.footer-mark { width: 3px; height: 3px; border-radius: 50%; background: #716f68; }

.stop-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 15, 13, .975);
  color: #f4f0e7;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s, visibility .5s;
}
.stop-overlay.visible { opacity: 1; visibility: visible; }
.stop-content { width: min(100%, 540px); text-align: center; }
.stop-content > p { margin: 0 0 16px; color: #aaa89f; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.stop-content h2 { margin: 0; color: #d9b9a7; font-family: "Newsreader", serif; font-size: clamp(86px, 22vw, 150px); font-weight: 500; letter-spacing: .03em; line-height: 1; }
.stop-content ol { margin: 42px auto; padding: 0; list-style-position: inside; color: #d2cfc7; font-family: "Newsreader", serif; font-size: 19px; line-height: 1.9; }
.stop-content button { min-width: 130px; height: 43px; border: 1px solid #77766f; background: transparent; color: #eeeae1; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

dialog {
  width: min(calc(100% - 36px), 490px);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--card-raised);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(7, 8, 7, .75); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 18px; font-family: "Newsreader", serif; font-size: 35px; font-weight: 500; }
dialog > p:not(.eyebrow) { color: #bbb6aa; font-family: "Newsreader", serif; font-size: 18px; line-height: 1.55; }
.dialog-close { position: absolute; top: 15px; right: 17px; border: 0; background: transparent; color: var(--muted); font-size: 25px; font-weight: 300; }

@media (max-width: 650px) {
  .app-shell { width: min(100% - 22px, 940px); }
  .masthead { height: 70px; }
  .intro { padding: 60px 0 38px; }
  .status-block, .settings-section, .actions { padding-left: 22px; padding-right: 22px; }
  .status-meta, .section-heading p { display: none; }
  .time-range { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); }
  .time-field input { min-width: 0; padding: 0 8px; font-size: 16px; }
  .sound-options { grid-template-columns: 1fr; }
  .sound-option { min-height: 75px; grid-template-columns: 34px 1fr; grid-template-rows: 1fr; }
  .sound-option > span:last-child { grid-column: 2; grid-row: 1; align-self: center; }
  .audio-controls { grid-template-columns: 1fr; }
  .volume-control { align-items: flex-start; flex-direction: column; gap: 14px; }
  .volume-slider { width: 100%; min-width: 0; }
  .volume-slider input { flex: 1; width: auto; }
  .settings-grid { gap: 20px; }
  .setting-copy .section-number { display: none; }
  .actions { flex-direction: column; }
  .pause-button { width: 100%; }
  footer { gap: 9px; font-size: 7px; }
  .motif { width: 620px; opacity: .62; }
  .motif-one { top: 180px; right: -390px; }
  .motif-two { bottom: -170px; left: -390px; }
}

@media (max-width: 420px) {
  .masthead { gap: 10px; }
  .install-button {
    width: 40px;
    padding: 0;
    font-size: 0;
  }
  .install-button svg { width: 18px; }
}

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