/* Fonts (SIL OFL), self-hosted latin subsets from Google Fonts */
@font-face { font-family: "DM Mono"; font-weight: 400; font-display: swap; src: url("/fonts/dm-mono.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 400 600; font-display: swap; src: url("/fonts/dm-sans.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url("/fonts/space-grotesk.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Brand (all mid-tones, used as fills/accents): */
  --paper: #bd9a7f;
  --green: #577b53;
  --blue: #5f87bb;
  --ochre: #bf8946;
  /* Sampled from the photos, for text and light surfaces: */
  --ink: #161c17;          /* shade, creekside-reclined */
  --paper-light: #eceeea;  /* sky, picnic-table-laptop */
  --muted: #4a4d3a;        /* bark, tree-based-computing */
  --link: #293e87;         /* jacket, tree-based-computing */
  --line: #8f8b75;         /* stone, picnic-table-laptop */

  --sans: "DM Sans", system-ui, sans-serif;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;

  /* Type scale: three sizes plus two headings */
  --text-sm: .8125rem;
  --text: 1rem;
  --text-lg: 1.125rem;
  --h2: clamp(1.75rem, 4vw, 2.5rem);
  --h1: clamp(2.5rem, 6vw, 4.25rem);

  --gutter: clamp(1.5rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: var(--text)/1.55 var(--sans);
}

button, input { font: inherit; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--text-lg); font-weight: 600; }

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

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  padding: .6rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header + city menu */

.site-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 2rem 0;
  font: 400 clamp(1.25rem, 2.5vw, 1.75rem) var(--mono);
  letter-spacing: -.03em;
}
.identity { color: var(--ink); text-decoration: none; }

.city-menu { position: relative; }
.city-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.city-menu summary::-webkit-details-marker { display: none; }
.city-name { text-decoration: underline 3px var(--blue); text-underline-offset: 6px; }
.city-menu[open] .caret { display: inline-block; transform: rotate(180deg); }

.city-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + .75rem);
  left: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 1.25rem;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 4px 4px 0 rgb(22 28 23 / .16);
  font: var(--text)/1.55 var(--sans);
  letter-spacing: normal;
}
.current-city {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.city-panel p:not(.current-city) { color: var(--muted); }
.current-city span { color: var(--green); }
::selection { background: var(--ochre); color: var(--ink); }

/* Weather */

.weather {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  font: var(--text) var(--mono);
  letter-spacing: normal;
  white-space: nowrap;
  cursor: default;
}
.weather:empty { display: none; }
.weather:not(:empty) { animation: fade-in .8s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.weather svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.weather-more {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--ink);
  transition: max-width .5s ease, opacity .3s ease;
}
.weather:hover .weather-more,
.weather:focus .weather-more { max-width: 20em; opacity: 1; }
.weather:focus { outline: none; }
.weather:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* A little life: rays turn, rain and snow fall. */
.weather .rays { transform-origin: 12px 12px; animation: turn 40s linear infinite; }
.weather .falling { animation: fall 1.6s linear infinite; }
.weather .falling:nth-child(odd) { animation-delay: -.8s; }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes fall {
  from { transform: translateY(-2px); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translateY(2px); opacity: 0; }
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 3fr 2fr;
  border: 1px solid var(--ink);
  background: var(--paper-light);
}
.hero-photo {
  width: 100%;
  height: 100%;
  min-height: 460px;
  display: block;
  object-fit: cover;
  border-right: 1px solid var(--ink);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  padding: var(--gutter);
}
.hero-copy h1 { color: var(--ink); }
.hero-copy p { font-size: var(--text-lg); color: var(--muted); }

/* Photos */

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 0;
}
.photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--ink);
  overflow: hidden;
}
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity 1.2s ease;
}
.photo img.entering { opacity: 0; }
.photo img[src$="creekside-reclined.webp"] { object-position: center 45%; }
.photo figcaption {
  position: absolute;
  z-index: 1;
  left: .5rem;
  bottom: .5rem;
  padding: .15rem .45rem;
  background: rgb(236 238 234 / .9);
  font: var(--text-sm) var(--mono);
}

/* Posts */

.section { padding: var(--gutter) 0; }
.posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.post {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.5rem;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  position: relative;
}
.post:hover { box-shadow: 3px 3px 0 var(--ochre); }
.post p { color: var(--muted); }
.post .post-source {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
  font: var(--text-sm) var(--mono);
}
.post time { white-space: nowrap; }
.post-domain { color: var(--link); }
.post-domain::after { content: " ↗"; }
.post h3 a { color: var(--ink); text-decoration: none; }
.post h3 a::after { content: ""; position: absolute; inset: 0; }
.post:hover h3 a { text-decoration: underline; }

/* Forms */

label { display: block; font: var(--text-sm) var(--mono); }
input {
  width: 100%;
  min-width: 0;
  padding: .7rem .8rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: white;
  color: var(--ink);
}
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form-message { min-height: 1.55em; font-size: var(--text-sm); }
.form-message:empty { min-height: 0; }

.stack-form { display: flex; flex-direction: column; gap: .5rem; }
.stack-form label { margin-top: .5rem; }
.stack-form .button { margin-top: .75rem; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--blue);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.button:hover { color: var(--ink); background: var(--ochre); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.button:disabled { cursor: default; opacity: .85; transform: none; }

/* Signup */

.signup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 4rem;
  align-items: center;
  padding: var(--gutter);
  border: 1px solid var(--ink);
  background: var(--blue);
  color: var(--ink);
}
.signup p { margin-top: .75rem; }
.signup label { margin-bottom: .4rem; }
.form-row { display: flex; }
.button-light {
  background: var(--ink);
  color: var(--paper-light);
  box-shadow: none;
}
.button-light:hover { background: var(--ochre); color: var(--ink); box-shadow: none; transform: none; }

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 0;
  color: var(--ink);
  font: var(--text-sm) var(--mono);
}
.site-footer a { color: inherit; }

@media (max-width: 800px) {
  .hero, .signup { grid-template-columns: 1fr; }
  .hero-photo { min-height: 0; aspect-ratio: 4 / 3; border-right: 0; border-bottom: 1px solid var(--ink); }
  .posts { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { position: relative; flex-wrap: wrap; padding: 1.25rem 0; }
  .weather { order: -1; width: 100%; justify-content: flex-end; margin-bottom: .25rem; }
  .city-menu { position: static; }
  .city-panel { top: calc(100% - .5rem); }
  .photos { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .photos .photo:last-child { display: none; }
  .form-row { flex-direction: column; gap: .5rem; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
