/* Yoga timer - style.css - v1.2.6
   v1.2.6  2026-11-02  Moved out of index.html (Content-Security-Policy on keiserdesign.dk blocks inline CSS).
                       Fonts Jost and Karla are served from fonts/ instead of Google Fonts (SIL OFL 1.1, fonts/OFL-*.txt). */

/* ---------- fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/jost-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jost-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/jost-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/karla-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/karla-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/karla-latin-700-normal.woff2') format('woff2');
}

/* ---------- page reset (was the first <style> block in index.html) ---------- */
:root { color-scheme: light dark; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

/* ---------- timer ---------- */
  :root {
    --ground: #E8ECE6;
    --surface: #F4F6F2;
    --ink: #1D2925;
    --muted: #5C6B65;
    --line: #C9D2CB;
    --hold: #1F6F63;
    --rest: #8A4B6B;
    --on-accent: #FFFFFF;
    --font-display: "Jost", "Avenir Next", "Century Gothic", sans-serif;
    --font-body: "Karla", "Helvetica Neue", Arial, sans-serif;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --ground: #121815;
      --surface: #1A221E;
      --ink: #E3EAE5;
      --muted: #93A39B;
      --line: #2C3832;
      --hold: #5CC2AE;
      --rest: #D890B4;
      --on-accent: #0F1512;
    }
  }
  :root[data-theme="dark"] {
    --ground: #121815;
    --surface: #1A221E;
    --ink: #E3EAE5;
    --muted: #93A39B;
    --line: #2C3832;
    --hold: #5CC2AE;
    --rest: #D890B4;
    --on-accent: #0F1512;
  }

  html, body { height: 100%; }
  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    padding-inline: 16px;
    box-sizing: border-box;
  }
  *, *::before, *::after { box-sizing: inherit; }

  .app {
    --phase: var(--hold);
    min-height: 100%;
    max-width: 480px;
    margin-inline: auto;
    padding-block: 20px 28px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 22px;
  }
  .app[data-phase="rest"] { --phase: var(--rest); }

  /* ---------- Dial ---------- */
  .dial {
    position: relative;
    width: min(100%, 340px);
    aspect-ratio: 1;
    margin-inline: auto;
  }
  .dial svg { width: 100%; height: 100%; display: block; }
  .ring-track { fill: none; stroke: var(--line); stroke-width: 3.5; }
  .ring-arc {
    fill: none;
    stroke: var(--phase);
    stroke-width: 3.5;
    stroke-linecap: butt;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transform: rotate(-90deg);
    transform-origin: 50px 50px;
    transition: stroke 0.4s ease;
  }
  .mark { stroke: var(--muted); stroke-width: 0.9; fill: none; }
  .readout {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
  }
  .phase-label {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--phase);
    transition: color 0.4s ease;
  }
  .time {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(4.2rem, 24vw, 6.6rem);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
  }
  .round {
    font-size: 0.95rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  /* ---------- Buttons ---------- */
  .actions { display: flex; gap: 12px; }
  .btn {
    flex: 1 1 0;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    padding: 15px 18px;
    border-radius: 999px;
    border: 2px solid var(--phase);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.2s ease;
  }
  .btn-primary { background: var(--phase); color: var(--on-accent); }
  .btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
  .btn:disabled { opacity: 0.4; cursor: default; }
  .btn:focus-visible, .step:focus-visible, input:focus-visible {
    outline: 3px solid var(--phase);
    outline-offset: 2px;
  }

  /* ---------- Settings ---------- */
  .settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
  }
  .field {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }
  .field-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .dot-hold { background: var(--hold); }
  .dot-rest { background: var(--rest); }
  .stepper { display: flex; align-items: center; gap: 6px; }
  .step {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--ground);
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
  }
  .step:disabled, .stepper input:disabled { opacity: 0.45; cursor: default; }
  .stepper input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 2px 0;
    -moz-appearance: textfield;
    appearance: textfield;
  }
  .stepper input::-webkit-outer-spin-button,
  .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .unit { font-size: 0.85rem; color: var(--muted); text-align: center; }

  .sound {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    font-size: 0.95rem;
    color: var(--muted);
  }
  .sound label { display: flex; align-items: center; gap: 8px; }
  .sound input[type="range"] { width: 120px; accent-color: var(--phase); }
  .sound select {
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
  }
  .sound select:focus-visible { outline: 3px solid var(--phase); outline-offset: 2px; }
  .sound input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--phase); }
  .link-btn {
    background: none;
    border: 0;
    padding: 4px 0;
    color: var(--ink);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
  .hint { font-size: 0.85rem; color: var(--muted); margin: 0; }
  /* v1.2.3: download link for the Android app */
  .get-app { margin: 0; text-align: center; font-size: 0.95rem; }
  .get-app a, .get-app button {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
  }
  .get-app button { font: inherit; font-weight: 500; background: transparent; cursor: pointer; }   /* v1.2.4 */
  .get-app a:focus-visible, .get-app button:focus-visible { outline: 3px solid var(--phase); outline-offset: 2px; }
  /* v1.2.4: the steps shown by the "Install on iPhone or iPad" button */
  .ios-steps {
    margin: 0;
    padding: 12px 14px 12px 34px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .app:not([data-state="idle"]) .ios-steps { visibility: hidden; }
  .app:not([data-state="idle"]) .get-app { visibility: hidden; }   /* no distraction (and no layout jump) while running */

  @media (max-width: 360px) {
    .settings { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ring-arc, .phase-label, .btn { transition: none; }
  }
