:root {
  --ink: #10231f;
  --ink-2: #4a615d;
  --teal: #0f5f63;
  --teal-dark: #0a4245;
  --teal-light: #e4f2f1;
  --amber: #e07b39;
  --amber-light: #fdf0e6;
  --paper: #ffffff;
  --bg: #f5f8f7;
  --line: #dbe6e4;
  --radius: 16px;
  --shadow: 0 2px 4px rgba(16, 35, 31, .04), 0 12px 28px rgba(16, 35, 31, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .6rem; }
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; }
a { color: var(--teal); }
img { max-width: 100%; }

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.center { text-align: center; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--teal);
  color: #fff; padding: .6rem 1rem; z-index: 20;
}
.skip:focus { left: .5rem; top: .5rem; }

/* header ---------------------------------------------------------------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.brand img { border-radius: 12px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -0.01em; }
.brand-text small { color: var(--ink-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; }

.site-nav { display: flex; align-items: center; gap: 1.3rem; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .96rem; }
.site-nav a:hover { color: var(--teal); }
.site-nav a.on { color: var(--teal); box-shadow: inset 0 -2px 0 var(--teal); }
.navbtn { display: none; }

@media (max-width: 760px) {
  .navbtn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 40px; cursor: pointer; padding: 0 8px;
  }
  .navbtn span { height: 2px; background: var(--ink); border-radius: 2px; display: block; }
  .site-nav {
    flex-basis: 100%; flex-direction: column; align-items: stretch;
    gap: .2rem; display: none; padding-bottom: .6rem;
  }
  .navtoggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
  .site-nav a.btn { text-align: center; margin-top: .5rem; border-bottom: 0; }
}

/* buttons --------------------------------------------------------------- */
.btn {
  display: inline-block; background: var(--teal); color: #fff;
  padding: .8rem 1.5rem; border-radius: 999px; text-decoration: none;
  font-weight: 600; border: 0; cursor: pointer; font-size: 1rem;
  font-family: inherit; transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--teal-dark); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .5rem 1.05rem; font-size: .92rem; }
.btn-amber { background: var(--amber); }
.btn-amber:hover { background: #c4682b; }
.btn-ghost { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.btn-ghost:hover { background: var(--teal-light); color: var(--teal-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

/* hero ------------------------------------------------------------------ */
.hero {
  background: linear-gradient(160deg, #0f5f63 0%, #0a4245 55%, #07373a 100%);
  color: #fff; padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.hero h1 { color: #fff; }
.hero p.lede { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: #cfe6e5; max-width: 46ch; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .16em;
  font-size: .74rem; font-weight: 700; color: #ffc48a; margin-bottom: 1rem;
}
.hero .btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 2.6rem; }
.hero-stats div strong { display: block; font-size: 1.5rem; }
.hero-stats div span { color: #a9cecd; font-size: .9rem; }

/* sections -------------------------------------------------------------- */
section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section-head { max-width: 58ch; margin-bottom: 2rem; }
.section-head p { color: var(--ink-2); margin-bottom: 0; }
.alt { background: var(--paper); border-block: 1px solid var(--line); }

.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35rem; }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--teal-light);
  color: var(--teal); display: grid; place-items: center; font-size: 1.25rem;
  margin-bottom: .9rem;
}

/* run cards ------------------------------------------------------------- */
.run { display: grid; gap: .5rem; position: relative; }
.run .pin {
  position: absolute; top: -.35rem; right: 0; background: var(--amber-light);
  color: #a3541f; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; padding: .2rem .6rem; border-radius: 999px;
}
.run h3 { margin: 0; padding-right: 5rem; }
.run-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin: .2rem 0 .4rem; }
.tag {
  background: var(--teal-light); color: var(--teal-dark); border-radius: 8px;
  padding: .22rem .6rem; font-size: .84rem; font-weight: 500;
}
.tag.time { background: var(--amber-light); color: #a3541f; }
.run p { margin: 0; color: var(--ink-2); }

/* guide ----------------------------------------------------------------- */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.6rem; scroll-margin-top: 5rem; }
.prose h3 { margin-top: 1.7rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.prose th { background: var(--teal-light); color: var(--teal-dark); }
.callout {
  background: var(--teal-light); border-left: 4px solid var(--teal);
  border-radius: 0 12px 12px 0; padding: 1.1rem 1.3rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { background: var(--amber-light); border-color: var(--amber); }
.toc {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; margin-bottom: 2rem;
}
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: .3rem; }

/* forms ----------------------------------------------------------------- */
.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: var(--paper); color: var(--ink);
}
textarea { min-height: 6.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal);
}
.radios { display: grid; gap: .5rem; }
.radios label, .check {
  display: flex; gap: .6rem; align-items: flex-start; font-weight: 400;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: .65rem .8rem; cursor: pointer;
}
.radios label:hover, .check:hover { border-color: var(--teal); }
.radios input, .check input { margin-top: .3rem; flex: none; }
.check { background: var(--teal-light); border-color: #bcdedd; }
.errors {
  background: #fdecec; border: 1px solid #f3bcbc; color: #8f2020;
  border-radius: 12px; padding: 1rem 1.2rem;
}
.errors ul { margin: .4rem 0 0; padding-left: 1.1rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: .5rem; }

/* timer ----------------------------------------------------------------- */
.timer-shell { display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: start; }
@media (max-width: 900px) { .timer-shell { grid-template-columns: 1fr; } }

.stage {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 2rem 1.5rem; text-align: center;
  transition: background .3s ease, color .3s ease;
}
.stage.run-phase { background: #0f5f63; border-color: #0f5f63; color: #fff; }
.stage.walk-phase { background: #e07b39; border-color: #e07b39; color: #fff; }
.stage.warm-phase { background: #3f5d78; border-color: #3f5d78; color: #fff; }
.stage.done-phase { background: #135e2f; border-color: #135e2f; color: #fff; }
.phase-name {
  text-transform: uppercase; letter-spacing: .2em; font-size: .85rem;
  font-weight: 700; opacity: .85;
}
.clock {
  font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1;
  font-size: clamp(4rem, 17vw, 7.5rem); margin: .4rem 0 .2rem;
}
.stage .sub { opacity: .85; margin: 0; }
.ring { width: 100%; height: 8px; border-radius: 999px; background: rgba(0,0,0,.12); overflow: hidden; margin: 1.4rem 0 .3rem; }
.stage.run-phase .ring, .stage.walk-phase .ring, .stage.warm-phase .ring, .stage.done-phase .ring { background: rgba(255,255,255,.25); }
.ring i { display: block; height: 100%; background: currentColor; width: 0; border-radius: 999px; transition: width .25s linear; }
.timer-controls { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }
.stage .btn { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.stage .btn:hover { background: rgba(255,255,255,.3); }
.stage.idle .btn.primary { background: var(--teal); box-shadow: none; color: #fff; }
.timer-totals { display: flex; justify-content: center; gap: 1.8rem; margin-top: 1.2rem; font-size: .92rem; opacity: .9; }
.timer-totals strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.preset {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: .45rem .9rem; font: inherit; font-size: .88rem; cursor: pointer;
}
.preset:hover { border-color: var(--teal); color: var(--teal); }
.preset.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.setting-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.15rem; }
.plan-preview { font-size: .9rem; color: var(--ink-2); background: var(--bg); border-radius: 10px; padding: .7rem .85rem; }

/* admin ----------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--paper); }
table.data th, table.data td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: var(--teal-light); color: var(--teal-dark); white-space: nowrap; }
.pill { display: inline-block; background: var(--teal-light); color: var(--teal-dark); border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; }
.inline-form { display: inline; }
.linkbtn { background: none; border: 0; color: var(--teal); font: inherit; cursor: pointer; padding: 0 .35rem; text-decoration: underline; }
.notice { background: var(--teal-light); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1.2rem; }

/* footer ---------------------------------------------------------------- */
.site-footer { background: #0a2b2c; color: #cfe0df; margin-top: 3rem; padding: 2.5rem 0 1.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.footer-inner p { margin: 0 0 .4rem; max-width: 42ch; }
.footer-brand { font-weight: 700; color: #fff; }
.site-footer .muted { color: #9dbcbb; }
.site-footer nav { display: grid; gap: .4rem; align-content: start; }
.social { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.social a {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem;
  font-weight: 600; padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
}
.social a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.social svg { flex: none; }
.social-light a { border-color: var(--line); color: var(--teal); background: var(--paper); }
.social-light a:hover { background: var(--teal-light); }
.site-footer a { color: #cfe0df; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-legal { margin-top: 2rem; border-top: 1px solid #16403f; padding-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
