/* ==========================================================================
   Workout Notes: base layer
   Design tokens, reset, typography, shared components (header, footer,
   buttons, cards, phone frames). Loaded by every page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #08090c;
  --bg-1: #0b0c11;
  --bg-2: #11131a;
  --bg-3: #171a23;
  --bg-inset: rgba(255, 255, 255, 0.025);

  /* text */
  --fg: #f5f6f8;
  --fg-2: #a9b0bd;
  --fg-3: #7d8695;
  --fg-4: #59616e;

  /* lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.22);

  /* brand */
  --accent: oklch(0.76 0.11 205);
  --accent-soft: oklch(0.76 0.11 205 / 0.16);
  --accent-line: oklch(0.76 0.11 205 / 0.34);
  --accent-glow: oklch(0.76 0.11 205 / 0.28);
  --accent-ink: #04202a;

  --amber: oklch(0.82 0.14 78);
  --amber-soft: oklch(0.82 0.14 78 / 0.14);
  --green: oklch(0.79 0.16 155);
  --green-soft: oklch(0.79 0.16 155 / 0.14);
  --violet: oklch(0.75 0.14 295);
  --violet-soft: oklch(0.75 0.14 295 / 0.14);
  --rose: oklch(0.72 0.16 20);
  --rose-soft: oklch(0.72 0.16 20 / 0.14);

  /* type */
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo,
    monospace;

  /* metrics */
  --container: 1200px;
  --container-wide: 1320px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --header-h: 60px;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 80px -32px rgba(0, 0, 0, 0.75),
    0 12px 28px -14px rgba(0, 0, 0, 0.5);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #fbfbfd;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #f2f3f7;
  --bg-inset: rgba(9, 12, 20, 0.03);

  --fg: #14161c;
  --fg-2: #4d5563;
  --fg-3: #6b7280;
  --fg-4: #8b929d;

  --line: rgba(9, 12, 20, 0.1);
  --line-2: rgba(9, 12, 20, 0.16);
  --line-3: rgba(9, 12, 20, 0.26);

  --accent: oklch(0.56 0.1 214);
  --accent-soft: oklch(0.56 0.1 214 / 0.1);
  --accent-line: oklch(0.56 0.1 214 / 0.3);
  --accent-glow: oklch(0.56 0.1 214 / 0.16);
  --accent-ink: #ffffff;

  --amber: oklch(0.62 0.14 68);
  --amber-soft: oklch(0.62 0.14 68 / 0.12);
  --green: oklch(0.56 0.14 155);
  --green-soft: oklch(0.56 0.14 155 / 0.12);
  --violet: oklch(0.55 0.16 295);
  --violet-soft: oklch(0.55 0.16 295 / 0.12);
  --rose: oklch(0.58 0.18 22);
  --rose-soft: oklch(0.58 0.18 22 / 0.12);

  --shadow-sm: 0 1px 2px rgba(9, 12, 20, 0.06);
  --shadow: 0 12px 30px -14px rgba(9, 12, 20, 0.18);
  --shadow-lg: 0 40px 80px -34px rgba(9, 12, 20, 0.26),
    0 12px 28px -16px rgba(9, 12, 20, 0.14);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   3. Helpers
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container-wide {
  max-width: var(--container-wide);
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.18s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.eyebrow--plain::before {
  display: none;
}

.lead {
  font-size: 1.0625rem;
  color: var(--fg-2);
  line-height: 1.7;
}

.muted {
  color: var(--fg-2);
}

.dim {
  color: var(--fg-3);
}

.text-accent {
  color: var(--accent);
}

.center {
  text-align: center;
}

.divider {
  border-top: 1px solid var(--line);
}

/* gradient headline word */
.grad {
  background: linear-gradient(
    180deg,
    var(--fg) 0%,
    var(--fg) 42%,
    var(--fg-3) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grad-accent {
  background: linear-gradient(100deg, var(--accent) 0%, var(--violet) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-h: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding-inline: 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 8px 24px -10px var(--accent-glow);
}

.btn--primary:hover {
  box-shadow: 0 14px 32px -12px var(--accent-glow);
}

.btn--light {
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
}

.btn--outline {
  border-color: var(--line-2);
  background: var(--bg-inset);
  color: var(--fg);
}

.btn--outline:hover {
  border-color: var(--line-3);
  background: var(--bg-2);
}

.btn--ghost {
  color: var(--fg-2);
}

.btn--ghost:hover {
  color: var(--fg);
  background: var(--bg-inset);
}

.btn--lg {
  --btn-h: 50px;
  padding-inline: 24px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn--sm {
  --btn-h: 34px;
  padding-inline: 13px;
  font-size: 0.8125rem;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--fg-2);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.icon-btn:hover {
  color: var(--fg);
  border-color: var(--line-2);
  background: var(--bg-inset);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* theme toggle shows the theme you would switch to */
.icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

html[data-theme="light"] .icon-moon {
  display: block;
}

/* text link with arrow */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
}

.arrow-link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s var(--ease);
}

.arrow-link:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   5. Surfaces
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  background-image: linear-gradient(rgba(255, 255, 255, 0.03), transparent 60%);
  transition: border-color 0.2s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

html[data-theme="light"] .card {
  background-image: none;
  box-shadow: var(--shadow-sm);
}

.card--hover:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card__body {
  padding: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.panel__body {
  padding: 16px;
}

/* badges / pills / chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding-inline: 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.badge--accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-2);
  white-space: nowrap;
}

.pill--accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.pill--amber {
  border-color: transparent;
  background: var(--amber-soft);
  color: var(--amber);
}

.pill--green {
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green);
}

.pill--violet {
  border-color: transparent;
  background: var(--violet-soft);
  color: var(--violet);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

/* feature icon tile */
.itile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--accent);
  flex: none;
}

.itile svg {
  width: 19px;
  height: 19px;
}

.itile--accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.itile--amber {
  border-color: transparent;
  background: var(--amber-soft);
  color: var(--amber);
}
.itile--green {
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green);
}
.itile--violet {
  border-color: transparent;
  background: var(--violet-soft);
  color: var(--violet);
}
.itile--rose {
  border-color: transparent;
  background: var(--rose-soft);
  color: var(--rose);
}
.itile--lg {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}
.itile--lg svg {
  width: 22px;
  height: 22px;
}

/* checklist */
.checks {
  display: grid;
  gap: 11px;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: var(--fg-2);
  line-height: 1.55;
}

.checks li::before {
  content: "";
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 3px;
  border-radius: 6px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft) no-repeat center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358c4dc' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 13l4 4L19 7'/></svg>");
  background-size: 12px;
}

.checks li strong {
  color: var(--fg);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. Phone frame
   -------------------------------------------------------------------------- */

.phone {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  padding: 9px;
  border-radius: 40px;
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, #23262e, #0a0b0e 45%, #16181d);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone::after {
  /* notch */
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  z-index: 2;
  pointer-events: none;
}

.phone__screen {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 32px;
  background: #0a0b0e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.phone__screen img {
  width: 100%;
  border-radius: inherit;
}

.phone--sm {
  max-width: 230px;
  padding: 7px;
  border-radius: 32px;
}

.phone--sm .phone__screen {
  border-radius: 26px;
}

.phone--sm::after {
  top: 14px;
  width: 44px;
  height: 4px;
}

.phone--flat {
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* floating label attached to a screenshot */
.tag {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg-1) 82%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  white-space: nowrap;
}

.tag .dot {
  color: var(--accent);
}

@media (max-width: 640px) {
  .tag {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   7. Site header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: none;
}

.brand img {
  width: 27px;
  height: 27px;
  border-radius: 8px;
}

.brand span {
  font-size: 0.9375rem;
}

.brand__sub {
  padding-left: 9px;
  margin-left: 3px;
  border-left: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--fg-2);
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.site-nav a:hover {
  color: var(--fg);
  background: var(--bg-inset);
}

.site-nav a.is-active {
  color: var(--fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding-inline: 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-2);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.gh-link:hover {
  color: var(--fg);
  border-color: var(--line-2);
}

.gh-link svg {
  width: 16px;
  height: 16px;
}

/* mobile drawer */
.nav-toggle {
  display: none;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav ul {
  display: grid;
  gap: 2px;
  padding: 12px 0 18px;
}

.mobile-nav a {
  display: block;
  padding: 10px 4px;
  font-size: 0.9375rem;
  color: var(--fg-2);
}

.mobile-nav a:hover {
  color: var(--fg);
}

.mobile-nav .btn {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .header-actions {
    margin-left: auto;
  }
  .brand__sub {
    display: none;
  }
}

/* very narrow: keep only brand, theme switch and the menu control */
@media (max-width: 620px) {
  .header-actions .gh-link,
  .header-actions > .btn {
    display: none;
  }
  .site-header__inner {
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 0;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding: 56px 0 40px;
}

.site-footer h3 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.site-footer ul {
  display: grid;
  gap: 9px;
}

.site-footer li a {
  font-size: 0.875rem;
  color: var(--fg-2);
  transition: color 0.16s var(--ease);
}

.site-footer li a:hover {
  color: var(--accent);
}

.site-footer__about p {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 0.875rem;
  color: var(--fg-3);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--fg-3);
}

.site-footer__bottom a {
  color: var(--fg-2);
}

.site-footer__bottom a:hover {
  color: var(--accent);
}

@media (max-width: 860px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .site-footer__about {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------------------
   9. Motion
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

/* --------------------------------------------------------------------------
   10. Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .container {
    padding-inline: 18px;
  }
  .btn--lg {
    --btn-h: 46px;
    padding-inline: 18px;
  }
}
