/* keeptomorrow.app: a green sky on top, morning yellow below. One theme, no dark mode. */

@font-face {
  font-family: "Young Serif";
  src: url("/fonts/YoungSerif-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --sky: #2b6a5c;
  --morning: #ffe9b0;
  --ink: #143b33;
  --paper: #fff6de;
  --error: #a3362b;
  --serif: "Young Serif", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --gutter: clamp(20px, 6.74vw - 6.3px, 80px); /* 20px on a phone, 80px on a laptop */
  color-scheme: only light;
}

/* Sizes that grow with the window are clamp(phone, ..., desktop): the phone value at 390px wide,
   the desktop value at 1280px. Font sizes are in rem, so the browser's text size setting applies. */

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--morning);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: clamp(1.125rem, 0.11vw + 1.1rem, 1.1875rem);
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.875rem, 2.02vw + 1.38125rem, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 0.67vw + 1.3375rem, 1.875rem);
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: inherit;
  line-height: 1.4;
}

p,
ul,
dl,
dd,
address {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

ul {
  padding-left: 1.1em;
}

li + li {
  margin-top: 10px;
}

address {
  font-style: normal;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

a:hover {
  color: var(--sky);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

[tabindex="-1"]:focus {
  outline: none;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--morning);
  transform: translateY(-200%);
  z-index: 1;
}

.skip:focus {
  transform: none;
}

/* Content up to 1120px wide, between side gutters. */
header,
main,
footer {
  padding: 0 var(--gutter);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
}

/* The sky band on top of every page. */
.sky {
  background: var(--sky);
  color: var(--morning);
}

.sky a {
  color: var(--morning);
  text-decoration: none;
}

.sky :focus-visible,
.skip:focus-visible {
  outline-color: var(--morning);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  min-height: clamp(64px, 6.9vw, 88px);
  padding-block: 8px;
}

.home .bar {
  min-height: clamp(60px, 6.9vw, 88px);
}

.bar nav {
  display: flex;
  gap: clamp(22px, 1.124vw + 17.62px, 32px);
  margin-left: auto;
  font-size: 1rem;
}

.bar nav a:hover,
.bar nav [aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* The name, with the K standing on its own bar like the app icon. */
.name {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 0.45vw + 1.3875rem, 1.75rem);
  line-height: 1;
  white-space: nowrap;
}

.k {
  position: relative;
  display: inline-block;
  margin-left: 0.08em;
}

.k::after {
  content: "";
  position: absolute;
  top: 0.83em;
  right: 0;
  left: -0.08em;
  height: 0.2em;
  border-radius: 0 0 0.07em 0.07em;
  background: currentColor;
}

/* Home: the name stands on the horizon, and "Tomorrow" rises out of the page once. */
.wordmark {
  display: block;
  width: min(100%, 140vh);
  margin-top: max(16px, 48px - 2.5vw);
  fill: currentColor;
}

.rise {
  animation: rise 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes rise {
  from {
    transform: translateY(60px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rise {
    animation: none;
  }
}

/* Covers the edge under the name, so no green hairline shows. */
.home main {
  position: relative;
  margin-top: -1px;
  background: var(--morning);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 2.5vw, 32px);
  padding-top: clamp(32px, 4.4vw, 56px);
}

.hero h1 {
  max-width: 17em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--sky);
  color: var(--morning);
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  background: var(--ink);
  color: var(--morning);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.small {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--sky);
}

/* Rows: a heading on the left, its text on the right. They stack on a phone. */
.rows {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 5.6vw, 72px);
  margin-top: clamp(64px, 8.75vw, 112px);
}

.text .rows {
  gap: clamp(40px, 4.4vw, 56px);
  margin-top: clamp(48px, 6.25vw, 80px);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 64px;
}

.row > h2 {
  flex: 1 1 340px;
}

.row > div {
  flex: 1.4 1 420px;
  min-width: 0;
}

.row > div > * + * {
  margin-top: 14px;
}

.row > div > h3 {
  margin-top: 28px;
}

.row > div > p + address {
  margin-top: 8px;
}

/* The week from asking to unlock to the day it opens, one dot per day. The 36px day columns are
   pulled out 10px, so the end dots line up with the text, and the line runs between their centres. */
.row .timeline {
  margin: clamp(24px, 0.45vw + 22.25px, 28px) -10px 0;
}

.ends {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.days {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--sky);
}

.days::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 18px;
  left: 18px;
  height: 2px;
  background: var(--sky);
}

.days li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 36px;
  margin: 0;
}

.days li::before {
  content: "";
  width: 12px;
  height: 12px;
  margin: 2px 0;
  border: 2px solid var(--sky);
  border-radius: 50%;
  background: var(--morning);
}

.days li:first-child::before,
.days li:last-child::before {
  width: 16px;
  height: 16px;
  margin: 0;
  border: 0;
  background: var(--ink);
}

.row .when {
  margin-top: clamp(20px, 0.225vw + 19.12px, 22px);
}

.row .print {
  margin-top: 16px;
}

.row details {
  margin-top: clamp(10px, 0.674vw + 7.37px, 16px);
}

.print {
  width: fit-content;
  max-width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.nowrap {
  white-space: nowrap;
}

summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary:hover {
  color: var(--sky);
}

/* Text pages: privacy, terms, Impressum, security. */
.intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: clamp(32px, 5vw, 64px);
}

.lead {
  max-width: 32em;
  font-size: clamp(1.1875rem, 0.34vw + 1.10625rem, 1.375rem);
  line-height: 1.45;
}

/* A link on a line of its own, tall enough to tap. */
.tap {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.facts {
  display: grid;
  grid-template-columns: 5.6em minmax(0, 1fr);
  gap: 12px 20px;
}

.facts dt {
  font-weight: 700;
}

/* Confirm and stop: short text, then the form. The result replaces the form. */
.action {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: clamp(32px, 5vw, 64px);
}

.action > * {
  max-width: 640px;
}

.action h1 {
  margin-bottom: 2px;
}

.panel {
  margin-top: 14px;
  padding: 20px;
  border-radius: 14px;
  background: var(--paper);
}

.panel form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1.0625rem;
  line-height: 1.5;
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  accent-color: var(--sky);
}

.error {
  color: var(--error);
}

.result p {
  margin-top: 8px;
}

footer {
  padding-top: clamp(72px, 9.4vw, 120px);
  padding-bottom: clamp(48px, 5vw, 64px);
  font-size: 1rem;
  line-height: 1.5;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(24px, 2.2vw, 28px);
}

footer p {
  margin-top: 10px;
  color: var(--sky);
  text-wrap: wrap;
}

@media (max-width: 719px) {
  .cta {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: center;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .facts dd + dt {
    margin-top: 12px;
  }
}

@media (min-width: 720px) {
  body {
    line-height: 1.6;
  }

  .print {
    padding: 18px 22px;
    font-size: 1rem;
  }

  .panel .button {
    align-self: flex-start;
  }
}

/* Windows contrast themes replace backgrounds, so give the buttons, the K's bar and the timeline other ways to show. */
@media (forced-colors: active) {
  .button {
    border: 2px solid;
  }

  .k::after {
    background: LinkText;
  }

  .days::before,
  .days li:first-child::before,
  .days li:last-child::before {
    background: CanvasText;
  }
}
