/* eDay Software, temporary site. One screen: the visitor's day in one frame. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #fff;
  --ink-soft: #c9d2ff;
  --ground: #0c0f30;
  --alert: #ffb4a8;
  --night: #161c57;
  --cobalt: #2966eb;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  background: var(--ground);
  scrollbar-color: #4a5fd1 var(--ground);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Archivo", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 440;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

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

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

/* The frame: sky above, ground below, one fixed axis for the present. */

.frame {
  --now-f: 0.34;
  --gutter: 1.5rem;
  --edge: 2rem;
  --now: var(--now-px, calc(var(--now-f) * 100vw));
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(to bottom, var(--night), var(--cobalt));
  touch-action: pan-y;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
}

.now {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--now);
  width: 1.5px;
  background: var(--ink);
  pointer-events: none;
  /* The line opens where the moon stands on it (set from the script; closed by default). */
  -webkit-mask-image: linear-gradient(to bottom, #fff var(--gap-from, 0px), transparent var(--gap-from, 0px), transparent var(--gap-to, 0px), #fff var(--gap-to, 0px));
  mask-image: linear-gradient(to bottom, #fff var(--gap-from, 0px), transparent var(--gap-from, 0px), transparent var(--gap-to, 0px), #fff var(--gap-to, 0px));
}

/* Top bar */

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.75rem var(--edge) 0;
}

.wordmark {
  font-size: 1.375rem;
  font-weight: 680;
  letter-spacing: -0.012em;
  line-height: 1;
}

.wordmark span {
  font-weight: 420;
}

/* The second line of the mark: half the size, spaced out to the exact width of "eDay". */

.wordmark small {
  display: block;
  margin-top: 0.1em;
  font-size: 0.5em;
  font-weight: 560;
  letter-spacing: 0.084em;
  line-height: 1;
}

.lang {
  display: flex;
  gap: 1.375rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.2;
}

.lang a {
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.4em;
  transition: text-decoration-color 0.2s var(--ease-out);
}

.lang a:hover {
  text-decoration-color: var(--ink);
}

.lang a[aria-current] {
  font-weight: 680;
  text-decoration-color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.4em;
}

/* Headline: hangs from the NOW line, inside the future. It is light at the line and gains
   weight with the distance from it, as it moves into the day. */

main {
  padding: clamp(3rem, 15vh, 10rem) var(--edge) 3rem calc(var(--now) + var(--gutter));
  transition: padding-top 0.7s var(--ease-out), padding-bottom 0.7s var(--ease-out), min-height 0.7s var(--ease-out);
}

/* When the ground rises, the headline moves up to make room. */

.frame:has(.is-open) main {
  min-height: 0;
  padding-top: clamp(2rem, 7vh, 5rem);
  padding-bottom: 1.5rem;
}

.headline {
  margin: 0;
  font-size: clamp(2.75rem, 6.7vw, 6rem);
  font-weight: 620;
  line-height: 0.96;
  letter-spacing: -0.032em;
}

.headline .line {
  display: block;
}

.headline .w300 {
  font-weight: 300;
}

.headline .w325 {
  font-weight: 325;
}

.headline .w350 {
  font-weight: 350;
}

.headline .w375 {
  font-weight: 375;
}

.headline .w400 {
  font-weight: 400;
}

.headline .w425 {
  font-weight: 425;
}

.headline .w450 {
  font-weight: 450;
}

.headline .w475 {
  font-weight: 475;
}

.headline .w500 {
  font-weight: 500;
}

.headline .w525 {
  font-weight: 525;
}

.headline .w550 {
  font-weight: 550;
}

.headline .w575 {
  font-weight: 575;
}

.headline .w600 {
  font-weight: 600;
}

.headline .w625 {
  font-weight: 625;
}

.headline .w650 {
  font-weight: 650;
}

.headline .w675 {
  font-weight: 675;
}

.headline .w700 {
  font-weight: 700;
}

.headline .w725 {
  font-weight: 725;
}

.headline .w750 {
  font-weight: 750;
}

.headline .w775 {
  font-weight: 775;
}

.headline .w800 {
  font-weight: 800;
}

/* Optical margin: each line is pulled left by the side space of its first letter, so stems
   stand on the text column and round or pointed letters reach just past it. */

.headline .hang-w {
  margin-left: -0.02em;
}

.headline .hang-k {
  margin-left: -0.063em;
}

.headline .hang-m {
  margin-left: -0.078em;
}

.headline .hang-d {
  margin-left: -0.046em;
}

/* Ground: everything below the horizon. On wide frames one row on one baseline:
   the copyright line, the sentence on the NOW line, the contact link at the page margin. */

.ground {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--now) - var(--edge) - var(--gutter)) minmax(0, 27rem) minmax(0, 1fr);
  column-gap: calc(var(--gutter) * 2);
  align-items: baseline;
  min-height: 16vh;
  padding: 3.25rem var(--edge) 1.5rem;
  background: var(--ground);
}

.gl .ground {
  background: transparent;
}

.note {
  grid-area: 1 / 1;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.lede {
  grid-area: 1 / 2;
  font-size: 1.0625rem;
  /* Light, with a little air: white text on the dark ground thickens by itself. */
  font-weight: 380;
  letter-spacing: 0.004em;
  line-height: 1.5;
  text-wrap: pretty;
}

.contact {
  grid-area: 1 / 3;
  justify-self: end;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* The quiet link: it opens the contact form and closes it. It is there for someone who looks
   for contact, in the manner of the language switch, and does not ask for attention. */

.act {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  transition: text-decoration-color 0.2s var(--ease-out);
}

.act:focus-visible {
  outline-offset: -2px;
}

@media (hover: hover) {
  .act:hover {
    text-decoration-color: var(--ink);
  }
}

/* The contact form: the ground rises to make room for it. */

.sheet {
  grid-area: 2 / 2 / auto / -1;
  align-self: start;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.7s var(--ease-out);
}

.is-open .sheet {
  grid-template-rows: 1fr;
}

.sheet__inner {
  min-height: 0;
  margin: 0 -0.5rem -0.5rem;
  padding: 0 0.5rem 0.5rem;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out), visibility 0s 0.7s;
}

.is-open .sheet__inner {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.55s var(--ease-out) 0.2s, visibility 0s;
}

.form,
.sent {
  display: grid;
  max-width: 40rem;
  padding-top: 2.5rem;
}

.form {
  gap: 1.25rem;
}

.field {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.field label {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid transparent;
  border-bottom-color: var(--ink-soft);
  border-radius: 0;
  background: #171b47;
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink);
  caret-color: var(--ink);
  appearance: none;
  transition: border-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.field textarea {
  min-height: 8rem;
  resize: none;
}

@media (hover: hover) {
  .field input:hover,
  .field textarea:hover {
    background: #1f2458;
  }
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 0;
  border-color: var(--ink);
  background: #1f2458;
}

.field input:-webkit-autofill {
  box-shadow: 0 0 0 100px #1f2458 inset;
  -webkit-text-fill-color: var(--ink);
}

.field [aria-invalid="true"] {
  border-color: var(--alert);
}

.field__error,
.form__status {
  font-size: 0.8125rem;
  color: var(--alert);
}

/* The error line keeps its place when empty, so a message appearing does not move the page. */

.field__error {
  min-height: 1.5em;
}

#turnstile:empty {
  display: none;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.privacy {
  max-width: 72ch;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* An address line or a number that must not break in the middle. */

.keep {
  white-space: nowrap;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.75rem;
}

/* The one filled button on the page: sending the message. */

.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.7rem 1.375rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 640;
  line-height: 1.2;
  color: var(--ground);
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.22s var(--ease-out), color 0.22s var(--ease-out), border-color 0.22s var(--ease-out);
}

.send:focus-visible {
  outline-offset: 3px;
}

@media (hover: hover) {
  .send:hover {
    background: transparent;
    color: var(--ink);
  }
}

.send:active {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
  color: var(--ground);
}

.send[aria-busy="true"] {
  border-color: var(--ink-soft);
  background: transparent;
  color: var(--ink-soft);
  cursor: progress;
}

.form__status {
  flex-basis: 100%;
}

.sent {
  gap: 0.6rem;
  justify-items: start;
  padding-bottom: 0.5rem;
}

.sent:focus {
  outline: 0;
}

.sent__line {
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

/* Time axis: one row of words on the horizon. */

.axis {
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--ink-soft);
}

.clock {
  position: absolute;
  top: calc(var(--horizon, 0px) + 0.7rem);
  left: calc(var(--now) + var(--gutter));
  font-size: 0.8125rem;
  font-weight: 640;
  color: var(--ink);
  white-space: nowrap;
}

.mark {
  position: absolute;
  top: var(--horizon, 0px);
  left: 0;
}

.mark__tick {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 0.5rem;
  background: currentColor;
}

.mark__label {
  position: absolute;
  top: 0.7rem;
  left: 0.4rem;
  white-space: nowrap;
}

.mark--left .mark__label {
  right: 0.4rem;
  left: auto;
}

.mark--day {
  color: var(--ink);
  font-weight: 640;
}

/* A word moved to the place after the hour, and tomorrow waiting at the page margin, have no tick. */

.mark--after .mark__tick,
.mark--edge .mark__tick {
  display: none;
}

.mark--after .mark__label {
  left: 0;
}

.mark--edge .mark__label {
  right: 0;
  left: auto;
}

.sun {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.375rem;
  height: 1.375rem;
  margin: -0.6875rem 0 0 calc(-0.6875rem + 0.75px);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
}

.sun--under {
  background: var(--ground);
}

/* Wide frames: the form in two columns, so the headline stays in view while the ground is raised.
   Left: the address, the spam check when it shows, the button, whose lower edge stands on the
   lower rule of the message. Right: the message, then the small print. */

@media (min-width: 68.0625rem) {
  .form {
    grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      "email message"
      "check message"
      "actions message"
      "status privacy";
    column-gap: calc(var(--gutter) * 2);
    max-width: none;
  }

  .field--email {
    grid-area: email;
  }

  .field--message {
    grid-area: message;
    grid-template-rows: auto 1fr auto;
  }

  .field--message textarea {
    height: 100%;
  }

  /* The button and the notice about sending take their own places in the grid. */
  .form__actions {
    display: contents;
  }

  /* Lifted by the height of the error line kept under the message. */
  .send {
    grid-area: actions;
    align-self: end;
    justify-self: start;
    margin-bottom: calc(0.8125rem * 1.5 + 0.4rem);
  }

  /* A notice about sending appears beside the small print, without moving the button. */
  .form__status {
    grid-area: status;
  }

  .privacy {
    grid-area: privacy;
  }

  #turnstile {
    grid-area: check;
  }
}

/* Narrower frames: the copyright line beside, the sentence on the axis, the link under it at the margin. */

@media (max-width: 68rem) {
  .headline {
    font-size: clamp(2.75rem, 7.2vw, 4.5rem);
  }

  .ground {
    grid-template-columns: calc(var(--now) - var(--edge) - var(--gutter)) minmax(0, 1fr);
    padding-top: 3.5rem;
  }

  .lede {
    max-width: 27rem;
  }

  .sheet {
    grid-area: 2 / 2;
  }

  .contact {
    grid-area: 3 / 2;
    margin-top: 0.75rem;
  }

  /* One column of form parts. The spam check is usually invisible and must not leave
     a double gap, which a flex column allows and a grid row does not. */
  .form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  #turnstile {
    margin-block: -0.375rem;
  }

  .form__actions {
    margin-top: 0.5rem;
  }
}

@media (max-width: 47.5rem) {
  .frame {
    --now-f: 0.22;
    --gutter: 0.875rem;
    --edge: 1rem;
  }

  .top {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    padding: 1.25rem var(--edge) 0 calc(var(--now) + var(--gutter));
  }

  /* Never smaller: the second line of the mark is half this size and must stay readable. */
  .wordmark {
    font-size: 1.25rem;
  }

  .lang {
    gap: 0.875rem;
    font-size: 0.875rem;
  }

  .sun {
    width: 1.125rem;
    height: 1.125rem;
    margin: -0.5625rem 0 0 calc(-0.5625rem + 0.75px);
  }

  /* The sky keeps most of the first screen. */
  main {
    min-height: calc(70vh - 3.5rem);
    min-height: calc(70svh - 3.5rem);
    padding-top: clamp(2rem, 11vh, 6rem);
    padding-bottom: 2rem;
  }

  .frame:has(.is-open) main {
    padding-top: clamp(1.5rem, 6vh, 3.5rem);
  }

  .headline {
    font-size: clamp(1.9rem, 9.6vw, 3.25rem);
    letter-spacing: -0.022em;
  }

  /* The sentence, then one footer row: the copyright line and the contact link. */
  .ground {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    padding: 3.5rem var(--edge) 0.5rem calc(var(--now) + var(--gutter));
  }

  .lede {
    grid-area: 1 / 1 / auto / -1;
    max-width: none;
    font-size: 1rem;
  }

  .sheet {
    grid-area: 2 / 1 / auto / -1;
  }

  .note {
    grid-area: 3 / 1;
    margin-top: 1rem;
  }

  .contact {
    grid-area: 3 / 2;
    margin-top: 1rem;
  }

  .form,
  .sent {
    padding-top: 1.75rem;
  }
}

@media (max-width: 47.5rem) and (max-height: 43.75rem) {
  main {
    min-height: calc(58vh - 3.5rem);
    min-height: calc(58svh - 3.5rem);
  }
}

@media (max-width: 22.5rem) {
  .lang {
    gap: 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Too narrow for the copyright line and the link side by side: the link first, then the line. */

@media (max-width: 22.4375rem) {
  .ground {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 1rem;
  }

  .contact {
    grid-area: 3 / 1;
    justify-self: start;
    margin-top: 0.5rem;
  }

  .note {
    grid-area: 4 / 1;
    margin-top: 0.25rem;
  }
}

@media (max-height: 34rem) and (min-width: 47.5rem) {
  main {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .headline {
    font-size: clamp(2.25rem, 12vh, 4.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  main,
  .lang a,
  .act,
  .send,
  .sheet,
  .sheet__inner,
  .is-open .sheet__inner,
  .field input,
  .field textarea {
    transition: none;
  }
}

@media print {
  .sky,
  .axis {
    display: none;
  }

  .frame {
    background: var(--night);
  }
}
