/*
 * Emberline Software. The name is the picture: an ember resting on a line, the sun setting on a Florida horizon at
 * dusk. That horizon is the one bold thing on the site; everything else stays quiet. Archivo's width axis does the
 * talking: the wordmark is set fully expanded, like the horizon itself, and reading text sits at normal width.
 */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --dusk: #17223a;
  --sand: #f3e9dc;
  --haze: #a9b4c6;
  --ember: #ff9a57;
  --glow: #ffd08a;
  --horizon: rgba(243, 233, 220, 0.3);
  --sun: clamp(150px, 22vw, 300px);
  --page: 64rem;
  --reading: 38rem;
  --gutter: clamp(20px, 4vw, 32px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--dusk);
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--sand);
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

strong {
  font-weight: 600;
}

h1,
h2 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

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

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

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

::selection {
  background: rgba(255, 154, 87, 0.35);
}

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--sand);
  text-decoration: none;
  font-stretch: 112%;
  font-weight: 600;
  font-size: 1rem;
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  display: inline-block;
  padding-block: 10px;
  color: var(--haze);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--sand);
}

/* Keeps the name and the links on one line on phones down to 360 points wide */
@media (max-width: 400px) {
  .site-header .wrap {
    column-gap: 16px;
  }

  .brand {
    gap: 10px;
    font-size: 0.9375rem;
    font-stretch: 100%;
  }

  .brand svg {
    width: 26px;
    height: 26px;
  }

  .site-nav {
    gap: 18px;
  }
}

/* Home: the wordmark resting on the horizon */

.hero {
  padding-top: clamp(40px, 9vw, 104px);
}

.wordmark {
  position: relative;
  z-index: 1;
  margin: 0;
  font-stretch: 125%;
  font-weight: 400;
  font-size: clamp(2.75rem, 12.5vw, 6.75rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
}

.wordmark span {
  display: block;
}

.horizon {
  position: relative;
  height: 1px;
  margin-top: clamp(14px, 2.5vw, 26px);
  margin-inline: calc(50% - 50vw);
  background: linear-gradient(to right, transparent, var(--horizon) 12%, var(--horizon) 88%, transparent);
}

/* Only the sun's upper half shows above the line. It settles into place once, on arrival, and its reflection
   appears on the water after it. */
.sun {
  position: absolute;
  left: 78%;
  bottom: 1px;
  width: var(--sun);
  height: var(--sun);
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
}

.sun::before {
  content: '';
  position: absolute;
  inset: 50% 0 -50%;
  border-radius: 50%;
  background: radial-gradient(
    circle closest-side,
    var(--glow) 0 26%,
    var(--ember) 36%,
    rgba(255, 154, 87, 0.3) 40%,
    rgba(255, 154, 87, 0.1) 62%,
    transparent
  );
  animation: settle 2.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.glints {
  position: absolute;
  left: 78%;
  top: 9px;
  display: grid;
  justify-items: center;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
  animation: appear 1.4s ease-out 1s both;
}

.glints span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--ember);
}

.glints span:nth-child(1) {
  width: calc(var(--sun) * 0.3);
  opacity: 0.55;
}

.glints span:nth-child(2) {
  width: calc(var(--sun) * 0.2);
  opacity: 0.38;
}

.glints span:nth-child(3) {
  width: calc(var(--sun) * 0.12);
  opacity: 0.24;
}

.glints span:nth-child(4) {
  width: calc(var(--sun) * 0.05);
  opacity: 0.14;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(-16%);
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sun::before,
  .glints {
    animation: none;
  }
}

.lead {
  max-width: 34rem;
  margin: clamp(56px, 9vw, 88px) 0 0;
  font-size: 1.3125rem;
  line-height: 1.5;
}

/* Home: each section is a heading column beside a reading column */

.section {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 36rem);
  align-items: baseline;
  gap: 12px 48px;
  margin-top: clamp(64px, 10vw, 112px);
}

.section h2 {
  margin: 0;
  font-stretch: 112%;
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
}

.section p,
.section ul {
  margin: 0 0 16px;
}

.section ul {
  padding-left: 1.1em;
}

.section li {
  margin-bottom: 8px;
}

.section li::marker {
  color: var(--ember);
}

.section > div > :last-child {
  margin-bottom: 0;
}

.section .principles {
  display: grid;
  gap: 20px;
  padding: 0;
  list-style: none;
}

.section .principles li {
  margin: 0;
}

.principles strong {
  display: block;
}

.principles span {
  color: var(--haze);
}

@media (max-width: 52rem) {
  .section {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Privacy, support and not-found pages: one reading column, on the same left edge as the header */

.page {
  padding-top: clamp(32px, 7vw, 72px);
}

.page > * {
  max-width: var(--reading);
}

.page h1 {
  margin: 0 0 16px;
  font-stretch: 125%;
  font-weight: 400;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.page h2 {
  margin: 44px 0 10px;
  font-stretch: 112%;
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.3;
}

.page p,
.page ul {
  margin-block: 0 16px;
}

.page ul {
  padding-left: 1.1em;
}

.page li {
  margin-bottom: 10px;
}

.page li::marker {
  color: var(--ember);
}

.page .intro {
  font-size: 1.25rem;
  line-height: 1.5;
}

.page .updated {
  margin-bottom: 32px;
  color: var(--haze);
}

/* Footer */

.site-footer {
  margin-top: clamp(80px, 12vw, 128px);
  color: var(--haze);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 44px;
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.site-footer a {
  color: var(--haze);
}

.site-footer a:hover {
  color: var(--sand);
}
