.life-page {
  --life-line: #27302a;
  --life-sage: #9fc69f;
  --life-paper: #eef2ec;
  min-height: 100vh;
  background: #070907;
}

.life-page::selection {
  color: #070907;
  background: var(--life-sage);
}

#life-canvas {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: calc(100vh - var(--header-height));
  background: #070907;
  pointer-events: none;
}

.life-header {
  border-bottom-color: rgba(39, 48, 42, 0.75);
  background: rgba(7, 9, 7, 0.9);
}

.life-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--life-line);
  border-radius: var(--radius);
  color: #bcc5ba;
  background: rgba(10, 13, 10, 0.82);
  font-size: 12px;
}

.life-back svg {
  width: 16px;
  height: 16px;
}

.life-main,
.life-footer {
  width: min(var(--content), calc(100% - 44px));
  margin: 0 auto;
}

.life-main {
  padding-top: 48px;
}

.life-intro {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: end;
  min-height: 242px;
  padding-bottom: 42px;
}

.life-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px;
  color: #98a397;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.life-kicker span {
  width: 20px;
  height: 1px;
  background: var(--life-sage);
}

.life-intro h1 {
  margin: 0;
  color: var(--life-paper);
  font-family: ui-serif, Georgia, "Songti SC", serif;
  font-size: 62px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.life-intro-copy {
  padding-bottom: 4px;
}

.life-intro-copy > p {
  max-width: 470px;
  margin: 0;
  color: #b7c0b5;
  font-size: 15px;
  line-height: 1.9;
}

.privacy-mark {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 8px;
  margin-top: 21px;
  color: #7e8a7e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.privacy-mark i {
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--life-sage);
  border-radius: 50%;
}

.life-tools {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.life-tool {
  min-width: 0;
  min-height: 620px;
  padding: 24px;
  border: 1px solid var(--life-line);
  border-radius: var(--radius);
  background: rgba(9, 12, 9, 0.9);
  backdrop-filter: blur(14px);
}

.breath-tool,
.focus-tool {
  grid-column: span 4;
}

.journal-tool {
  grid-column: span 4;
}

.life-tool > header > span {
  color: #778277;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.life-tool h2 {
  margin: 7px 0 0;
  color: var(--life-paper);
  font-size: 23px;
  font-weight: 570;
  line-height: 1.3;
  letter-spacing: 0;
}

.breath-visual {
  --breath-scale: 0.72;
  position: relative;
  width: 220px;
  height: 220px;
  margin: 56px auto 28px;
}

.breath-visual i,
.breath-visual b {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(var(--breath-scale));
  transition: transform 200ms linear, border-color 300ms ease-out, background-color 300ms ease-out;
}

.breath-visual i:first-child {
  width: 210px;
  height: 210px;
  border: 1px solid #2b382f;
}

.breath-visual i:nth-child(2) {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(159, 198, 159, 0.58);
}

.breath-visual b {
  width: 74px;
  height: 74px;
  border: 1px solid var(--life-sage);
  background: rgba(159, 198, 159, 0.08);
}

.breath-visual[data-phase="hold"] i:nth-child(2),
.breath-visual[data-phase="hold"] b {
  border-color: #f2bd63;
}

.breath-visual[data-phase="exhale"] i:nth-child(2),
.breath-visual[data-phase="exhale"] b {
  border-color: #72a7f5;
}

.breath-readout {
  min-height: 56px;
  text-align: center;
}

.breath-readout strong,
.breath-readout span {
  display: block;
}

.breath-readout strong {
  color: var(--life-paper);
  font-size: 15px;
  font-weight: 550;
}

.breath-readout span {
  margin-top: 5px;
  color: #7e8a7e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 18px 0 13px;
  padding: 0;
  border: 1px solid var(--life-line);
  border-radius: var(--radius);
}

.segment-control legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.segment-control label {
  min-width: 0;
}

.segment-control label + label {
  border-left: 1px solid var(--life-line);
}

.segment-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-control span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 4px 8px;
  color: #7e8a7e;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}

.segment-control input:checked + span {
  color: var(--life-paper);
  background: #182019;
}

.segment-control input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.tool-command,
.sound-command,
.quiet-command,
.segment-buttons button {
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
}

.tool-command,
.sound-command {
  width: 100%;
  border: 1px solid var(--life-sage);
  color: #071008;
  background: var(--life-sage);
  font-size: 13px;
  font-weight: 650;
  transition: color 160ms ease-out, background-color 160ms ease-out, transform 160ms ease-out;
}

.tool-command:hover,
.sound-command:hover {
  color: var(--life-paper);
  background: #111711;
  transform: translateY(-1px);
}

.focus-time {
  margin-top: 88px;
  color: var(--life-paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 64px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.focus-state {
  min-height: 24px;
  margin: 15px 0 59px;
  color: #7e8a7e;
  font-size: 12px;
  text-align: center;
}

.segment-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--life-line);
  border-radius: var(--radius);
}

.segment-buttons button {
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--life-line);
  color: #7e8a7e;
  background: transparent;
  font-size: 11px;
}

.segment-buttons button:last-child {
  border-right: 0;
}

.segment-buttons button:hover,
.segment-buttons button.is-active {
  color: var(--life-paper);
  background: #182019;
}

.focus-actions {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
  margin-top: 13px;
}

.quiet-command {
  padding: 0 12px;
  border: 1px solid var(--life-line);
  color: #9aa69a;
  background: #0d110d;
  font-size: 11px;
}

.quiet-command:hover {
  color: var(--life-paper);
  border-color: #586458;
}

.quiet-command.danger {
  color: #c58b80;
}

.journal-tool label {
  display: block;
  margin-top: 31px;
  color: #aab4a9;
  font-size: 12px;
}

.journal-tool textarea {
  display: block;
  width: 100%;
  min-height: 126px;
  margin-top: 9px;
  padding: 13px;
  resize: vertical;
  border: 1px solid var(--life-line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--life-paper);
  background: #080b08;
  font-size: 13px;
  line-height: 1.75;
}

.journal-tool textarea:focus {
  border-color: var(--life-sage);
}

.journal-tool textarea::placeholder {
  color: #576157;
}

.journal-meta,
.journal-history-head,
.journal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.journal-meta {
  min-height: 28px;
  color: #697569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.journal-history {
  margin-top: 25px;
  padding-top: 19px;
  border-top: 1px solid var(--life-line);
}

.journal-history-head h3 {
  margin: 0;
  color: #aab4a9;
  font-size: 12px;
  font-weight: 550;
}

.journal-history-head span {
  color: #697569;
  font-size: 10px;
}

.journal-history ol {
  max-height: 164px;
  margin: 10px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: #455045 #0a0d0a;
}

.journal-entry {
  position: relative;
  padding: 11px 42px 11px 0;
  border-top: 1px solid #1b231c;
}

.journal-entry p {
  margin: 0;
  color: #b7c0b5;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.journal-entry time {
  display: block;
  margin-top: 5px;
  color: #626e62;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.journal-entry button {
  position: absolute;
  top: 7px;
  right: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  color: #697569;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.journal-entry button:hover {
  color: #d49a8f;
}

.journal-empty {
  margin: 18px 0;
  color: #626e62;
  font-size: 11px;
}

.journal-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.sound-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(290px, 0.9fr) 140px;
  gap: 28px;
  align-items: center;
  min-height: 150px;
  margin-top: 10px;
  padding: 26px 28px;
  border: 1px solid var(--life-line);
  border-radius: var(--radius);
  background: rgba(9, 12, 9, 0.9);
}

.sound-strip h2 {
  margin: 6px 0 0;
  color: var(--life-paper);
  font-size: 22px;
  font-weight: 570;
  letter-spacing: 0;
}

.sound-command {
  min-width: 140px;
}

.life-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 128px;
  margin-top: 80px;
  border-top: 1px solid var(--life-line);
  color: #697569;
  font-size: 11px;
}

.life-footer p {
  margin: 0;
}

.life-footer a {
  min-height: 44px;
  color: #99a499;
}

@media (max-width: 1040px) {
  .breath-tool,
  .focus-tool {
    grid-column: span 6;
  }

  .journal-tool {
    grid-column: span 12;
    min-height: 540px;
  }

  .sound-strip {
    grid-template-columns: 1fr 1fr;
  }

  .sound-command {
    grid-column: 2;
    justify-self: stretch;
  }
}

@media (max-width: 720px) {
  .life-back span {
    display: none;
  }

  .life-back {
    width: 44px;
    padding: 0;
  }

  .life-main,
  .life-footer {
    width: calc(100% - 28px);
  }

  .life-main {
    padding-top: 24px;
  }

  .life-intro {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: 250px;
    padding-bottom: 30px;
  }

  .life-intro h1 {
    font-size: 48px;
  }

  .life-intro-copy > p {
    font-size: 14px;
  }

  .breath-tool,
  .focus-tool,
  .journal-tool {
    grid-column: span 12;
    min-height: 0;
  }

  .breath-tool,
  .focus-tool {
    min-height: 570px;
  }

  .life-tool {
    padding: 21px;
  }

  .focus-time {
    margin-top: 72px;
    font-size: 56px;
  }

  .sound-strip {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 20px;
  }

  .sound-command {
    grid-column: 1;
  }

  .life-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
  }
}

@media (max-width: 380px) {
  .breath-visual {
    width: 190px;
    height: 190px;
  }

  .breath-visual i:first-child {
    width: 184px;
    height: 184px;
  }

  .breath-visual i:nth-child(2) {
    width: 132px;
    height: 132px;
  }

  .segment-buttons button,
  .segment-control span {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breath-visual i,
  .breath-visual b {
    transform: translate(-50%, -50%);
    transition: border-color 1ms linear;
  }
}
