/* ==========================================================================
   FitMe — design system
   A quiet, paper-and-ink wellness journal. Warm cream surfaces, forest green
   for trust, clay for encouragement and calls to action. No SaaS-blue, no
   gradients-on-white, no gamification.
   ========================================================================== */

:root {
  --paper: #f6f1e6;
  --paper-alt: #eee5d3;
  --card: #fffdf8;
  --ink: #2a2820;
  --ink-soft: #6b6656;
  --ink-faint: #a49c86;
  --forest: #2f5d50;
  --forest-dark: #1e3f36;
  --forest-tint: #e2ebe3;
  --clay: #c1653c;
  --clay-dark: #a04f2c;
  --clay-tint: #f4e2d6;
  --line: rgba(42, 40, 32, 0.12);
  --line-soft: rgba(42, 40, 32, 0.07);
  --shadow-sm: 0 2px 8px rgba(42, 40, 32, 0.06);
  --shadow-md: 0 10px 28px rgba(42, 40, 32, 0.10);
  --shadow-lg: 0 20px 48px rgba(42, 40, 32, 0.16);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, "Segoe UI", sans-serif;
  --focus-ring: 0 0 0 3px rgba(47, 93, 80, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1b16;
    --paper-alt: #24221b;
    --card: #262419;
    --ink: #ede7d8;
    --ink-soft: #b6ae98;
    --ink-faint: #746c58;
    --forest: #6ea391;
    --forest-dark: #487b6a;
    --forest-tint: #24322c;
    --clay: #e08658;
    --clay-dark: #c1653c;
    --clay-tint: #3a2a20;
    --line: rgba(237, 231, 216, 0.12);
    --line-soft: rgba(237, 231, 216, 0.07);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
    --focus-ring: 0 0 0 3px rgba(110, 163, 145, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 70% 50% at 12% -10%, var(--forest-tint) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 0%, var(--clay-tint) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.4em;
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

a {
  color: var(--forest);
}

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

/* ---------- layout shell ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* No backdrop-filter here at mobile sizes: it would become the containing
     block for the position:fixed bottom tab bar. Restored on wide screens. */
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--forest);
  text-decoration: none;
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.wordmark__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
  transform: translateY(-2px);
}

/* Mobile-first: primary nav is a fixed, thumb-reachable bottom tab bar.
   On wider screens (min-width: 720px below) it moves into the header. */
.main-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

.main-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav a svg {
  width: 22px;
  height: 22px;
}

.main-nav a.active {
  color: var(--forest);
}

/* Keep content and footer clear of the bottom tab bar. */
body:has(.main-nav) .app-shell {
  padding-bottom: calc(66px + env(safe-area-inset-bottom));
}

.logout-form {
  margin: 0;
}

.btn-logout {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-faint);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-logout:hover {
  color: var(--clay-dark);
  border-color: var(--clay);
}

.site-main {
  flex: 1;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.page-head {
  margin-bottom: 28px;
  animation: rise 0.5s ease both;
}

.page-head .eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-dark);
  margin-bottom: 6px;
  display: block;
}

.page-head h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.page-head p {
  max-width: 46em;
}

.site-footer {
  text-align: center;
  padding: 28px 24px 40px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- cards & surfaces ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.card + .card {
  margin-top: 20px;
}

/* ---------- buttons ---------- */

.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

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

.btn-primary {
  background: var(--forest);
  color: #fdfaf2;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--forest-dark);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--clay);
  color: #fff8f0;
  box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
  background: var(--clay-dark);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 8px 10px;
}

.btn-danger:hover {
  color: var(--clay-dark);
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- forms ---------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: var(--focus-ring);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--clay);
}

.checkbox-field label {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
}

.pin-input {
  letter-spacing: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  text-align: center;
}

/* ---------- alerts ---------- */

.alert {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--clay-tint);
  border-color: color-mix(in srgb, var(--clay) 40%, transparent);
  color: var(--clay-dark);
}

.alert-success {
  background: var(--forest-tint);
  border-color: color-mix(in srgb, var(--forest) 35%, transparent);
  color: var(--forest-dark);
}

/* ---------- login ---------- */

.auth-wrap {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  animation: rise 0.6s ease both;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand .wordmark {
  justify-content: center;
  font-size: 2rem;
}

.auth-brand p {
  margin-top: 8px;
  font-size: 0.92rem;
}

/* ---------- dashboard ---------- */

.hero-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(155deg, var(--forest) 0%, var(--forest-dark) 100%);
  border-radius: var(--radius-lg);
  color: #fbf7ec;
  box-shadow: var(--shadow-md);
  animation: rise 0.55s ease both;
}

.hero-stat__figure {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 600;
  line-height: 1;
}

.hero-stat__figure span {
  font-size: 0.4em;
  font-weight: 500;
  opacity: 0.75;
  margin-left: 6px;
}

.hero-stat__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin-bottom: 6px;
}

.hero-stat__aside {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.hero-stat__aside div {
  text-align: right;
}

.hero-stat__aside strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.progress-track {
  margin-top: 22px;
  height: 8px;
  border-radius: 999px;
  background: rgba(251, 247, 236, 0.18);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--clay);
  width: 0;
  animation: fill-bar 1s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  animation: rise 0.55s ease both;
}

.stat-tile .label {
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.stat-tile .value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
}

.trend-card {
  margin-top: 24px;
  animation: rise 0.55s 0.1s ease both;
}

.trend-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trend-card__head h2 {
  font-size: 1.1rem;
  margin: 0;
}

.trend-card__range {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.trend-wrap {
  position: relative;
}

/* The svg is stretched (preserveAspectRatio="none") to give the chart a
   sensible height at any width; strokes use vector-effect and all text is
   HTML overlay, so nothing scales oddly. */
.trend-svg {
  display: block;
  width: 100%;
  height: clamp(150px, 42vw, 200px);
}

.trend-grid {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.trend-goal {
  stroke: var(--clay);
  stroke-width: 1;
  opacity: 0.7;
}

.trend-area {
  fill: var(--forest);
  opacity: 0.1;
}

.trend-line {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-label {
  position: absolute;
  font-size: 0.68rem;
  color: var(--ink-faint);
  pointer-events: none;
  line-height: 1;
}

.trend-label--tick {
  transform: translate(-100%, -50%);
}

.trend-label--goal {
  transform: translateY(calc(-100% - 4px));
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay-dark);
}

.trend-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--forest);
  border: 2px solid var(--card);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.trend-dates {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.trend-cursor {
  position: absolute;
  top: 0;
  width: 1px;
  background: var(--ink-faint);
  opacity: 0.5;
  pointer-events: none;
}

.trend-tip {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}

.quick-links {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.empty-note {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink-soft);
}

/* ---------- measurements ---------- */

.entry-form-card {
  margin-bottom: 28px;
}

/* Mobile-first: each entry renders as a card; the real table returns on
   wider screens (min-width: 720px below). */
table.log {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.log thead {
  display: none;
}

table.log tbody {
  display: grid;
  gap: 14px;
}

table.log tbody tr {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

table.log td {
  display: block;
  padding: 0;
  text-align: left;
}

table.log td::before {
  content: attr(data-label);
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

table.log td.date-cell {
  grid-column: 1 / -1;
  padding-right: 72px; /* keep clear of the absolute delete button */
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--forest-dark);
}

table.log td.date-cell::before,
table.log td.action-cell::before {
  display: none;
}

table.log td.notes-cell {
  grid-column: 1 / -1;
  white-space: normal;
  color: var(--ink-soft);
}

table.log td.is-empty {
  display: none;
}

table.log td.action-cell {
  position: absolute;
  top: 10px;
  right: 10px;
}

@media (min-width: 720px) {
  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--card);
  }

  table.log {
    white-space: nowrap;
  }

  table.log thead {
    display: table-header-group;
  }

  table.log tbody {
    display: table-row-group;
  }

  table.log tbody tr {
    position: static;
    display: table-row;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: background-color 0.15s ease;
  }

  table.log tbody tr:hover {
    background: var(--paper-alt);
  }

  table.log th,
  table.log td {
    display: table-cell;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  table.log th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    font-weight: 600;
  }

  table.log tr:last-child td {
    border-bottom: none;
  }

  table.log td::before {
    display: none;
  }

  table.log td.date-cell {
    font-size: inherit;
    padding-right: 16px;
  }

  table.log td.notes-cell {
    max-width: 220px;
  }

  table.log td.is-empty {
    display: table-cell;
  }

  table.log td.action-cell {
    position: static;
  }
}

/* ---------- photos ---------- */

.pin-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--paper-alt);
  margin-bottom: 24px;
}

.pin-bar form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pin-bar input.pin-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
}

.pin-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.pin-status svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pin-status.unlocked {
  color: var(--forest-dark);
}

.upload-card {
  margin-bottom: 28px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.photo-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  animation: rise 0.4s ease both;
}

.photo-tile__link {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-tile__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 10px 8px;
  background: linear-gradient(to top, rgba(20, 18, 12, 0.72), transparent);
  color: #fdfaf2;
  font-size: 0.72rem;
  transition: opacity 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px;
}

/* Touch screens have no hover — keep captions and delete always visible
   there; only hide-until-hover on devices that can actually hover. */
@media (hover: hover) {
  .photo-tile__meta {
    opacity: 0;
  }

  .photo-tile:hover .photo-tile__meta,
  .photo-tile:focus-within .photo-tile__meta {
    opacity: 1;
  }
}

.photo-tile__meta form {
  margin: 0;
}

.photo-tile__meta .btn-danger {
  color: #fdfaf2;
  opacity: 0.85;
  padding: 2px 4px;
}

.photo-tile__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(20, 18, 12, 0.55);
  color: #fdfaf2;
  border-radius: 999px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-tile__badge svg {
  width: 12px;
  height: 12px;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(20, 18, 12, 0.88);
  backdrop-filter: blur(6px);
  animation: fade-in 0.15s ease both;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox__caption {
  color: #fdfaf2;
  font-size: 0.9rem;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 14px;
  background: none;
  border: none;
  color: #fdfaf2;
  font-size: 2.2rem;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
}

body.no-scroll {
  overflow: hidden;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- utility animations ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fill-bar {
  from {
    width: 0;
  }
  to {
    width: var(--fill, 0%);
  }
}

.stagger > * {
  animation: rise 0.5s ease both;
}

.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }

/* ---------- 404 ---------- */

.not-found {
  text-align: center;
  padding: 80px 20px;
}

.not-found .glyph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 5rem;
  color: var(--forest);
  opacity: 0.35;
}

/* ---------- responsive: wide screens ----------
   Mobile is the base; this block scales the layout up. */

@media (min-width: 720px) {
  .site-header {
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(10px);
  }

  .site-header__inner {
    padding: 16px 24px;
  }

  /* Nav returns to the header as a text row. */
  .main-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    backdrop-filter: none;
    border-top: 0;
    padding: 0;
  }

  .main-nav a {
    flex-direction: row;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-soft);
    padding: 8px 12px;
  }

  .main-nav a svg {
    display: none;
  }

  .main-nav a:hover {
    background: var(--line-soft);
    color: var(--ink);
  }

  .main-nav a.active {
    color: var(--forest);
    background: var(--forest-tint);
  }

  body:has(.main-nav) .app-shell {
    padding-bottom: 0;
  }

  .site-main {
    padding: 40px 24px 80px;
  }

  .card {
    padding: 28px;
  }

  .hero-stat {
    gap: 28px;
    padding: 32px;
  }

  .hero-stat__aside {
    width: auto;
    margin-left: auto;
    justify-content: flex-start;
  }

  .pin-bar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .pin-bar input.pin-input {
    flex: none;
    width: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
