/* Tanast landing page. One file, no build step, no JavaScript. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("fonts/public-sans-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url("fonts/public-sans-medium.woff2") format("woff2");
}

/* Fallback faces: local Arial scaled to Public Sans so the layout holds if the webfont is late.
   size-adjust is the ratio of average glyph widths; the overrides are Public Sans metrics
   (ascent 95%, descent 22.5%, line gap 0%) divided by size-adjust. */

@font-face {
  font-family: "Public Sans Fallback";
  font-style: normal;
  font-weight: 400;
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 91.35%;
  descent-override: 21.63%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Public Sans Fallback";
  font-style: normal;
  font-weight: 500;
  src: local("Arial");
  size-adjust: 104.66%;
  ascent-override: 90.77%;
  descent-override: 21.5%;
  line-gap-override: 0%;
}

:root {
  --paper: #F7F9F8;
  --ink: #15241E;
  --ink-20: rgba(21, 36, 30, 0.2);
  --slate: #56655F;
  --verdigris: #1F6F5E;
  --verdigris-deep: #195A4C;
  --basin: #E3F0EB;
  --white: #FFFFFF;

  --text-sm: 0.9375rem; /* 15px */
  --text-md: 1rem;      /* 16px */
  --text-lg: 1.25rem;   /* 20px */
  --text-xl: clamp(2.5rem, 1.5rem + 4.5vw, 3.5rem); /* 40px to 56px; one line fits the column at 1024 and up */

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;

  --column: 46rem;
  --measure: 33rem; /* about 70 characters of Public Sans at 16px */
  --radius: 4px;
  --control: 3.25rem;

  /* Public Sans cap height is 1446/2000 of the em. */
  --cap: 0.723em;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", "Public Sans Fallback", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-3);
  font-size: var(--text-md);
}

/* Background. A ruled grid, 32px, 1px ink lines at 4%, fading out toward the viewport edges. */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M32 0.5H0M0.5 0V32' fill='none' stroke='%2315241E' stroke-opacity='0.04'/%3E%3C/svg%3E");
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 45%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 75% at 50% 45%, #000 30%, transparent 100%);
}

/* Behind the hero on wide screens: one large copy of the mark, cropped by the viewport. */

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

main,
footer {
  width: 100%;
  max-width: var(--column);
  margin-inline: auto;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

p {
  margin: 0 0 var(--space-2);
}

/* The mark. Three strokes, currentColor, source of truth in design/mark.svg. */

.mark {
  display: block;
  width: auto;
  color: var(--verdigris);
}

.backdrop .mark-bg {
  display: none;
}

header {
  padding-block: var(--space-4);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

.mark-word {
  height: var(--cap);
}

/* Hero */

.hero {
  padding-block: var(--space-4) var(--space-8);
}

.headline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.mark-hero {
  flex: none;
  height: calc(var(--text-xl) * 1.446); /* twice the cap height of the headline */
}

h1 {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
}

/* The only motion on the page: the three strokes draw in on load. */

@media (prefers-reduced-motion: no-preference) {
  /* Dash lengths are the real path lengths: a 60-unit semicircle is 189, the stem is 88. */
  .mark-hero path {
    stroke-dasharray: 189;
    stroke-dashoffset: 189;
    animation: draw 0.5s ease-out forwards;
  }

  .mark-hero line {
    stroke-dasharray: 88;
    stroke-dashoffset: 88;
    animation: draw 0.5s ease-out forwards;
  }

  .mark-hero g > :nth-child(2) {
    animation-delay: 0.35s;
  }

  .mark-hero g > :nth-child(3) {
    animation-delay: 0.7s;
  }

  @keyframes draw {
    to {
      stroke-dashoffset: 0;
    }
  }
}

.category {
  font-size: var(--text-lg);
  line-height: 1.4;
  max-width: var(--measure);
  margin-bottom: var(--space-4);
}

.copy p {
  max-width: var(--measure);
  margin-bottom: 0.75rem;
}

/* Waitlist form. Field and button share one height and sit as one bar. */

.waitlist {
  margin-top: var(--space-6);
}

label {
  display: block;
  font-size: var(--text-sm);
  color: var(--slate);
  margin-bottom: var(--space-1);
}

.row {
  display: flex;
  gap: var(--space-1);
  max-width: var(--measure);
}

input[type="email"] {
  flex: 1;
  min-width: 0;
  height: var(--control);
  padding: 0 var(--space-2);
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ink-20);
  border-radius: var(--radius);
}

input[type="email"]::placeholder {
  color: var(--slate);
  opacity: 1;
}

input[type="email"]:focus {
  outline: 2px solid var(--verdigris);
  outline-offset: -1px;
  background: var(--basin);
}

button {
  flex: none;
  height: var(--control);
  padding: 0 var(--space-3);
  font: inherit;
  font-weight: 500;
  color: var(--white);
  background: var(--verdigris);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--verdigris-deep);
}

button:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 2px;
}

/* Honeypot. Hidden from people and from the tab order; bots fill it and Formspree drops the submission. */
.gotcha {
  display: none;
}

.note {
  font-size: var(--text-sm);
  color: var(--slate);
  margin: var(--space-2) 0 0;
}

footer {
  padding-block: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
  color: var(--slate);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
  margin-bottom: var(--space-1);
}

footer a {
  display: inline-block;
  padding-block: 0.75rem; /* 44px touch target */
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

footer a:hover {
  color: var(--ink);
}

footer a:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 2px;
}

/* 600px and up: the headline is allowed on one line. */
@media (min-width: 37.5em) {
  h1 br {
    display: none;
  }
}

/* 1024px and up: the hero fills the first viewport, and the large mark sits behind it on the right. */
@media (min-width: 64em) {
  main {
    min-height: 100vh;
    min-height: 100svh;
  }

  .hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 0 var(--space-8);
  }

  .backdrop .mark-bg {
    display: block;
    position: absolute;
    top: 18vh;
    right: -3vw;
    height: 55vh;
    color: var(--ink);
    opacity: 0.03;
  }
}

/* Under 600px: single column, the mark above the headline, the form stacks. */
@media (max-width: 37.49em) {
  body {
    padding: 0 var(--space-2);
  }

  header {
    padding-block: var(--space-3);
  }

  .headline {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .row {
    flex-direction: column;
  }
}
