/* Hidden Place — hand-written, no framework, no external assets. */

:root {
  --paper:       #101011;
  --paper-lift:  #151517;
  --ink:         #8a8a8c;
  --ink-quiet:   #7e7e81;
  --ink-faint:   #6e6e71;
  --rule:        #26262a;
  --rule-lift:   #3a3a40;
  --clay:        #9a827a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.5rem, 6vw, 4.5rem);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

/* The browser default is a bright blue; nothing here should flare. */
::selection {
  background: #2a2a2f;
  color: #b4b4b7;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--gutter);
  background-color: var(--paper);
  background-image: radial-gradient(120% 90% at 50% 38%, #141416 0%, #101011 46%, #0c0c0d 100%);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 100%;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* A film of grain so the flat dark does not read as a blank canvas. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 100%;
  max-width: 34rem;
}

/* ---- the message ---- */

.note {
  margin: 0;
  font-size: clamp(1.1rem, .98rem + .82vw, 1.55rem);
  line-height: 1.85;
  letter-spacing: .004em;
}

.note p {
  margin: 0;
  text-wrap: pretty;
}

.aside {
  margin: 2.75rem 0 0;
  max-width: 28rem;
  font-size: .98rem;
  line-height: 1.8;
  color: var(--ink-quiet);
  text-wrap: pretty;
}

.back {
  color: var(--ink-quiet);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .12em;
  transition: color 180ms ease, border-color 180ms ease;
}

.back:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-lift);
}

.back:focus-visible {
  outline: 1px solid var(--rule-lift);
  outline-offset: 4px;
}

/* ---- newsletter ---- */

.signup {
  margin-top: 3.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

.signup__label {
  display: block;
  max-width: 30rem;
  font-family: var(--ui);
  font-size: .8rem;
  line-height: 1.65;
  letter-spacing: .012em;
  color: var(--ink-quiet);
}

.signup__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.signup__input {
  flex: 1 1 15rem;
  min-width: 0;
  max-width: 22rem;
  margin: 0;
  padding: .5rem 0 .6rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--ui);
  font-size: .95rem;
  line-height: 1.4;
  transition: border-color 180ms ease;
}

.signup__input::placeholder { color: #4e4e52; }

.signup__input:hover { border-bottom-color: var(--rule-lift); }

.signup__input:focus {
  outline: 0;
  border-bottom-color: var(--rule-lift);
}

/* A box drawn around a 1px underline looks like litter. Thicken and lift the
   underline instead; box-shadow rather than border-width so nothing shifts. */
.signup__input:focus-visible {
  outline: 0;
  border-bottom-color: var(--ink-faint);
  box-shadow: 0 1px 0 0 var(--ink-faint);
}

/* The browser's own invalid styling is loud; keep it quiet until submit. */
.signup__input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--paper) inset;
}

/* .button is the same control on the confirm and unsubscribe pages, where
   there is no surrounding form to name it after. */
.signup__button,
.button {
  flex: 0 0 auto;
  padding: .72rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: 1px;
  background: transparent;
  color: var(--ink-quiet);
  font-family: var(--ui);
  font-size: .72rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.signup__button:hover,
.button:hover {
  color: var(--ink);
  border-color: var(--rule-lift);
  background-color: var(--paper-lift);
}

.signup__button:focus-visible,
.button:focus-visible {
  outline: 1px solid var(--rule-lift);
  outline-offset: 3px;
}

.action {
  margin-top: 2.75rem;
}

.signup__button[disabled] {
  cursor: default;
  color: var(--ink-faint);
  border-color: var(--rule);
  background: transparent;
}

.signup__status {
  min-height: 1.5em;
  margin: 1.5rem 0 0;
  font-family: var(--ui);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--ink-quiet);
}

.signup__status.is-off { color: var(--clay); }

/* What happens to your address, on a mark pinned to the button's top corner.
   The trigger is a real button rather than a bare hover target: a tooltip that
   only answers to a mouse is unreachable on a phone and by keyboard. */

.signup__submit {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.hint {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(45%, -45%);
  line-height: 0;
}

.hint__mark {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-faint);
  font-family: var(--ui);
  font-size: .58rem;
  line-height: 1;
  cursor: help;
  transition: color 180ms ease, border-color 180ms ease;
}

.hint__mark:hover,
.hint:focus-within .hint__mark {
  color: var(--ink-quiet);
  border-color: var(--rule-lift);
}

.hint__mark:focus-visible {
  outline: 1px solid var(--rule-lift);
  outline-offset: 2px;
}

.hint__bubble {
  position: absolute;
  bottom: calc(100% + .75rem);
  right: -.35rem;
  z-index: 2;
  width: max-content;
  max-width: min(19rem, calc(100vw - 3rem));
  padding: .7rem .8rem;
  border: 1px solid var(--rule);
  background-color: var(--paper-lift);
  color: var(--ink-quiet);
  font-family: var(--ui);
  font-size: .64rem;
  line-height: 1.7;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, visibility 0s linear 160ms;
}

/* Hovering the bubble itself keeps it open, so the address inside stays
   clickable rather than vanishing on the way to it. */
.hint:hover .hint__bubble,
.hint:focus-within .hint__bubble {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease, visibility 0s linear 0s;
}

.hint__bubble a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-lift);
}

/* Bait for form-stuffing bots. Off-screen rather than display:none,
   which some of them are wise to. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- wordmark ---- */

.mark {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
  font-family: var(--ui);
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- arrival ---- */

@media (prefers-reduced-motion: no-preference) {
  .note, .aside, .signup, .mark {
    animation: settle 900ms cubic-bezier(.22, .61, .36, 1) both;
  }
  .aside { animation-delay: 120ms; }
  .signup { animation-delay: 240ms; }
  .mark   { animation-delay: 360ms; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 30rem) {
  .signup__submit,
  .signup__button { width: 100%; }
}
