@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --page: #f7f8f5;
  --heading: #163b2e;
  --text: #26332d;
  --muted: #5b6a62;
  --link: #2f7d5b;
  --line: #d9dfd9;
  --slot: #d6eadf;
  --booked: #163b2e;
  --measure: 66ch;
  color-scheme: light;
}

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

html {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 100%;
  background: var(--page);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--heading);
  color: var(--page);
  padding: 0.5rem 0.875rem;
}

.skip:focus {
  top: 1rem;
}

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

/* Header and footer */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--heading);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--heading);
  text-decoration: underline;
}

.site-foot {
  margin-top: 6rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-foot p {
  margin: 0.25rem 0;
}

/* Home: hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
  padding-block: 3.5rem 5rem;
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 760;
  font-variation-settings: "opsz" 96;
  color: var(--heading);
  max-width: 13ch;
}

.hero p {
  margin: 0 0 1rem;
  max-width: 40ch;
  font-size: 1.1875rem;
}

/* The week: Sunday to Saturday, the Israeli working week */

.week {
  margin: 0;
}

.week-grid {
  display: grid;
  grid-template-columns: 2.75rem repeat(7, minmax(0, 1fr));
  grid-auto-rows: 2.1rem;
  gap: 4px;
}

.week-grid .day {
  align-self: end;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--heading);
  text-align: center;
}

.week-grid .hour {
  font-size: 0.8125rem;
  color: var(--muted);
  align-self: center;
  font-variant-numeric: tabular-nums;
}

.week-grid .slot {
  background: var(--slot);
  border-radius: 3px;
}

.week-grid .booked {
  background: var(--booked);
}

.week-grid .closed {
  background: transparent;
  border: 1px dashed var(--line);
}

.week figcaption {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 44ch;
}

.legend {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  vertical-align: -0.05em;
  margin-inline: 0.15rem 0.3rem;
}

.legend.slot {
  background: var(--slot);
}

.legend.booked {
  background: var(--booked);
}

@media (prefers-reduced-motion: no-preference) {
  .week-grid .booked {
    animation: book 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--n, 0) * 90ms + 250ms);
  }

  .week-grid [data-n="0"] {
    --n: 0;
  }

  .week-grid [data-n="1"] {
    --n: 1;
  }

  .week-grid [data-n="2"] {
    --n: 2;
  }

  .week-grid [data-n="3"] {
    --n: 3;
  }

  .week-grid [data-n="4"] {
    --n: 4;
  }

  .week-grid [data-n="5"] {
    --n: 5;
  }

  .week-grid [data-n="6"] {
    --n: 6;
  }

  .week-grid [data-n="7"] {
    --n: 7;
  }

  @keyframes book {
    from {
      background: var(--slot);
    }
  }
}

/* Home: sections */

.section {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, var(--measure));
  gap: 1rem 3rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 680;
  color: var(--heading);
}

.section-body > :first-child {
  margin-top: 0;
}

.section-body p {
  margin: 0 0 1rem;
}

.project h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1875rem;
  font-weight: 680;
  color: var(--heading);
}

.project .status {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.contact-mail {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Long-form pages */

.doc {
  max-width: var(--measure);
  padding-block: 2.5rem 1rem;
}

.doc h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.125rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 740;
  font-variation-settings: "opsz" 72;
  color: var(--heading);
}

.doc .updated {
  margin: 0 0 2.5rem;
  color: var(--muted);
}

.doc h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 680;
  color: var(--heading);
  scroll-margin-top: 1.5rem;
}

.doc p,
.doc li {
  margin: 0 0 0.875rem;
}

.doc ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

/* Small screens */

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: 1.5rem 3rem;
  }

  .section {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-foot {
    margin-top: 3rem;
  }
}

@media (max-width: 26rem) {
  .week-grid {
    grid-template-columns: 2.25rem repeat(7, minmax(0, 1fr));
    grid-auto-rows: 1.75rem;
    gap: 3px;
  }

  .week-grid .day {
    font-size: 0.75rem;
  }
}
