/* Styles of the product site. The site loads no file from another host. Every page loads the script of the theme switch. */
/* The home page loads the motion script, and the report page loads the script of its form. */
@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

/* Each color holds its light value and its dark value. The page follows the theme of the system. */
/* The theme switch sets the `data-theme` attribute, which fixes one theme. */
:root {
  color-scheme: light dark;
  --font-reading: "Lora", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans CJK SC", "Hiragino Sans", "Malgun Gothic", sans-serif;
  --page: light-dark(oklch(0.985 0.004 262), oklch(0.17 0.022 262));
  --surface: light-dark(#ffffff, oklch(0.215 0.028 262));
  --tint: light-dark(oklch(0.955 0.02 262), oklch(0.235 0.04 262));
  --text: light-dark(oklch(0.2 0.03 262), oklch(0.95 0.008 262));
  --muted: light-dark(oklch(0.44 0.03 262), oklch(0.77 0.025 262));
  --line: light-dark(oklch(0.89 0.014 262), oklch(0.32 0.03 262));
  --accent: light-dark(#1d5fd1, #8db5ff);
  --band: light-dark(#1d5fd1, oklch(0.34 0.13 262));
  --seal: #f0834f;
  --seal-ink: #3b1605;
  --status: light-dark(#fff4d6, #3a3115);
  --status-line: light-dark(#e2c36a, #7d6a2a);
  --device: light-dark(oklch(0.24 0.03 262), oklch(0.4 0.035 262));
  --gutter: clamp(20px, 5vw, 48px);
  --max: 1080px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* A visit to another page of the site fades from one page to the next. */
@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 17px/1.6 var(--font-body);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 150ms;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

p {
  margin: 0 0 14px;
  text-wrap: pretty;
}

/* Headings use Lora, the font of Mailglade. Lora has no glyphs for Japanese, Korean, and Chinese, so those languages keep the font of the page. */
h1,
h2,
h3,
.promise,
.mail-subject {
  font-family: var(--font-reading);
  font-weight: 500;
  text-wrap: balance;
}

:lang(ja) :is(h1, h2, h3, .promise, .mail-subject),
:lang(ko) :is(h1, h2, h3, .promise, .mail-subject),
:lang(zh) :is(h1, h2, h3, .promise, .mail-subject) {
  font-family: inherit;
  font-weight: 600;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(2.1rem, 4vw + 1rem, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.7rem, 2.4vw + 1rem, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  line-height: 1.25;
}

ul,
ol {
  margin: 0 0 14px;
  padding-left: 1.3em;
}

li {
  margin-bottom: 8px;
}

/* The header: the name of the site, the links to the legal pages, and the theme switch. */
.top {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 600 1.2rem var(--font-reading);
  text-decoration: none;
}

.mark {
  flex: none;
  border-radius: 7px;
}

.links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.95rem;
}

.links a {
  color: var(--text);
  text-decoration-color: transparent;
}

.links a:hover {
  text-decoration-color: currentColor;
}

/* The theme switch shows the icon of the theme that a click switches to: a moon in the light theme, a sun in the dark theme. */
.theme {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 150ms, transform 300ms var(--ease);
}

.links + .theme {
  margin-left: 0;
}

.theme:hover {
  background: color-mix(in oklch, currentColor 12%, transparent);
  transform: rotate(18deg);
}

.theme .sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .moon {
    display: none;
  }

  :root:not([data-theme="light"]) .theme .sun {
    display: block;
  }
}

:root[data-theme="dark"] .theme .moon {
  display: none;
}

:root[data-theme="dark"] .theme .sun {
  display: block;
}

/* The band of the home page: one color from edge to edge. Its lower edge has the shape of an envelope flap. */
.band {
  --text: #ffffff;
  --line: rgb(255 255 255 / 0.4);
  --accent: #ffffff;
  padding-bottom: clamp(64px, 10vw, 136px);
  background: var(--band);
  color: #ffffff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - clamp(28px, 5vw, 76px)), 50% 100%, 0 calc(100% - clamp(28px, 5vw, 76px)));
}

.band .mark {
  box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.55);
}

.band .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 56px) var(--gutter) 0;
}

.band h1 {
  font-size: clamp(2.5rem, 5vw + 0.8rem, 4.6rem);
  line-height: 1.03;
}

.lede {
  max-width: 34em;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.5;
}

.band .lede {
  color: rgb(255 255 255 / 0.88);
}

.status {
  display: inline-block;
  margin: 8px 0 0;
  padding: 8px 14px;
  border: 1px solid var(--status-line);
  border-radius: 999px;
  background: var(--status);
  font-size: 0.95rem;
}

/* The picture of the home page. Its colors stay the same in both themes, because the band keeps its color. */
.hero-scene {
  margin: 0;
}

.hero-scene figcaption {
  max-width: 26em;
  margin: 14px auto 0;
  color: rgb(255 255 255 / 0.88);
  font-size: 0.95rem;
  text-align: center;
}

.scene {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.env-back {
  fill: #c5d6f8;
}

.flap-up {
  fill: #dbe6fb;
  stroke: #afc5f1;
  stroke-width: 2;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(0);
}

.letter {
  transform: translateY(16px);
}

.letter rect {
  fill: #ffffff;
  stroke: #afc5f1;
  stroke-width: 2;
}

.letter-subject {
  stroke: #1d5fd1;
  stroke-width: 9;
  stroke-linecap: round;
}

.letter-line {
  fill: none;
  stroke: #c5d1ea;
  stroke-width: 7;
  stroke-linecap: round;
}

.env-front {
  fill: #ffffff;
}

.env-fold {
  fill: none;
  stroke: #d3dff6;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.flap-down {
  fill: #f2f6fe;
  stroke: #c5d6f8;
  stroke-width: 2.5;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: 50% 0;
  filter: drop-shadow(0 3px 4px rgb(16 45 110 / 0.2));
}

.seal,
.seal-ring {
  transform-box: fill-box;
  transform-origin: center;
}

.seal circle {
  fill: var(--seal);
}

.seal .seal-rim {
  fill: none;
  stroke: rgb(255 255 255 / 0.5);
  stroke-width: 2;
}

.seal-key {
  fill: #17479f;
}

.seal-ring {
  fill: none;
  stroke: var(--seal);
  stroke-width: 3;
  opacity: 0;
}

.link-pill rect {
  fill: rgb(255 255 255 / 0.12);
  stroke: rgb(255 255 255 / 0.55);
  stroke-width: 1.5;
}

.link-pill text {
  fill: #ffffff;
  font: 500 17px var(--font-body);
}

.link-pill .link-key {
  fill: #ffd2b8;
  font-weight: 700;
}

/* The sections of the home page run from edge to edge, and their content keeps one width. */
.home main > section {
  padding: clamp(56px, 8vw, 112px) max(var(--gutter), calc(50% - var(--max) / 2));
}

/* The three steps hang on one thread, each under a numbered seal. */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 56px);
  margin: clamp(28px, 4vw, 48px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps::before {
  content: "";
  position: absolute;
  top: 19px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--line);
}

.steps li {
  position: relative;
  margin: 0;
  padding-top: 64px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 0 8px var(--page), inset 0 0 0 3px rgb(255 255 255 / 0.35);
  color: var(--seal-ink);
  font: 600 1.05rem var(--font-reading);
  transition: transform 400ms var(--ease);
}

.steps li:hover::before {
  transform: rotate(-12deg) scale(1.08);
}

.steps p {
  max-width: 30em;
  margin: 0;
  color: var(--muted);
}

/* The promise of the product. On the home page it is a statement in the heading font. On other pages it is a notice. */
.promise {
  padding: 14px 18px;
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  border-radius: 12px;
  background: var(--tint);
  font-family: var(--font-body);
  font-weight: 600;
}

.privacy {
  background: var(--tint);
}

.privacy .promise {
  max-width: 26em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 clamp(1.2rem, 1vw + 1rem, 1.5rem) / 1.4 var(--font-reading);
}

/* Two sheets show one email: as the reader sees it, and as the server stores it. */
.sheets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 36px);
  margin: clamp(28px, 4vw, 48px) 0;
}

.sheet {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.sheet figcaption {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.mail {
  flex: 1;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 48px -36px rgb(20 40 90 / 0.45);
}

.mail-subject {
  margin: 0 0 10px;
  font-size: 1.3rem;
  line-height: 1.3;
}

.mail-text {
  margin: 0 0 16px;
}

.mail-file {
  display: inline-block;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
}

.cipher {
  background: color-mix(in oklch, var(--surface) 55%, transparent);
  box-shadow: none;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.cipher .mail-subject {
  font: 600 1rem / 1.5 inherit;
  font-family: inherit;
}

.cipher .mail-file {
  border-style: dashed;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 3vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* The picture of a phone stands next to its text. */
.home main > .anywhere {
  padding-block: clamp(40px, 6vw, 80px);
}

.anywhere {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(28px, 6vw, 96px);
}

.anywhere p {
  max-width: 28em;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.5;
}

.phone {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 30px 40px rgb(20 40 90 / 0.25));
}

.phone-body {
  fill: var(--device);
}

.phone-screen {
  fill: var(--surface);
}

.phone-bar {
  fill: #1d5fd1;
}

.phone-seal {
  fill: var(--seal);
}

.phone-brand {
  stroke: rgb(255 255 255 / 0.92);
  stroke-width: 8;
  stroke-linecap: round;
}

.phone-lines path {
  stroke: var(--line);
  stroke-width: 9;
  stroke-linecap: round;
}

.phone-lines .phone-subject {
  stroke: var(--text);
  stroke-width: 11;
}

.phone-file {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
}

/* The free tier: the title on one side, the two sentences on the other. */
.ledger {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(16px, 6vw, 96px);
  border-top: 1px solid var(--line);
}

.ledger p {
  max-width: 34em;
  color: var(--muted);
  font-size: 1.1rem;
}

/* The announcement of the paid plan stands apart from the facts of the free plan. */
.ledger .pro {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-reading);
  font-size: 1.2rem;
}

:lang(ja) .ledger .pro,
:lang(ko) .ledger .pro,
:lang(zh) .ledger .pro {
  font-family: inherit;
}

footer {
  padding: 36px max(var(--gutter), calc(50% - var(--max) / 2)) 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.langs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.langs li {
  margin: 0;
}

.langs a[aria-current="page"] {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

/* The pages for reading: the two legal pages, the report page, and the 404 page. */
.legal main {
  max-width: calc(46rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}

.legal .hero {
  padding: clamp(28px, 6vw, 72px) 0 8px;
}

.legal h2 {
  margin: 48px 0 12px;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.legal main li {
  margin-bottom: 12px;
}

.updated {
  color: var(--muted);
  font-size: 0.92rem;
}

.short {
  margin-top: 28px;
  padding: 26px 28px 14px;
  border-radius: 18px;
  background: var(--tint);
}

.legal .short h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.contact {
  margin-top: 40px;
  color: var(--muted);
}

/* The report form. */
.report {
  margin: 24px 0;
}

.report label {
  display: block;
  margin: 18px 0 6px;
  font-weight: 600;
}

.report input,
.report select,
.report textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.report input:focus-visible,
.report select:focus-visible,
.report textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.report textarea {
  resize: vertical;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.report button {
  margin-top: 22px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--page);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms var(--ease);
}

.report button:active {
  transform: scale(0.97);
}

.report button:disabled {
  opacity: 0.6;
  cursor: default;
}

.report-status {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.report-status[data-state="done"] {
  border-color: var(--accent);
  background: var(--tint);
}

.report-status[data-state="failed"] {
  border-color: var(--status-line);
  background: var(--status);
}

.legal main > .status {
  border-radius: 10px;
}

/* A narrow window stacks the columns, and the links of the header move to the footer only. */
@media (max-width: 820px) {
  .band .hero,
  .anywhere,
  .ledger {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .steps::before {
    top: 0;
    right: auto;
    bottom: 0;
    left: 19px;
    width: 2px;
    height: auto;
  }

  .steps li {
    padding: 4px 0 0 64px;
  }
}

@media (max-width: 640px) {
  .links {
    display: none;
  }

  .links + .theme {
    margin-left: auto;
  }
}

/* Motion. Every part has its final state without it, so a visitor who asks for less motion gets the same page. */
@media (prefers-reduced-motion: no-preference) {
  /* The opening of the home page: the text rises, the email goes into the envelope, the seal closes it, and the link appears. */
  .hero-text > * {
    animation: rise 800ms var(--ease) both;
  }

  .hero-text > :nth-child(2) {
    animation-delay: 90ms;
  }

  .letter {
    animation: letter-in 1100ms var(--ease) 350ms both;
  }

  .flap-up {
    animation: flap-up 360ms cubic-bezier(0.5, 0, 0.75, 0) 1300ms both;
  }

  .flap-down {
    animation: flap-down 520ms var(--ease) 1660ms both;
  }

  .seal {
    animation: seal-stamp 560ms var(--ease) 2180ms both;
  }

  .seal-ring {
    animation: seal-ring 900ms var(--ease) 2380ms both;
  }

  .link-pill {
    animation: rise 700ms var(--ease) 2750ms both;
  }

  .hero-scene figcaption {
    animation: fade 700ms ease-out 3100ms both;
  }

  .scene-float {
    animation: float 6s ease-in-out 3800ms infinite alternate;
  }

  /* The motion script adds the `seen` class when a part scrolls into view. */
  .phone.seen {
    animation: phone-in 900ms var(--ease) both;
  }

  .phone.seen .phone-lines > * {
    animation: rise-small 600ms var(--ease) both;
  }

  .phone.seen .phone-lines > :nth-child(1) { animation-delay: 250ms; }
  .phone.seen .phone-lines > :nth-child(2) { animation-delay: 320ms; }
  .phone.seen .phone-lines > :nth-child(3) { animation-delay: 390ms; }
  .phone.seen .phone-lines > :nth-child(4) { animation-delay: 460ms; }
  .phone.seen .phone-lines > :nth-child(5) { animation-delay: 530ms; }
  .phone.seen .phone-lines > :nth-child(6) { animation-delay: 600ms; }
  .phone.seen .phone-lines > :nth-child(7) { animation-delay: 670ms; }

  .sheets.seen .sheet-server .mail {
    animation: settle 1400ms var(--ease) both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

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

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes letter-in {
  from {
    transform: translateY(-150px);
  }
}

@keyframes flap-up {
  from {
    transform: scaleY(1);
  }
}

@keyframes flap-down {
  from {
    transform: scaleY(0);
  }
}

@keyframes seal-stamp {
  from {
    opacity: 0;
    transform: scale(1.9) rotate(-18deg);
  }

  55% {
    opacity: 1;
  }
}

@keyframes seal-ring {
  from {
    opacity: 0.7;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.75);
  }
}

@keyframes float {
  to {
    transform: translateY(-8px);
  }
}

@keyframes phone-in {
  from {
    opacity: 0;
    transform: translateY(36px) rotate(5deg);
  }
}

@keyframes settle {
  from {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 25%, transparent);
  }
}
