/* Shared frame for every page: tokens, header, navigation, page scaffolding and footer. */
@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Jua&display=swap');

:root {
  color-scheme: light;
  --ink: #33432f;
  --muted: #66755c;
  --green: #5f8540;
  --green-dark: #47682f;
  --leaf: #e6f0d6;
  --line: #bccba6;
  --paper: #fffef6;
  --bg: #f6f7ea;
  --accent: #e89a3c;
  --shadow: #dbe4c9;
  --nav-height: 64px;
  --header-clearance: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  /* Column layout keeps the footer at the bottom of the window on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: Jua, sans-serif; font-weight: 400; line-height: 1.3; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 30; background: var(--paper); border: 2px solid var(--green); padding: 8px 14px; }
.skip-link:focus { top: 8px; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 8px max(16px, calc((100% - 1160px) / 2));
  background: #fbfcf2f2; backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font: 20px Jua, sans-serif; white-space: nowrap; min-height: 44px; }
.brand b { font-weight: 400; color: var(--green); }
.account-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 4px 10px;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--green-dark);
  font: 16px Jua, sans-serif; white-space: nowrap;
}
.account-link:hover, .account-link[aria-current='page'] { background: var(--leaf); }
.account-link.is-signed-in { flex: none; width: clamp(104px, 10vw, 150px); }
.account-link-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-nav { display: flex; gap: 8px; }
.product-nav a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 14px;
  border: 2px solid #d6ac69; border-radius: 12px;
  background: #ffe9b7; color: #543c20;
  font: 17px Jua, sans-serif; white-space: nowrap;
}
.product-nav a:last-child { background: #e7efd6; border-color: #a1b786; color: #334d2d; }
.product-nav a:hover, .product-nav a[aria-current='page'] {
  border-color: currentColor;
  box-shadow: inset 0 -3px 0 #77654122;
}
.site-nav { margin-left: auto; display: flex; gap: 6px; }
.site-nav a {
  display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 14px;
  border: 2px solid transparent; border-radius: 12px;
  font-size: 15px; color: var(--muted); white-space: nowrap;
}
.site-nav a:hover { background: var(--leaf); color: var(--green-dark); }
.site-nav a[aria-current='page'] { background: var(--leaf); border-color: var(--line); color: var(--green-dark); font-weight: bold; }
.nav-short { display: none; }

/* Page scaffolding */
main { flex: 1 0 auto; width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 16px 48px; }
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: #fff3d6; border: 2px dashed #e2b662; color: #94661a; font-size: 14px;
}
.page-hero { text-align: center; padding: 28px 8px 30px; }
.page-hero .hero-icon { font-size: 52px; line-height: 1.2; }
.page-hero h1 { font-size: clamp(30px, 6vw, 42px); margin: 10px 0 12px; }
.page-hero p { max-width: 620px; margin: 0 auto; color: var(--muted); }
.page-hero .badge { margin-top: 10px; }

.panel { background: var(--paper); border: 2px solid var(--line); border-radius: 16px; box-shadow: 5px 5px 0 var(--shadow); padding: 22px; margin-top: 24px; }
.panel > h2 { font-size: 24px; margin-bottom: 6px; }
.panel > p { color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 16px; padding: 0; list-style: none; }
.card { border: 2px solid #dfe6cf; border-radius: 14px; background: #fbfcf3; padding: 14px; }
.card h3 { font-size: 18px; margin: 10px 0 2px; }
.card p { font-size: 14px; color: var(--muted); }
.card .thumb { aspect-ratio: 4 / 3; border-radius: 10px; background: var(--leaf); display: grid; place-items: center; font-size: 40px; overflow: hidden; }
.card .thumb img { width: 70%; height: 90%; object-fit: contain; image-rendering: pixelated; }
.sticker-back-thumb { position: relative; }
.card .sticker-back-thumb img { position: absolute; inset: 0; margin: auto; height: 88%; }
.placeholder { border: 2px dashed var(--line); border-radius: 14px; background: #f9faef; color: var(--muted); display: grid; place-items: center; text-align: center; padding: 28px 16px; margin-top: 16px; min-height: 180px; }
.placeholder .big { font-size: 40px; line-height: 1.3; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; border: 2px solid #dfe6cf; border-radius: 14px; background: #fbfcf3; padding: 14px 14px 14px 58px; position: relative; font-size: 15px; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; font: 18px/32px Jua, sans-serif; text-align: center; }
.steps b { display: block; font: 18px Jua, sans-serif; font-weight: 400; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 8px 20px; border-radius: 14px;
  background: var(--green); border: 2px solid var(--green-dark); color: #fffef0;
  box-shadow: 0 4px 0 var(--green-dark); font: 18px Jua, sans-serif;
}
.button:hover { background: var(--green-dark); }
.button:disabled, .button[aria-disabled='true'] { opacity: .5; cursor: not-allowed; }
.button.quiet { background: var(--paper); color: var(--green-dark); border-color: var(--line); box-shadow: 0 4px 0 var(--shadow); }
.button.quiet:hover { background: var(--leaf); }
.page-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }

.site-footer { padding: 22px max(16px, calc((100% - 1160px) / 2)); background: #5a7441; color: #edf2df; display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 17px Jua, sans-serif; }

@media (min-width: 761px) and (max-width: 1240px) {
  .site-header { gap: 10px; }
  .product-nav a { padding-inline: 7px; font-size: 16px; }
  .site-nav { gap: 0; }
  .site-nav a { padding-inline: 7px; }
  .nav-long { display: none; }
  .nav-short { display: block; }
}

@media (min-width: 761px) and (max-width: 980px) {
  .product-nav a { padding-inline: 4px; font-size: 15px; }
  .site-nav .nav-icon { display: none; }
  .site-header { gap: 4px; padding-inline: 8px; }
  .site-nav a { padding-inline: 4px; }
}

/* Phones: the navigation becomes a bottom tab bar with large touch targets. */
@media (max-width: 760px) {
  :root { --header-clearance: 114px; }
  .site-header {
    display: grid; gap: 0; justify-content: stretch; justify-items: center;
    grid-template-columns: 1fr auto;
    padding: 0 10px 7px; backdrop-filter: none;
  }
  .product-nav { grid-column: 1 / -1; width: min(100%, 440px); display: grid; grid-template-columns: auto 1fr; }
  .account-link { grid-row: 1; grid-column: 2; min-height: 36px; }
  .product-nav a { padding-inline: 4px; font-size: clamp(14px, 4.2vw, 17px); }
  .brand { font-size: 18px; justify-self: start; }
  .site-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fbfcf2; border-top: 2px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .site-nav a { flex-direction: column; gap: 0; min-height: var(--nav-height); padding: 6px 2px; border: 0; border-radius: 0; font-size: 12px; line-height: 1.3; justify-content: center; }
  .site-nav a[aria-current='page'] { box-shadow: inset 0 4px 0 var(--green); }
  .nav-icon { font-size: 22px; }
  .nav-long { display: none; }
  .nav-short { display: block; }
  main { padding: 12px 10px 32px; }
  .panel { padding: 16px; box-shadow: 3px 3px 0 var(--shadow); }
  .site-footer { padding-bottom: calc(22px + var(--nav-height) + env(safe-area-inset-bottom)); font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
