/* Ohno website. Values come from the Figma page "Ohno / Website v1":
   phone frame at 390, desktop frame at 1440. Phone first. */

:root {
  --ink: #332a26;
  --paper: #fff;
  --cream: #fff1d8;
  --accent: #d65d42;
  --m: 24px;       /* page margin */
  --indent: 0px;   /* how far text sits in from the margin */
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/26px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, p { margin: 0; font-size: inherit; font-weight: inherit; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.page { max-width: 1440px; margin: 0 auto; }

/* The text column. On wide screens it lines up with the sender names
   inside the app window: 376 of the window's 1280. */
.col {
  padding-left: calc(var(--m) + var(--indent));
  padding-right: var(--m);
}
.col > * { max-width: 656px; }

/* Header */
.header { padding-top: 24px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 590;
}
.brand img { width: 32px; height: 32px; }
a.brand { width: fit-content; }
a.brand:hover { text-decoration: none; }

/* Hero */
.hero { padding-top: 96px; }
h1 { font-size: 40px; line-height: 48px; font-weight: 590; }
.beat { display: block; }
.lead { margin-top: 16px; font-size: 20px; line-height: 28px; }
.notify { margin-top: 32px; scroll-margin-top: 40vh; }
.note { margin-top: 16px; font-size: 15px; line-height: 22px; }

/* "Unfortunately." arrives a beat after the first line. Once, with no fade,
   and not at all for people who turn motion off. */
@media (prefers-reduced-motion: no-preference) {
  .beat { animation: arrive 1ms 700ms both; }
}
@keyframes arrive {
  from { visibility: hidden; }
  to { visibility: visible; }
}

/* The one action: an email field and a button, as one object. */
.bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 5px 0 16px;
  border-radius: 8px;
  background: var(--ink);
}
.bar input,
.bar label {
  font-size: 15px;
  line-height: 22px;
  color: var(--cream);
}
.bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: none;
  font-family: inherit;
  caret-color: var(--accent);
  appearance: none;
}
.bar input:-webkit-autofill {
  -webkit-text-fill-color: var(--cream);
  box-shadow: 0 0 0 100px var(--ink) inset;
  caret-color: var(--accent);
}
/* The label is the placeholder: it sits over the empty field and steps
   aside once something is typed. It stays the field's name throughout. */
.bar label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  pointer-events: none;
}
.bar label .wide { display: none; }
.bar input:not(:placeholder-shown) + label { clip-path: inset(50%); }
.bar input:autofill + label { clip-path: inset(50%); }
.bar button {
  flex: none;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500; /* Figma says 510; Chrome draws 510 as bold */
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
}

/* Keyboard focus. The only outlines on the page. */
.bar:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.bar button:focus-visible { outline: 2px solid var(--ink); outline-offset: -5px; }

/* After sending: the bar gives way to two lines, same height. */
.done {
  display: none;
  flex-direction: column;
  justify-content: center;
  height: 52px;
  font-size: 15px;
  line-height: 22px;
  outline: 0;
}
.done-title { font-size: 20px; line-height: 28px; font-weight: 590; }
/* .is-done comes from the script. */
.notify.is-done .bar { display: none; }
.notify.is-done .done { display: flex; }
.notify.is-done + .note-hero { visibility: hidden; }

/* When sending fails, one plain line takes the note's place. */
.error { font-size: 15px; line-height: 22px; }
.error:not(:empty) { margin-top: 16px; }
.notify.has-error + .note { display: none; }

/* The two app windows. Pictures of the approved app frames, straight on
   the page, with the app's own shadow. */
.window-inbox { padding: 96px 0 0 var(--m); }
.window-inbox img {
  border-radius: 2.293% 0 0 2.293% / 1.4425% 0 0 1.4425%;
  box-shadow: 0 0.7px 2.1px rgba(51, 42, 38, 0.1), 0 8.4px 22.4px rgba(51, 42, 38, 0.18);
}
.window-empty { padding: 112px var(--m) 0; }
.window-empty img {
  border-radius: 2.143%;
  box-shadow: 0 0.611px 1.832px rgba(51, 42, 38, 0.1), 0 7.329px 19.543px rgba(51, 42, 38, 0.18);
}
.caption { margin-top: 32px; }

/* Three short rows */
.rows { padding-top: 80px; display: grid; gap: 32px; }
.row h2 { font-size: 20px; line-height: 28px; font-weight: 590; }
.row p { margin-top: 4px; }

/* Closing */
.closing { padding-top: 112px; }
.title { font-size: 40px; line-height: 48px; font-weight: 590; }

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 112px;
  padding-bottom: 40px;
  font-size: 15px;
  line-height: 22px;
}
.footer .links { display: flex; flex-wrap: wrap; column-gap: 16px; }

/* Privacy and terms pages */
.text { padding-top: 96px; }
.text p { margin-top: 16px; }
.text .title + p { margin-top: 32px; }
.text h2 { margin-top: 48px; font-size: 20px; line-height: 28px; font-weight: 590; }
.text h2 + p { margin-top: 8px; }

/* Very narrow phones: the button drops under the field, inside the same bar. */
@media (max-width: 359px) {
  .bar { flex-wrap: wrap; gap: 0; height: auto; padding: 0 5px 5px; }
  .bar input { flex: 0 0 100%; height: 47px; padding: 0 11px; }
  .bar label { top: 23.5px; }
  .bar button { width: 100%; }
  .done { height: 94px; }
  h1,
  .title { font-size: 34px; line-height: 42px; }
}

/* Wide screens */
@media (min-width: 720px) {
  .page {
    --m: clamp(24px, 5.556vw, 80px);
    --indent: calc((100% - 2 * var(--m)) * 0.29375);
  }
  body { font-size: 20px; line-height: 28px; }

  .header { padding-top: 40px; }

  .hero { padding-top: 144px; }
  h1 { font-size: clamp(40px, 5vw, 72px); line-height: 1.1111; }
  .lead { margin-top: 24px; font-size: 24px; line-height: 34px; }
  .notify { margin-top: 48px; }

  .bar { max-width: 480px; height: 56px; padding: 0 6px 0 20px; }
  .bar input,
  .bar label { font-size: 17px; line-height: 26px; }
  .bar label { left: 20px; }
  .bar label .wide { display: inline; }
  .bar label .narrow { display: none; }
  .bar button { height: 44px; padding: 0 16px; font-size: 17px; line-height: 26px; }
  .done { height: 56px; }

  .window-inbox { padding: 144px var(--m) 0; }
  .window-empty { padding: 176px var(--m) 0; }
  .window-inbox img,
  .window-empty img {
    box-shadow: 0 1px 3px rgba(51, 42, 38, 0.1), 0 12px 32px rgba(51, 42, 38, 0.18);
  }
  .window-inbox img { border-radius: 0.9375% / 1.4423%; }
  .window-empty img { border-radius: 0.9375% / 1.6854%; }
  .caption { margin-top: 48px; }

  .rows { padding-top: 128px; gap: 40px; }

  .closing { padding-top: 240px; }
  .closing .notify { margin-top: 32px; }

  .footer {
    flex-direction: row;
    justify-content: space-between;
    padding-top: 176px;
    padding-right: max(var(--m), calc(100% - var(--m) - var(--indent) - 656px));
    padding-bottom: 56px;
  }

  .text { padding-top: 144px; }
}

/* Room for the rows to sit side by side */
@media (min-width: 1000px) {
  .row { display: flex; gap: 32px; }
  .row h2 { flex: none; width: 248px; }
  .row p { flex: 1; margin-top: 0; }
}
