/* zettabit.ca - one quiet page */

:root {
  --paper: #fcfcfb;
  --ink: #141413;
  --muted: #6e6d68;
  --hair: #e5e4df;
  --signal: #2b49c8;
  --measure: 36rem;
  --font: -apple-system, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overscroll-behavior: none;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }

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

.skip {
  position: absolute;
  left: -200vw;
  top: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  z-index: 10;
}
.skip:focus-visible { left: 0.75rem; }

/* ---------- field ---------- */

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- page ---------- */

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.2rem;
  padding: 4.5rem 1.5rem 2.5rem;
  text-align: center;
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--measure);
}

.mark {
  display: flex;
  justify-content: center;
  margin-bottom: 1.7rem;
}
.mark img { display: block; }

.wordmark {
  margin: 0 0 2.1rem;
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: var(--ink);
}

.statement {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 460;
  letter-spacing: 0;
  line-height: 1.45;
}

.sub {
  margin: 0 auto;
  max-width: 30rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- relation ---------- */

.relation p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0;
}

/* ---------- correspondence ---------- */

.correspondence {
  width: 100%;
  max-width: 21rem;
  min-height: 3rem;
}

.invite {
  font: inherit;
  font-size: 0.9rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0.2rem 0.1rem;
  cursor: pointer;
  transition: color 0.6s ease;
}
.invite:hover, .invite:focus-visible { color: var(--ink); }
html:not(.js) .invite { display: none; }
.js .correspondence.open .invite { display: none; }

.write { text-align: left; }
.js .write { display: none; }
.js .correspondence.open .write { display: block; }

.step { margin-bottom: 1.15rem; }

.js .step {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height 0.9s ease, opacity 1.1s ease, margin 0.9s ease;
}
.js .step.on {
  max-height: 9rem;
  opacity: 1;
  margin-bottom: 1.15rem;
}

.step label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.step input,
.step textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  padding: 0.3rem 0.05rem 0.4rem;
  transition: border-color 0.5s ease;
  resize: none;
}
.step input:focus,
.step textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.send-row { margin: 0.4rem 0 0; text-align: left; }
.js .send-row {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.9s ease, opacity 1.1s ease;
}
.js .send-row.on { max-height: 4rem; opacity: 1; }

.send {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0.25rem 0.1rem;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.5s ease;
}
.send:hover, .send:focus-visible { border-bottom-color: var(--ink); }

.sent {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- entrance ---------- */

.js .mark,
.js .wordmark,
.js .statement,
.js .sub {
  animation: rise 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.js .mark { animation-delay: 0.1s; }
.js .wordmark { animation-delay: 0.35s; }
.js .statement { animation-delay: 0.75s; }
.js .sub { animation-delay: 1s; }

.js .relation p { animation: appear 2.4s ease 1.6s both; }
.js .invite { animation: appear 2.4s ease 2.1s both; }
.js .foot { animation: appear 2.4s ease 2.4s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ---------- quiet index (local, hidden unless enabled) ---------- */

.quiet-index { max-width: var(--measure); text-align: left; }
.quiet-index .kicker {
  font-size: 0.72rem;
  letter-spacing: 0;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.terms { list-style: none; margin: 0; padding: 0; }
.terms li {
  padding: 0.45rem 0;
  border-top: 1px solid var(--hair);
  font-size: 0.92rem;
}
.terms .term { color: var(--ink); margin-right: 0.7rem; }
.terms .line { color: var(--muted); }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 1.4rem 1.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.foot p { margin: 0; }
.clock-label { letter-spacing: 0; }
.clock time { font-variant-numeric: tabular-nums; }

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  .page { gap: 2.6rem; padding-top: 3.5rem; }
  .wordmark { font-size: 2.55rem; }
  .foot { flex-direction: column; gap: 0.15rem; align-items: center; text-align: center; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .js .mark,
  .js .wordmark,
  .js .statement,
  .js .sub,
  .js .relation p,
  .js .invite,
  .js .foot {
    animation: none;
  }
  .js .step, .js .send-row, .invite, .send,
  .step input, .step textarea {
    transition: none;
  }
}
