:root {
  --bg: #f6f3ee;
  --paper: #fffdf9;
  --ink: #172126;
  --muted: #5f6f78;
  --accent: #de5d14;
  --accent-dark: #a4410f;
  --line: #d8d2c8;
  --hero: linear-gradient(120deg, #1f2f35 0%, #223940 55%, #35644f 100%);
  --shadow: 0 10px 35px rgba(15, 22, 25, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, rgba(222, 93, 20, 0.16), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(53, 100, 79, 0.16), transparent 28%),
    var(--bg);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(246, 243, 238, 0.85);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
}

.nav a.active,
.nav a:hover {
  background: #e5e0d5;
}

.page-shell {
  padding: 2rem 0 4rem;
}

.hero {
  background: var(--hero);
  color: #f9f8f6;
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow);
}

.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe4b8;
  margin: 0;
}

.hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0.25rem 0 0.75rem;
  line-height: 1;
}

.hero p {
  margin: 0;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background: #fefbf6;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #b9b0a2;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-small {
  padding: 0.38rem 0.65rem;
  font-size: 0.86rem;
}

.notice {
  margin-top: 1rem;
  background: #e4f5e8;
  border: 1px solid #a1d5ad;
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.panel {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.panel h1,
.panel h2 {
  margin-top: 0;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.03em;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.form-help {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-row input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
}

.weekday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

input,
textarea,
select {
  font: inherit;
  border: 1px solid #c7bdaf;
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(222, 93, 20, 0.25);
  border-color: var(--accent);
}

.error-text {
  color: #a71d2f;
  margin: 0.5rem 0 0;
}

.error-box {
  background: #ffe9ed;
  border: 1px solid #e4a8b4;
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.9rem;
}

.error-box p {
  margin: 0.2rem 0;
}

.rides-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.ride-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ride-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.ride-body {
  padding: 0.9rem;
}

.ride-body h3 {
  margin: 0.4rem 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
}

.ride-body h3 a {
  text-decoration: none;
  color: var(--ink);
}

.ride-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ride-meta {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ride-meta span {
  background: #efeae0;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.84rem;
}

.empty-state {
  border: 1px dashed #b4a693;
  border-radius: 12px;
  padding: 1rem;
  background: #fbf7f0;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-panel {
  max-width: 620px;
}

.top-gap {
  margin-top: 1rem;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.link-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
}

.photo-grid figcaption {
  color: var(--muted);
  font-size: 0.85rem;
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.signup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.signup-list li {
  border: 1px solid #ddd2c4;
  border-radius: 10px;
  padding: 0.65rem;
}

.signup-list strong {
  display: block;
}

.signup-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
}

.nav-logout {
  margin: 0;
}

.monitor-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.monitor-list article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
}

.monitor-list h3 {
  margin: 0 0 0.35rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
}

.calendar-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.calendar-header h1 {
  margin: 0.2rem 0 0.55rem;
}

.calendar-header p {
  margin: 0;
}

.calendar-jump label {
  min-width: 180px;
}

.calendar-jump input[type='text'],
.calendar-jump input[type='month'],
.calendar-jump input[type='number'] {
  min-width: 150px;
}

.calendar-nav {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.calendar-nav h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-align: center;
}

.calendar-scroll {
  margin-top: 0.7rem;
  overflow-x: auto;
}

.calendar-grid {
  min-width: 760px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0;
}

.calendar-day {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.calendar-day.is-outside {
  opacity: 0.58;
  background: #f3ede2;
}

.calendar-day-number {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.calendar-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.calendar-event {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid #ddd2c4;
  border-radius: 9px;
  background: #fdf9f2;
  padding: 0.33rem 0.45rem;
}

.calendar-event:hover {
  border-color: #b9b0a2;
}

.calendar-event.is-closed {
  background: #f3ece3;
  border-style: dashed;
}

.calendar-event.is-continuation {
  border-left: 4px solid #35644f;
  padding-left: 0.4rem;
}

.calendar-event-time {
  font-size: 0.75rem;
  color: var(--muted);
}

.calendar-event-title {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
}

.calendar-event-distance {
  font-size: 0.72rem;
  color: var(--muted);
}

.calendar-empty,
.calendar-more {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 1.5rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .split,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    border-radius: 14px;
    padding: 1.3rem;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .nav {
    gap: 0.35rem;
    font-size: 0.9rem;
  }
}
