/* ── Reset & base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:       #ffffff;
  --surface:  #f5f5f5;
  --border:   #e0e0e0;
  --text:     #222222;
  --muted:    #888888;
  --accent:   #e63946;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --radius:   8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Home (linktree) layout ─────────────────────────────── */
body.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.profile {
  text-align: center;
  margin-bottom: 2.5rem;
}

.profile h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  max-width: 400px;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}

.link-icon {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.link-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

/* ── Recipes header ─────────────────────────────────────── */
header {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.5rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

header h1 span {
  color: var(--accent);
}

#search {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#search::placeholder {
  color: var(--muted);
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
}

/* ── Recipes main / card grid ───────────────────────────── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

#card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  font-size: 1rem;
}

/* ── Recipe cards ───────────────────────────────────────── */
.card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem 1rem;
  min-height: 100px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  font-family: var(--font);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  outline: none;
}

.card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

/* ── Modal overlay ──────────────────────────────────────── */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

#modal[hidden] {
  display: none;
}

#modal-content {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 90vw;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#close-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#close-btn:hover {
  background: rgba(0,0,0,0.15);
}

#pdf-frame {
  width: 100%;
  flex: 1;
  border: none;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  #card-grid {
    grid-template-columns: 1fr;
  }

  #modal-content {
    width: 100%;
    height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  #modal {
    align-items: flex-end;
    padding: 0;
  }
}

/* -- Date Me ------------------------------------------------ */
body.date-me {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(145, 70, 255, 0.16), transparent 32rem),
    linear-gradient(135deg, #ffffff 0%, #f7f7fb 48%, #fff1f3 100%);
}

.date-me-shell {
  width: 100%;
  max-width: 720px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.date-card {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(25, 25, 35, 0.12);
  padding: 2.25rem;
}

.date-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.date-back:hover,
.date-back:focus-visible {
  transform: translateY(-1px);
  border-color: #9146ff;
  box-shadow: var(--shadow-sm);
  outline: none;
}

.date-card h1 {
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
  margin-bottom: 1rem;
}

.date-copy {
  max-width: 32rem;
  color: #5d6470;
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 1.75rem;
}

.twitch-form {
  display: grid;
  gap: 0.75rem;
}

.twitch-form label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.username-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 3.25rem;
  padding: 0 1rem;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.username-field:focus-within {
  border-color: #9146ff;
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.14);
}

.username-field span {
  color: #9146ff;
  font-weight: 800;
}

.username-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  background: transparent;
}

.date-submit {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.25rem;
  color: #ffffff;
  background: #222222;
  border: 1.5px solid #222222;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.date-submit:hover,
.date-submit:focus-visible {
  transform: translateY(-2px);
  background: #111111;
  box-shadow: var(--shadow-md);
  outline: none;
}

.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 14, 18, 0.62);
}

.booking-modal[hidden] {
  display: none;
}

.booking-panel {
  position: relative;
  width: min(94vw, 760px);
  max-height: 92vh;
  overflow: auto;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  padding: 1.25rem;
}

.booking-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.booking-close:hover,
.booking-close:focus-visible {
  border-color: #9146ff;
  outline: none;
}

.booking-header {
  padding: 0.5rem 3rem 1rem 0.25rem;
}

.booking-header h2 {
  font-size: 1.8rem;
  letter-spacing: 0;
  margin-bottom: 0.45rem;
}

.booking-for {
  color: #5d6470;
  line-height: 1.45;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 2.25rem 1fr 2.25rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f7f7fb;
  border: 1.5px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.calendar-toolbar strong {
  text-align: center;
  font-size: 1rem;
}

.calendar-toolbar button {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--muted);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, opacity 0.15s;
}

.calendar-toolbar button:hover:not(:disabled),
.calendar-toolbar button:focus-visible {
  color: #9146ff;
  border-color: #9146ff;
  outline: none;
}

.calendar-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-right: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
}

.weekday,
.calendar-day {
  min-width: 0;
  border-top: 1.5px solid var(--border);
  border-left: 1.5px solid var(--border);
}

.weekday {
  padding: 0.65rem 0.35rem;
  color: #5d6470;
  background: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 4.8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.55rem;
  color: #9f1239;
  background: repeating-linear-gradient(
    135deg,
    #fff5f5,
    #fff5f5 8px,
    #ffe4e6 8px,
    #ffe4e6 16px
  );
  border-right: 0;
  border-bottom: 0;
  font-family: var(--font);
  cursor: not-allowed;
  opacity: 1;
}

.calendar-day span {
  color: #222222;
  font-weight: 800;
}

.calendar-day small {
  width: 100%;
  color: #9f1239;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.calendar-day-available {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
  cursor: pointer;
}

.calendar-day-available:hover,
.calendar-day-available:focus-visible {
  box-shadow: inset 0 0 0 2px #22c55e;
  outline: none;
}

.calendar-day-available small {
  color: #166534;
}

.calendar-day-empty {
  background: #fafafa;
}

.waitlist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.25rem 0.25rem;
}

.waitlist-row[hidden] {
  display: none;
}

.waitlist-row p {
  color: #5d6470;
  line-height: 1.45;
}

.waitlist-row button {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0 1rem;
  color: #ffffff;
  background: #222222;
  border: 1.5px solid #222222;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.waitlist-row button:hover,
.waitlist-row button:focus-visible {
  transform: translateY(-1px);
  background: #111111;
  box-shadow: var(--shadow-sm);
  outline: none;
}

.waitlist-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(12, 14, 18, 0.28);
}

.waitlist-modal[hidden] {
  display: none;
}

.waitlist-panel {
  position: relative;
  width: min(92vw, 440px);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  padding: 2rem;
}

.waitlist-panel h2 {
  max-width: 21rem;
  font-size: 1.55rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.waitlist-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.waitlist-close:hover,
.waitlist-close:focus-visible {
  border-color: #9146ff;
  outline: none;
}

@media (max-width: 620px) {
  .date-me-shell {
    align-items: stretch;
    padding: 1rem;
  }

  .date-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 2rem);
    padding: 1.5rem;
  }

  .booking-panel {
    padding: 1rem;
  }

  .waitlist-row {
    flex-direction: column;
    align-items: stretch;
  }

  .booking-header {
    padding-right: 3rem;
  }

  .calendar-day {
    min-height: 3.8rem;
    padding: 0.35rem;
  }

  .calendar-day small {
    font-size: 0.58rem;
    text-align: left;
  }
}
