/* labellingo.com. Colors and type follow the app (mobile/lib/app/theme). */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/DMSans.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --canvas: #f6f5f1;
  --surface: #ffffff;
  --surface-muted: #efeee8;
  --hairline: #e4e2da;
  --ink: #15201d;
  --ink-muted: #5b6764;
  --ink-subtle: #8a9490;
  --accent: #0b6e5f;
  --on-accent: #ffffff;
  --accent-soft: #e2f0eb;
  --on-accent-soft: #0a4f44;
  --highlight: #ffb547;
  --highlight-soft: #fff2dc;
  --on-highlight-soft: #6b4500;
  --label-paper: #fbf8ef;
  --label-ink: #2c2a24;
  --shadow: 0 1px 2px rgb(16 32 29 / 6%), 0 12px 32px rgb(16 32 29 / 8%);

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0d1412;
    --surface: #141c1a;
    --surface-muted: #1b2522;
    --hairline: #25302d;
    --ink: #edf2f0;
    --ink-muted: #a3b0ac;
    --ink-subtle: #75837f;
    --accent: #5cc8ae;
    --on-accent: #04201b;
    --accent-soft: #133a33;
    --on-accent-soft: #b8e8db;
    --highlight: #ffc066;
    --highlight-soft: #3a2c12;
    --on-highlight-soft: #ffdfa8;
    --label-paper: #e9e4d6;
    --label-ink: #2c2a24;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 35%);
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Header and footer */

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
}

.brand img {
  display: block;
  height: 30px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}

.site-nav > a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.site-nav > a:hover {
  color: var(--accent);
}

.lang {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
}

.lang > * {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-muted);
}

.lang [aria-current] {
  background: var(--accent-soft);
  color: var(--on-accent-soft);
}

.site-footer {
  /* A hairline as wide as the content, not the padding. */
  background: linear-gradient(var(--hairline), var(--hairline)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  margin-top: 72px;
  padding-block: 32px 48px;
  font-size: 15px;
  color: var(--ink-muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 12px;
}

.site-footer nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--accent);
}

.site-footer p {
  margin: 4px 0;
}

.fine {
  color: var(--ink-subtle);
  font-size: 14px;
}

/* Landing */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding-block: clamp(24px, 6vw, 72px) clamp(40px, 6vw, 88px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.02;
}

.hero-lead {
  margin: 24px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-muted);
}

.cta {
  margin-top: 32px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--canvas);
  cursor: default;
}

.store-badge svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.store-badge > span {
  display: flex;
  flex-direction: column;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.store-badge small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

.cta-note {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-subtle);
}

/* Hero illustration: a foreign label in the viewfinder, and its explanation. */

.hero-art {
  display: flex;
  flex-direction: column;
  max-width: 460px;
  justify-self: center;
  width: 100%;
}

.viewfinder {
  position: relative;
  padding: 18px;
  width: 82%;
}

.viewfinder::before,
.viewfinder::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 5px solid var(--accent);
  border-radius: 22px;
  /* Only the four corners of the frame show. */
  mask:
    linear-gradient(#000 0 0) top left / 44px 44px no-repeat,
    linear-gradient(#000 0 0) top right / 44px 44px no-repeat,
    linear-gradient(#000 0 0) bottom right / 44px 44px no-repeat;
}

.viewfinder::after {
  border-color: var(--highlight);
  mask: linear-gradient(#000 0 0) bottom left / 44px 44px no-repeat;
}

.label-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--label-paper);
  color: var(--label-ink);
  font: 500 15px/1.65 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', var(--sans);
  transform: rotate(-2deg);
  box-shadow: var(--shadow);
}

.label-card p {
  margin: 0;
}

.label-card .label-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 36px;
  background: linear-gradient(to bottom, transparent, rgb(255 181 71 / 35%));
  border-bottom: 2px solid var(--highlight);
  animation: scan 3.2s ease-in-out infinite;
}

@keyframes scan {
  0% {
    transform: translateY(-40px);
  }
  60%,
  100% {
    transform: translateY(190px);
  }
}

.result-card {
  position: relative;
  align-self: flex-end;
  margin-top: -28px;
  width: 72%;
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.result-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
}

.result-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--hairline);
}

.result-card .src {
  min-width: 4.6em;
  color: var(--ink-subtle);
  font-size: 13px;
}

.flag {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--highlight-soft);
  color: var(--on-highlight-soft);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.diet {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.diet span {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
}

/* Landing sections */

.section {
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--hairline);
}

.section > h2 {
  margin: 0 0 32px;
  font-size: clamp(28px, 3.6vw, 40px);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.steps h3,
.features h3 {
  margin: 0 0 6px;
  font-size: 21px;
}

.steps p,
.features p {
  margin: 0;
  color: var(--ink-muted);
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.features article {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  font-size: 19px;
}

.checks li {
  position: relative;
  padding-left: 36px;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.checks li::after {
  content: '';
  position: absolute;
  left: 8px;
  top: calc(0.2em + 5px);
  width: 6px;
  height: 11px;
  border: solid var(--accent);
  border-width: 0 2.4px 2.4px 0;
  transform: rotate(45deg);
}

.note p {
  max-width: 44em;
  margin: 0;
  color: var(--ink-muted);
}

.note > h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

/* Legal and support pages */

.doc {
  max-width: 46em;
  margin-inline: auto;
  padding-block: clamp(16px, 4vw, 48px);
}

.doc h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
}

.doc-meta {
  margin: 8px 0 0;
  color: var(--ink-subtle);
  font-size: 15px;
}

.doc h2 {
  margin: 48px 0 12px;
  font-size: 26px;
  scroll-margin-top: 16px;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 19px;
}

.doc p,
.doc li {
  color: var(--ink);
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
}

.doc li + li {
  margin-top: 6px;
}

.lead {
  margin-top: 24px;
  font-size: 19px;
  color: var(--ink-muted) !important;
}

.summary,
.callout {
  margin: 32px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--on-accent-soft);
}

.summary h2,
.callout h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.summary li,
.summary p,
.callout p {
  color: var(--on-accent-soft) !important;
}

.callout {
  background: var(--highlight-soft);
  color: var(--on-highlight-soft);
}

.callout p {
  color: var(--on-highlight-soft) !important;
  margin: 0;
}

.summary a,
.callout a {
  color: inherit;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}

.doc th {
  font-weight: 600;
  color: var(--ink-muted);
}

details {
  border-bottom: 1px solid var(--hairline);
}

details summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: '+';
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

details[open] summary::after {
  content: '−';
}

details p {
  margin: 0 0 16px;
  color: var(--ink-muted) !important;
}

/* Narrow screens */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .steps,
  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 12px;
  }

  .brand img {
    height: 26px;
  }

  .result-card {
    width: 86%;
  }
}

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