/* 46Hz brief: one stylesheet for the three languages. Brand values from the 46Hz design tokens (Warm Paper). */

@font-face {
  font-family: "Brief Round";
  src: url("fonts/NanumSquareRoundOTFR.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Brief Round";
  src: url("fonts/NanumSquareRoundOTFB.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Brief Letter";
  src: url("fonts/MaruBuri-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Brief Letter";
  src: url("fonts/MaruBuri-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}
/* Chinese only: Han characters and the full-width punctuation Chinese sets in its own form. Only the Chinese page (and
   the Chinese line of the 404 page) names this family, so the Korean and English pages never fetch it. */
@font-face {
  font-family: "Brief Han";
  src: url("fonts/ResourceHanRoundedSC-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3001-3002, U+4E00-9FFF, U+FF01, U+FF08-FF09, U+FF0C, U+FF1A-FF1B, U+FF1F;
}
@font-face {
  font-family: "Brief Han";
  src: url("fonts/ResourceHanRoundedSC-Bold.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
  unicode-range: U+3001-3002, U+4E00-9FFF, U+FF01, U+FF08-FF09, U+FF0C, U+FF1A-FF1B, U+FF1F;
}

:root {
  color-scheme: light dark;
  --paper: #faf7f2;
  --sheet: #fcfaf7;
  --stationery: hsl(38 30% 98%);
  --ink: #222834;
  --ink-soft: hsl(218 20% 32%);
  --rule: hsl(216 22% 76%);
  --quiet: hsl(216 20% 90%);
  --sage: #35796e;
  --sage-ink: #ffffff;
  --wave-a: #22776b;
  --wave-b: #35a3a6;
  --wave-c: #5ab8e6;
  --rose: hsl(356 65% 44%);
  --measure: 38rem;
  --wide: 62rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --round: "Brief Round", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --letter: "Brief Letter", "Noto Serif KR", Georgia, serif;
  --code: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f131a;
    --sheet: #181f2a;
    --stationery: hsl(222 18% 14%);
    --ink: #e7ecf3;
    --ink-soft: hsl(218 14% 68%);
    --rule: hsl(222 14% 26%);
    --quiet: hsl(222 14% 17%);
    --sage: #3dbba5;
    --sage-ink: hsl(222 26% 8%);
    --wave-a: #3dbba5;
    --wave-b: #6ccbd6;
    --wave-c: #9ad8f7;
    --rose: hsl(356 70% 64%);
  }
}

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

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

html:lang(ko) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--round);
  font-size: 1.0625rem;
  line-height: 1.75;
}

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

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

:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: var(--code);
  font-size: 0.88em;
  background: var(--quiet);
  padding: 0.08em 0.35em;
  border-radius: 0.3em;
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--sage);
  color: var(--sage-ink);
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  z-index: 10;
}

.skip:focus {
  top: 0.75rem;
}

/* Top bar: the mark and the languages. The way to the service is in the hero right below. */
.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand img {
  width: 2.1rem;
  height: auto;
}

.brand .on-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand .on-light {
    display: none;
  }
  .brand .on-dark {
    display: inline;
  }
}

.bar nav {
  margin-left: auto;
}

.langs {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin-block: 0;
}

.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 0 0.6rem;
  border-radius: 0.75rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.langs a[aria-current="page"] {
  color: var(--ink);
  background: var(--quiet);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--sage);
}

.button.primary {
  background: var(--sage);
  color: var(--sage-ink);
}

.button.quiet {
  color: var(--sage);
  background: transparent;
}

/* Hero: the two waves of the mark, the voice and its echo. The echo draws itself once. */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 6rem) var(--gutter) 0;
}

.hero h1 {
  font-family: var(--letter);
  font-weight: 600;
  font-size: clamp(2.3rem, 6.2vw, 4.4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 15em;
  text-wrap: balance;
}

.hero .lede {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 1.5rem 0 2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.waves {
  display: block;
  width: 100%;
  height: auto;
  margin-top: clamp(2.5rem, 7vw, 4.5rem);
}

.waves .wave-a {
  stop-color: var(--wave-a);
}

.waves .wave-b {
  stop-color: var(--wave-b);
}

.waves .wave-c {
  stop-color: var(--wave-c);
}

.waves .voice {
  stroke: url(#wave-gradient);
}

.waves .echo {
  stroke: url(#wave-gradient);
  opacity: 0.55;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: echo 2.6s cubic-bezier(0.33, 0, 0.2, 1) 0.3s backwards;
}

@keyframes echo {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

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

/* The body runs one column, left aligned, as wide as the hero above it. */
main > section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6rem) var(--gutter) 0;
}

h2,
.page-title {
  font-family: var(--letter);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.45;
  margin: 2.25rem 0 0.5rem;
}

p {
  margin: 0 0 1.1rem;
  text-wrap: pretty;
}

h2,
h3 {
  text-wrap: balance;
}

.note {
  color: var(--ink-soft);
}

.note.after-sheet {
  margin-top: 1.1rem;
}

/* Terms and their explanations (what a feature or a part does). */
dl.terms {
  margin: 1.5rem 0 0;
}

dl.terms dt {
  font-weight: 700;
  margin-top: 1.25rem;
}

dl.terms dd {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
}

/* A real sequence: the path of a submission's origin. */
ol.path {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
}

ol.path li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.75rem 3.25rem;
}

ol.path li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  color: var(--sage);
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

ol.path li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 2.5rem;
  bottom: 0.4rem;
  border-left: 1.5px dashed var(--rule);
}

ol.path strong {
  display: block;
}

/* The layers of the system, top to bottom: who reaches what. */
.layers {
  display: grid;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.layer {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
}

.layer h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.layer p {
  margin: 0;
  color: var(--ink-soft);
}

.layer ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.layer.core {
  border-color: var(--sage);
}

@media (min-width: 52rem) {
  .layers {
    grid-template-columns: repeat(3, 1fr);
  }
  .layer.span {
    grid-column: 1 / -1;
  }
}

/* A stationery sheet for a quoted principle. */
.sheet {
  background: var(--stationery);
  border: 1px solid var(--rule);
  border-radius: 1.125rem;
  padding: 1.5rem 1.6rem;
  margin: 2rem 0 0;
  font-family: var(--letter);
  font-size: 1.15rem;
  line-height: 1.85;
}

.sheet p:last-child {
  margin-bottom: 0;
}

/* A hotline number is read as one unit, so it never breaks at its hyphens. */
.sheet strong {
  white-space: nowrap;
}

ul.plain {
  padding-left: 1.2rem;
  margin: 0 0 1.1rem;
}

ul.plain li {
  margin: 0.35rem 0;
}

.lines {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.lines li {
  padding: 0.65rem 0;
  border-top: 1px solid var(--rule);
}

.lines li:last-child {
  border-bottom: 1px solid var(--rule);
}

.closing {
  text-align: left;
}

.closing .actions {
  margin-top: 1.5rem;
}

footer {
  max-width: var(--wide);
  margin: clamp(4rem, 10vw, 7rem) auto 0;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

footer p {
  margin: 0;
}

html:lang(zh) {
  --round: "Brief Han", "Brief Round", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --letter: "Brief Han", "Brief Letter", "Noto Serif KR", Georgia, serif;
}

p[lang="zh-Hans"] {
  font-family: "Brief Han", var(--round);
}

/* The 404 page's links are its only way on, so they keep the 44px target too. */
.page-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Footer links stand on their own, so they keep the 44px target the page promises. */
footer p a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

footer .langs {
  margin-left: 0;
}
