:root {
  color-scheme: light dark;
  --bg: #edf0ee;
  --ink: #1e2b2a;
  --muted: #5d6b69;
  --line: #c9d1ce;
  --link: #2f5bd3;
  --note: #f5c84b;
  --note-ink: #1e2b2a;
  --tile: #1e2b2a;
  --tile-ink: #edf0ee;
  --danger: #c2410c;
  --danger-soft: #fbe7dc;
  --display: "Bricolage Grotesque", "Pretendard Variable", system-ui, sans-serif;
  --body: "Instrument Sans", "Pretendard Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a1a;
    --ink: #e6ecea;
    --muted: #97a5a2;
    --line: #2c3736;
    --link: #8fa8ff;
    --note: #e8b93a;
    --note-ink: #141a1a;
    --tile: #223030;
    --tile-ink: #e6ecea;
    --danger: #fb923c;
    --danger-soft: #3a2418;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body:lang(ko) { word-break: keep-all; }
html:lang(ja) {
  --display: "Bricolage Grotesque", "Pretendard JP Variable", system-ui, sans-serif;
  --body: "Instrument Sans", "Pretendard JP Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, .track:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
ul { list-style: none; margin: 0; padding: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: clamp(20px, 4vw, 48px); }

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 22px; font-size: 15px; }
.by { color: var(--ink); font-weight: 600; text-decoration: none; }
.by:hover { text-decoration: underline; }
.languages { display: flex; gap: 14px; }
.languages a { color: var(--muted); text-decoration: none; }
.languages a[aria-current] { color: var(--ink); font-weight: 600; }
.languages a:hover { color: var(--ink); }

/* intro */
.intro { padding-block: 36px 4px; max-width: 46rem; }
h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 80;
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: .98;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin: 0 0 10px;
}
h1:lang(ko), h1:lang(ja) { font-variation-settings: normal; line-height: 1.12; letter-spacing: -.03em; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 44rem; margin: 0; text-wrap: pretty; }
.lead .sentence { display: inline-block; }
/* justified text: hyphenate English so the spacing stays even. Korean keeps whole words, which leaves
   wide gaps when justified, so it stays left-aligned. Japanese has no spaces, so it justifies evenly without hyphens */
.lead, .card .what, .slide-text .what { text-align: justify; hyphens: auto; }
:lang(ko) .lead, :lang(ko) .card .what, :lang(ko) .slide-text .what { text-align: start; hyphens: manual; }
:lang(ja) .lead, :lang(ja) .card .what, :lang(ja) .slide-text .what { hyphens: manual; }
.from-note {
  display: inline-block;
  background: var(--note);
  color: var(--note-ink);
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  margin: 14px 0 0;
  transform: rotate(-1deg);
}

.from-note[hidden] { display: none; }

/* shared bits */
.thumb { display: block; width: 100%; height: auto; aspect-ratio: 960 / 504; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--tile); }
.thumb-type { display: flex; align-items: flex-end; padding: 6% 7%; overflow: hidden; color: var(--tile-ink); border-color: transparent; }
.thumb-type span {
  font-family: var(--display);
  font-variation-settings: "wdth" 75;
  font-weight: 800;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: .9;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.what { margin: 0; max-width: 36rem; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 0; font-weight: 500; }
.try { background: var(--note); color: var(--note-ink); text-decoration: none; padding: 7px 16px; border-radius: 4px; font-weight: 600; }
.try:hover { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }

/* carousel of projects with their own site */
.carousel { margin-top: 40px; }
.carousel-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.carousel-head h2, .section-h { font-family: var(--body); font-size: 15px; font-weight: 600; margin: 0; }
.carousel-controls { display: flex; gap: 8px; }
.step {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.step:hover { border-color: var(--ink); }
.step svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding: 2px;
}
.slide-shot { display: block; }
.slide-shot .thumb { border-radius: 10px; }
.slide-text { display: grid; gap: 16px; }
.slide-name {
  font-family: var(--display);
  font-variation-settings: "wdth" 78;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  line-height: .95;
  letter-spacing: -.02em;
  margin: 0;
}

/* platform filter chips */
.all-projects { margin-top: 72px; border-top: 2px solid var(--ink); padding-top: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 28px; }
.filters button {
  font: inherit; font-size: 15px; font-weight: 500;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* every project in one grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 48px 36px; }
.card { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; }
.card .thumb { border-radius: 8px; }
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.platform { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.platform .deprecated { margin-left: 8px; color: var(--danger); }
.platform .license { margin-left: 8px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; font-weight: 500; }
.name {
  font-family: var(--display);
  font-variation-settings: "wdth" 80;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0;
}
.card .what { font-size: 16px; line-height: 1.5; }
.card .warn { font-size: 13.5px; padding: 6px 10px; }
.card .links { margin-top: auto; padding-top: 4px; gap: 8px 16px; font-size: 15px; min-height: 38px; }
.card .try { padding: 5px 12px; }
.thumb-type span { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* desktop: a lone card on the last row spans it, thumbnail beside the text */
@media (min-width: 1100px) {
  .card.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 36px; align-items: center; }
  .card.wide .what { max-width: 40rem; }
}

/* the project the visitor came from */
.here-note { display: none; margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.is-from .here-note { display: block; }
.is-from .thumb { outline: 3px solid var(--note); outline-offset: 3px; }

/* footer */
.bottom { border-top: 1px solid var(--line); margin-top: 80px; padding-block: 28px 48px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.bottom p { margin: 0; }

/* phones */
@media (max-width: 760px) {
  .carousel { margin-top: 28px; }
  .slide { grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
  .all-projects { margin-top: 48px; }
}
@media (max-width: 600px) {
  .intro { padding-block: 8px 0; }
  .grid { gap: 18px; }
  .card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0 12px; align-items: start; }
  .card .thumb { aspect-ratio: 4 / 3; }
  .card .what { font-size: 14px; }
  .name { font-size: 1.15rem; }
}

/* a caution shown before the links, for projects that can do harm if tried blindly */
.warn { margin: 0; padding: 8px 12px; border-left: 3px solid var(--danger); background: var(--danger-soft); color: var(--ink); font-size: 15px; font-weight: 500; border-radius: 0 4px 4px 0; }
