/* Breathing tool pages. Loaded after /amber.css, which provides the tokens
   (--base, --amber, --ember, --serif, --sans, .glass, .btn-primary, .glow). */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

nav .nav-links a[aria-current="page"] { opacity: 1; color: var(--text); }
@media (max-width: 420px) {
  nav { padding: 18px 16px; }
  nav .logo { font-size: 1.5rem; }
  nav .nav-links a { margin-left: 12px; font-size: 0.86rem; }
}

/* ---------- Page header ---------- */
.tool-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 22px;
  text-align: center;
}
.crumbs {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 18px;
}
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }
.crumbs span[aria-hidden] { margin: 0 6px; opacity: 0.6; }
.tool-hero h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 12px;
}
.tool-hero .lede {
  font-size: 1.04rem;
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto;
}

/* ---------- The tool card ---------- */
.tool-wrap {
  max-width: 560px;
  margin: 0 auto 72px;
  padding: 0 16px;
}
.breath-tool {
  padding: 34px 28px 26px;
  text-align: center;
}

.bt-stage {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.bt-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(242, 163, 65, 0.22);
}
.bt-ring::after {
  content: '';
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  border: 1px dashed rgba(245, 225, 200, 0.10);
}
.bt-orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%, #FFE1B0 0%, #F5A04A 48%, #D9542B 100%);
  box-shadow: 0 0 60px rgba(232, 118, 46, 0.45), 0 0 140px rgba(232, 105, 46, 0.22);
  transform: scale(0.5);
  will-change: transform, opacity;
}
.bt-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 9vw, 3.4rem);
  color: var(--btn-label);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.bt-horizon { margin-top: 22px; }

.bt-phase {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4.6vw, 1.9rem);
  color: var(--text);
  margin-top: 20px;
  min-height: 1.4em;
  line-height: 1.3;
}
.bt-meta {
  font-size: 0.86rem;
  color: var(--text-2);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.bt-dot { margin: 0 8px; opacity: 0.6; }

.bt-done {
  margin: 18px auto 0;
  max-width: 400px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-soft);
  background: rgba(242, 163, 65, 0.08);
  border: 1px solid rgba(242, 163, 65, 0.25);
  border-radius: 16px;
  padding: 14px 18px;
}

.bt-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.bt-toggle { min-width: 150px; }
.bt-toggle:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.bt-btn {
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  background: var(--secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 15px 26px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bt-btn:hover { border-color: rgba(242, 163, 65, 0.45); }

.bt-pattern {
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--text-2);
}

.bt-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 24px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
}
.bt-length { border: 0; display: flex; align-items: center; gap: 10px; }
.bt-length legend {
  float: left;
  font-size: 0.84rem;
  color: var(--text-2);
  margin-right: 10px;
  line-height: 36px;
}
.bt-seg {
  display: inline-flex;
  background: var(--secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
}
.bt-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-seg label {
  font-size: 0.84rem;
  color: var(--text-soft);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.bt-seg input:checked + label { background: var(--btn-fill); color: var(--btn-label); font-weight: 600; }
.bt-seg input:focus-visible + label { outline: 2px solid var(--amber); outline-offset: 2px; }
.bt-seg input:disabled + label { cursor: default; opacity: 0.55; }

.bt-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-soft);
  cursor: pointer;
}
.bt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-switch-track {
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--hairline);
  position: relative;
  transition: background 0.2s;
}
.bt-switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.2s, background 0.2s;
}
.bt-switch input:checked + .bt-switch-track { background: rgba(242, 163, 65, 0.35); }
.bt-switch input:checked + .bt-switch-track::after { transform: translateX(16px); background: var(--amber); }
.bt-switch input:focus-visible + .bt-switch-track { outline: 2px solid var(--amber); outline-offset: 2px; }

.bt-hint { margin-top: 16px; font-size: 0.78rem; color: var(--text-2); opacity: 0.8; }
@media (hover: none) { .bt-hint { display: none; } }

/* Custom pattern inputs */
.bt-custom { border: 0; margin-top: 22px; }
.bt-custom legend { font-size: 0.86rem; color: var(--text-soft); margin: 0 auto 10px; }
.bt-custom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.bt-field label { display: block; font-size: 0.78rem; color: var(--text-2); margin-bottom: 6px; }
.bt-field input {
  width: 100%;
  font-family: var(--sans);
  font-size: 1.1rem;
  text-align: center;
  color: var(--text);
  background: rgba(12, 9, 7, 0.6);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 6px;
}
.bt-field input:focus { border-color: var(--amber); outline: none; }
.bt-field input[aria-invalid="true"] { border-color: var(--ember); }
.bt-field input:disabled { opacity: 0.55; }
.bt-error { color: #F4A07A; font-size: 0.84rem; margin-top: 10px; min-height: 0; }
.bt-error:empty { display: none; }
.bt-field-note { font-size: 0.78rem; color: var(--text-2); margin-top: 10px; }

@media (max-width: 420px) {
  .tool-hero { padding: 18px 20px 18px; }
  .crumbs { margin-bottom: 12px; }
  .tool-hero .lede { font-size: 0.98rem; }
  .bt-stage { width: min(240px, 66vw); }
  .bt-horizon { margin-top: 16px; }
  .bt-phase { margin-top: 14px; }
  .bt-controls { margin-top: 18px; }
  .breath-tool { padding: 24px 18px 22px; }
  .bt-custom-grid { grid-template-columns: repeat(2, 1fr); }
  .bt-length { flex-direction: column; gap: 8px; }
  .bt-length legend { float: none; line-height: 1.2; margin: 0 0 8px; }
  .bt-btn { padding: 15px 22px; }
  .bt-toggle { min-width: 130px; }
}

/* Reduced motion: the orb stays put and only its brightness changes. */
@media (prefers-reduced-motion: reduce) {
  .bt-orb { transform: none !important; inset: 22%; }
  .btn-primary, .bt-switch-track, .bt-switch-track::after { transition: none; }
}

/* ---------- Article content ---------- */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}
.content section { margin-bottom: 52px; }
.content h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}
.content h3 {
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 8px;
}
.content p, .content li {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-soft);
}
.content p + p { margin-top: 14px; }
.content ol, .content ul { padding-left: 22px; margin-top: 10px; }
.content li { margin-bottom: 8px; }
.content li::marker { color: var(--amber); }
.content a { text-underline-offset: 3px; }
.content strong { color: var(--text); font-weight: 600; }

.answer {
  font-size: 1.1rem !important;
  color: var(--text) !important;
  padding: 22px 24px;
  border-left: 2px solid var(--amber);
  background: rgba(242, 163, 65, 0.06);
  border-radius: 0 18px 18px 0;
}

.callout { padding: 22px 24px; }
.callout p { font-size: 0.98rem; }

.sources li { font-size: 0.92rem; color: var(--text-2); }

.faq-item { padding: 18px 0; border-top: 1px solid var(--divider); }
.faq-item:last-child { border-bottom: 1px solid var(--divider); }
.faq-item h3 { margin-top: 0; }
.faq-item p { font-size: 0.98rem; }

/* Soft DeRot section */
.derot-card {
  position: relative;
  overflow: hidden;
  padding: 34px 30px;
  text-align: center;
}
.derot-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 70% at 100% 0%, rgba(232, 105, 46, 0.26), rgba(232, 105, 46, 0) 70%);
}
.derot-card > * { position: relative; }
.derot-card .eyebrow {
  font-family: var(--serif);
  font-style: italic;
  color: var(--section-label);
  margin-bottom: 8px;
}
.derot-card h2 { margin-bottom: 10px; }
.derot-card p { margin: 0 auto 22px; max-width: 480px; }
.derot-card .small { font-size: 0.84rem; color: var(--text-2); margin: 14px 0 0; }

/* Tool cards (hub + "more tools") */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.tool-card {
  display: block;
  padding: 22px 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: rgba(242, 163, 65, 0.45); transform: translateY(-1px); }
.tool-card .pattern {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.7rem;
  color: var(--amber);
  margin-bottom: 8px;
  line-height: 1.1;
}
.tool-card h3 { font-size: 1.02rem; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.tool-card p { font-size: 0.9rem !important; color: var(--text-2) !important; line-height: 1.6 !important; }

.hub-grid { max-width: 860px; margin: 0 auto 64px; padding: 0 24px; }
.hub-grid .tool-card { padding: 26px 24px 28px; }

footer .footer-links a { display: inline-block; margin: 4px 10px; }
