/* ---------------------------------------------------------------
   Prayan's site.

   Almost every colour here comes from a variable that src/lib/theme.js
   sets when the page loads. That is how the theme picker in the editor
   repaints the whole site. The values below are only the starting point
   before the chosen theme is applied.
   --------------------------------------------------------------- */

:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --ink: #152033;
  --muted: #5a6b85;
  --accent: #2563eb;
  --accent2: #f97316;
  --accent-soft: #e8effd;
  --line: #dbe4f5;
  --shadow:
    0 2px 4px rgba(20, 30, 50, 0.05), 0 12px 28px rgba(20, 30, 50, 0.07);
  --radius: 20px;
  --round:
    ui-rounded, 'Segoe UI Variable Display', 'Trebuchet MS', system-ui,
    sans-serif;
  --sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--round);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

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

.wrap {
  width: min(1100px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.8rem 0;
}

.brand {
  font-family: var(--round);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

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

.nav a[aria-current='page'] {
  background: var(--accent);
  color: #fff;
}

.nav-emoji {
  font-size: 1rem;
}

/* ---------- page head ---------- */

.page-head {
  padding: 2.75rem 0 1.5rem;
}

.page-head p.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0;
}

main {
  padding-bottom: 5rem;
}

.section {
  padding-top: 2.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.section-head a {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- home ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 0 1rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 50ch;
}

.hero .tagline {
  display: inline-block;
  background: var(--accent2);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-photo {
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 1;
  border: 6px solid var(--surface);
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 1.5rem;
  }

  .hero-photo {
    max-width: 220px;
  }
}

/* big buttons to the other pages */

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

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.3rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-family: var(--round);
  font-size: 1.1rem;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.tile .emoji {
  font-size: 2rem;
}

.tile .count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- cards ---------- */

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

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-body {
  padding: 1.1rem 1.2rem 1.3rem;
}

.card-body h3 {
  margin-bottom: 0.2rem;
}

.card .label {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.card p {
  color: var(--muted);
  font-size: 0.96rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.when {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

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

.photo {
  position: relative;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg));
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.photo.is-missing::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.photo.is-missing img {
  display: none;
}

.photo.round {
  aspect-ratio: 1;
  border-radius: 50%;
}

/* ---------- lists with a date down the side ---------- */

.entries {
  display: grid;
  gap: 1.1rem;
}

.entry {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
}

.entry h3 {
  margin: 0.2rem 0 0.4rem;
}

.entry .photo {
  margin-top: 1rem;
  border-radius: 14px;
  max-width: 420px;
}

.entry .mood {
  font-size: 1.6rem;
  line-height: 1;
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chip-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.chip {
  background: var(--accent2);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.article {
  max-width: 68ch;
}

/* ---------- calendar ---------- */

.calendar-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.calendar-bar h2 {
  margin: 0;
  min-width: 12rem;
}

.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.day-name {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.3rem;
}

.day {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  min-height: 5.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}

.day.empty {
  background: none;
  border-color: transparent;
}

.day.today {
  border-color: var(--accent);
}

.day .num {
  font-weight: 700;
  color: var(--muted);
}

.day.today .num {
  color: var(--accent);
}

.event {
  display: block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event.school {
  background: #2563eb;
}
.event.sport {
  background: #15803d;
}
.event.olympiad {
  background: #7c3aed;
}
.event.family {
  background: #e11d48;
}

.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend span::before {
  content: '';
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  margin-right: 0.35rem;
}

.legend .school::before {
  background: #2563eb;
}
.legend .sport::before {
  background: #15803d;
}
.legend .olympiad::before {
  background: #7c3aed;
}
.legend .family::before {
  background: #e11d48;
}
.legend .other::before {
  background: var(--muted);
}

@media (max-width: 700px) {
  .day {
    min-height: 3.5rem;
    font-size: 0.75rem;
  }

  .event {
    font-size: 0.65rem;
  }
}

/* ---------- the lock screen ---------- */

.lock {
  max-width: 26rem;
  margin: 4rem auto;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.lock .big-lock {
  font-size: 3rem;
  line-height: 1;
}

.lock h2 {
  margin: 0.8rem 0 0.3rem;
}

.lock p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.3rem;
}

.lock input {
  font: inherit;
  width: 100%;
  text-align: center;
  padding: 0.7rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}

.lock input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.lock button {
  font: inherit;
  font-weight: 700;
  margin-top: 0.8rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.lock .hint {
  margin: 1rem 0 0;
  font-size: 0.85rem;
}

.lock .wrong {
  color: #b91c1c;
  font-weight: 600;
  margin-top: 0.8rem;
  min-height: 1.4em;
}

/* ---------- odds and ends ---------- */

.empty {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}

.empty code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-size: 0.9em;
}

.site-footer {
  border-top: 2px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a.edit-link {
  border: 2px solid var(--accent);
  color: var(--accent);
}

/* Arrow buttons on the calendar. */
.ghost {
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  border-radius: 12px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--accent);
}
