/* ============================================================
   EVERWAKE — holding page
   ============================================================ */

:root {
  color-scheme: light dark;

  /* light theme (default) */
  --ground:      #E9ECE9;
  --ink:         #0C1618;
  --ink-2:       #40504F;
  --ink-3:       #5E6D6B;
  --rule:        #C4CDC8;
  --accent:      #A85E14;
  --wake-rgb:    12, 22, 24;
  --wake-alpha:  0.30;

  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --font-body:    "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "SF Mono", SFMono-Regular, ui-monospace, Menlo, "Andale Mono", monospace;

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

  --step--1: clamp(0.75rem, 0.72rem + 0.15vw, 0.82rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-4:  clamp(2.3rem, 1.5rem + 3.6vw, 4.4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:      #081416;
    --ink:         #E6ECE9;
    --ink-2:       #A2B3AF;
    --ink-3:       #7E918F;
    --rule:        #1E3033;
    --accent:      #E9A24A;
    --wake-rgb:    233, 162, 74;
    --wake-alpha:  0.22;
  }
}

/* An explicit theme must beat the media query in both directions.
   Nothing sets data-theme today — this is here so a toggle can be
   added later without touching any component styles. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground:      #081416;
  --ink:         #E6ECE9;
  --ink-2:       #A2B3AF;
  --ink-3:       #7E918F;
  --rule:        #1E3033;
  --accent:      #E9A24A;
  --wake-rgb:    233, 162, 74;
  --wake-alpha:  0.22;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground:      #E9ECE9;
  --ink:         #0C1618;
  --ink-2:       #40504F;
  --ink-3:       #5E6D6B;
  --rule:        #C4CDC8;
  --accent:      #A85E14;
  --wake-rgb:    12, 22, 24;
  --wake-alpha:  0.30;
}

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

html {
  /* carries the ground into the overscroll area and the initial paint */
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }

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

/* the wake, sitting behind everything */
#wake {
  position: fixed;
  inset: 0;
  /* canvas is a replaced element: without an explicit width it resolves to
     its own bitmap width, so inset alone would let each resize scale it up */
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(115% 85% at 28% 45%, #000 12%, transparent 76%);
  mask-image: radial-gradient(115% 85% at 28% 45%, #000 12%, transparent 76%);
}

/* one screen, three bands: mark / statement / footer */
.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  max-width: var(--page);
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 3rem) var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* a floor, not a fixed band: space-between distributes any slack, and the
     small minimum keeps the page inside one screen on short viewports */
  gap: clamp(1.5rem, 6vh, 5rem);
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.lockup svg { display: block; }
.lockup span {
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: 0.02em;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

/* ------------------------------------------------------------
   the statement
   ------------------------------------------------------------ */
main h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: -0.028em;
  text-wrap: balance;
  margin: 1.5rem 0 0;
  /* measured in the display face, where 1ch is wide */
  max-width: 15ch;
}
main h1 em {
  font-style: italic;
  color: var(--accent);
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: clamp(2rem, 4vh, 2.75rem);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.75rem 1.35rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ground);
  transition: background 0.22s, color 0.22s, border-color 0.22s, transform 0.22s;
}
.contact:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.contact .arrow { transition: transform 0.22s; }
.contact:hover .arrow { transform: translateX(3px); }

/* ------------------------------------------------------------
   the horizon, closing the page
   ------------------------------------------------------------ */
footer { display: grid; gap: 1.1rem; }

.horizon {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.horizon::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.horizon::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* staged reveal on load */
.rise {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.9s cubic-bezier(0.22, 0.7, 0.25, 1) forwards;
}
.r1 { animation-delay: 0.05s; }
.r2 { animation-delay: 0.20s; }
.r3 { animation-delay: 0.36s; }
.r4 { animation-delay: 0.50s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   404
   ------------------------------------------------------------ */
.notfound main h1 { max-width: 18ch; }
.notfound .code {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0;
}
