/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; }
html:focus-within { scroll-behavior: smooth; }
body { min-height: 100vh; text-rendering: optimizeSpeed; line-height: 1.5; }
a:not([class]) { text-decoration-skip-ink: auto; }
img, picture { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Fonts */
@font-face {
  font-family: Atkinson-Hyperlegible;
  src: url(/fonts/atkinson-regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: Atkinson-Hyperlegible;
  src: url(/fonts/atkinson-italic.woff2) format("woff2");
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: Atkinson-Hyperlegible;
  src: url(/fonts/atkinson-bold.woff2) format("woff2");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: Atkinson-Hyperlegible;
  src: url(/fonts/atkinson-bold-italic.woff2) format("woff2");
  font-weight: 700;
  font-style: italic;
}

/* Tokens */
:root {
  --color-background: #99cccb;
  --color-surface:    #8ebfc1;
  --color-shadow:     #5eaa9f;
  --color-light:      #C9E2E1;
  --color-text:       #1f1f93;
  --color-accent:     #ce0000;
}

/* Base */
body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: Atkinson-Hyperlegible, -apple-system, system-ui, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 36em) {
  body { font-size: 1.25rem; }
}

h1, h2, h3, h4, h5, h6 { color: var(--color-accent); }

h1 { font-size: 1.6rem; }
@media (min-width: 36em) { h1 { font-size: 2.5rem; } }

h2 { font-size: 1.25rem; }
@media (min-width: 36em) { h2 { font-size: 2rem; } }

a, a:visited, a:active {
  color: var(--color-accent);
  text-shadow: none;
}
a { text-decoration-color: var(--color-light); }
a:hover { text-underline-offset: 0.18em; }

blockquote, dl, figcaption, li, p { max-width: 50ch; }

/* Layout utilities */
.flex-column { display: flex; flex-direction: column; }
.flex-column > .grow { flex: 1; }

.cluster {
  --cluster-justify: flex-start;
  --cluster-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: var(--cluster-justify);
  align-items: var(--cluster-align);
  margin: 0 auto;
  gap: .5rem;
}
.cluster > * { margin: .5rem; }

.flow > * + * { margin-top: var(--flow-space, 1.25rem); }

/* Nav */
.main-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100px;
}
@media (min-width: 36em) {
  .main-nav { flex-direction: row; }
}
.main-nav > * { max-height: 100%; }
.main-nav__start { display: flex; justify-content: center; }
@media (min-width: 36em) {
  .main-nav__end { margin-left: auto; margin-right: 0; }
}
.main-nav a.main-nav__item {
  color: var(--color-accent);
  font-size: 1.25rem;
}
@media (min-width: 36em) {
  .main-nav a.main-nav__item { font-size: 1.6rem; }
}
.main-nav a:not(:hover) { text-decoration: none; }

/* Wrappers */
.main-outer-wrapper {
  display: flex;
  align-items: flex-start;
}
.main-inner-wrapper {
  width: 100%;
  padding: 2rem;
}
.grow { flex: 1; }

/* Logo sidebar */
.logo {
  width: 16rem;
  align-items: flex-start;
  display: none;
}
@media (min-width: 48em) {
  .logo { display: flex; }
}
.logo > img {
  position: sticky;
  top: .8rem;
}

/* Head logo (mobile nav) */
.head-logo {
  width: 8rem;
  max-height: 8rem;
  margin: -1rem;
}
@media (min-width: 48em) {
  .head-logo { display: none; }
}

/* Main content */
main { margin-top: 2rem; }
@media (min-width: 36em) { main { margin-top: 4rem; } }

/* Footer */
.main-footer {
  text-align: center;
  margin-top: 6rem;
  padding-bottom: 1rem;
}

/* Email sign-up */
.sign-up {
  margin-top: 6rem;
  overflow: initial;
  text-align: center;
  border: 1px solid var(--color-accent);
  border-radius: 0.2em;
  box-shadow: 5px 5px 0px var(--color-accent);
  padding: 1.5em;
}
@media (min-width: 48em) {
  .sign-up { max-width: 45rem; }
}
.sign-up__cta {
  color: var(--color-text);
  font-size: 1.25rem;
}
@media (min-width: 36em) {
  .sign-up__cta { font-size: 2rem; }
}
.sign-up__fields {
  display: flex;
  margin-top: 1rem;
}
.sign-up__email, .sign-up__submit {
  font-size: 1rem;
}
@media (min-width: 36em) {
  .sign-up__email, .sign-up__submit { font-size: 1.25rem; }
}
.sign-up__email {
  padding: 0.65em 1em;
  margin: 0;
  background: var(--color-background);
  border: 1px solid var(--color-text);
  border-right-color: transparent;
  border-radius: 0.2em 0 0 0.2em;
  display: block;
  width: 100%;
  min-width: 0;
  color: inherit;
}
.sign-up__email:focus { outline: none; }
.sign-up__email::placeholder { color: var(--color-text); }
.sign-up__submit {
  padding: 0.5em 1em;
  color: white;
  background: var(--color-text);
  border: 1px solid var(--color-text);
  border-left-color: transparent;
  border-radius: 0 0.2em 0.2em 0;
  cursor: pointer;
  margin: 0;
}
.sign-up__submit:focus { outline: none; }

/* Posts */
.posts__list {
  list-style: none;
  padding-left: 0;
}
.posts__item + .posts__item { margin-top: 2rem; }
.posts__date {
  font-size: 1rem;
  color: var(--color-text);
}

/* Accessibility */
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Spacing helpers */
.gap-top-300  { margin-top: .8rem; }
.gap-top-400  { margin-top: 1rem; }
.gap-top-500  { margin-top: 1.25rem; }
.gap-top-600  { margin-top: 1.6rem; }
.gap-top-700  { margin-top: 2rem; }
.gap-top-900  { margin-top: 3rem; }
.gap-top-1000 { margin-top: 4rem; }
.gap-top-1200 { margin-top: 6rem; }

.text-500 { font-size: 1rem; }
.weight-bold { font-weight: 700; }
