@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --paper: #f7f5f0;
  --sheet: #ffffff;
  --ink: #14171c;
  --ink-soft: #5c626b;
  --ink-faint: #8f949c;
  --rule: #e2ded4;

  /* SwarmBase brand. Both source colours are far too light to carry text
     (1.9:1 and 1.8:1 against white, where 4.5 is the minimum), so they appear
     only as fills and graphics. Text and accents use a darkened teal from the
     same family at 7.1:1. */
  --brand-a: #55d532;
  --brand-b: #02d5ff;
  --brand-grad: linear-gradient(115deg, var(--brand-a), var(--brand-b));

  --accent: #0b6357;
  --accent-wash: #ebf7f2;
  --accent-edge: #cfe8dd;
  --accent-deep: #08312b;
  --slate: #2c3a3f;

  --measure: 27rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, #55d532, #02d5ff) 1;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system,
    BlinkMacSystemFont, system-ui, 'Malgun Gothic', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

/* ---------- masthead ---------- */

.titlegroup {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brandmark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex: 0 0 auto;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.langtoggle {
  background: none;
  border: 0;
  padding: 0.35rem 0.15rem;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.langtoggle:hover { color: var(--ink); }

.lede {
  margin: 1.15rem 0 1.75rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---------- lookup ---------- */

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.field .hint {
  display: block;
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

input[type='text'] {
  width: 100%;
  padding: 0.85rem 0.9rem;
  font: inherit;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

input[type='text']:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 1px;
  border-color: var(--slate);
}

button.primary {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fbf9f4;
  background: var(--accent);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

button.primary:hover { background: #094c43; }
button.primary:disabled { opacity: 0.55; cursor: default; }
button.primary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.error {
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  background: var(--sheet);
  border-left: 3px solid #9d3b34;
  color: #7c2f29;
  font-size: 0.98rem;
}

/* ---------- result ---------- */

.result { margin-top: 2rem; }
.result[hidden] { display: none; }

.orderline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.orderline .num {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.03em;
}

/* the one loud element on the page */
.headline {
  margin-top: 1.5rem;
  padding: 1.4rem 1.35rem 1.5rem;
  background: var(--accent-wash);
  border-radius: 4px;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #55d532, #02d5ff) 1;
}

.headline .cap {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.98rem;
}

.headline .krw {
  margin-top: 0.35rem;
  font-size: 2.35rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
  word-break: keep-all;
}

.headline .tokens {
  margin-top: 0.4rem;
  color: #14554a;
  font-size: 1.05rem;
}

.headline .asof {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--accent-edge);
  color: #2f6b5f;
  font-size: 0.86rem;
  line-height: 1.5;
}

.pair {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}

.pair .k { color: var(--ink-soft); }
.pair .k small { display: block; color: var(--ink-faint); font-size: 0.85rem; }
.pair .v { text-align: right; font-weight: 600; white-space: nowrap; }
.pair .v small {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* ---------- schedule ---------- */

.section { margin-top: 2rem; }

h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.bar {
  height: 10px;
  background: #e8e4da;
  border-radius: 5px;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--brand-grad);
  border-radius: 5px;
}

.barnote {
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.status {
  margin-top: 1rem;
  font-size: 1.02rem;
  word-break: keep-all;
}

.status.warn {
  padding: 0.85rem 0.95rem;
  background: var(--sheet);
  border-left: 3px solid var(--accent);
}

.dates { margin-top: 1.1rem; }

/* ---------- notes ---------- */

.note {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  word-break: keep-all;
}

.note.guard {
  padding: 0.85rem 0.95rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink);
}

/* ---------- details ---------- */

details { margin-top: 2rem; border-top: 1px solid var(--rule); }

summary {
  padding: 0.9rem 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.95rem;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary::after { content: ' +'; }
details[open] summary::after { content: ' −'; }
summary:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }

.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--ink-soft);
}

.detailrow { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.detailrow .k { font-size: 0.9rem; color: var(--ink-faint); }

.links { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.links a { color: var(--slate); font-size: 0.95rem; }

footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 380px) {
  body { font-size: 16px; }
  .headline .krw { font-size: 1.95rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .bar > i { transition: width 420ms ease-out; }
}

/* ---------- staircase payout schedule ---------- */

.nextup {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  background: var(--accent-wash);
  border-radius: 3px;
  color: var(--accent-deep);
  font-size: 1rem;
  word-break: keep-all;
}

ol.steps {
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
}

.step {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.85rem 0 0.85rem 1.15rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

/* the riser of the staircase */
.step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.35rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.step.upcoming::before { background: #a9cfc2; }
.step.cancelled::before { background: var(--ink-faint); }

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

.step .tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  font-size: 0.78rem;
  background: var(--accent-wash);
  color: var(--accent);
  vertical-align: 1px;
}

.step.upcoming .tag { background: #eeeae0; color: var(--ink-soft); }
.step.cancelled .tag { background: #eeeae0; color: var(--ink-faint); }

.step .what {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.step .what small {
  display: block;
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.step.cancelled .when,
.step.cancelled .what {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.step.cancelled .what small { text-decoration: none; }
