:root {
  --paper: #fdfaf5; /* warm off-white; the logo's black mark reads directly on it */
  --paper-card: #ffffff;
  --orange: #fcb859;
  --orange-deep: #e79a35;
  --orange-ink: #96600a; /* deepened for legible orange text on light */
  --text: #141a1a;
  --text-dim: #6d6a63;
  --line: #e9e0d2;
  --radius: 18px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Warm halo behind the logo */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60rem 34rem at 50% -6rem, rgba(252, 184, 89, 0.28), transparent 70%);
}

.page {
  position: relative;
  width: min(64rem, 100% - 2.5rem);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) 0 4rem;
}

/* ---------- Language switcher ---------- */

.lang {
  position: absolute;
  top: clamp(1rem, 3.5vw, 2rem);
  right: 0;
  z-index: 1;
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(20, 26, 26, 0.04);
}

.lang button {
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang button:hover {
  color: var(--text);
}

.lang button[aria-pressed="true"] {
  background: #fff1db;
  color: var(--orange-ink);
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
}

.logo {
  width: clamp(9rem, 26vw, 13rem);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 1.25rem 2rem rgba(20, 26, 26, 0.18));
}

.wordmark {
  margin: 1.5rem 0 0;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* the Latin wordmark is tightened to close its letter gaps; Hangul has none to close */
:lang(ko) .wordmark {
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0.6rem 0 0;
  color: var(--text-dim);
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
}

/* ---------- Coderin call to action ---------- */

.cta {
  margin: clamp(2.5rem, 7vw, 3.5rem) auto 0;
  display: grid;
  gap: 0.9rem;
  width: min(38rem, 100%);
  padding: 1.5rem 1.75rem 1.6rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #17110a;
  text-decoration: none;
  text-align: left;
  box-shadow: 0 0.9rem 2rem rgba(231, 154, 53, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 1.3rem 2.8rem rgba(231, 154, 53, 0.45);
}

.cta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cta-label {
  display: grid;
  gap: 0.15rem;
}

.cta-desc {
  color: rgba(23, 17, 10, 0.82);
  font-size: 0.95rem;
  line-height: 1.55;
}

.cta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cta-tags span {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.55);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cta-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.66;
}

/* Tracking that opens up Latin small caps just looks gappy in Hangul, which has no
   uppercase and already carries its own space */
:lang(ko) .cta-kicker,
:lang(ko) .shelf-heading {
  letter-spacing: 0.04em;
}

.cta-title {
  font-size: clamp(1.5rem, 4.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.cta-arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(23, 17, 10, 0.14);
  transition: transform 0.18s ease;
}

.cta-arrow svg {
  width: 1.35rem;
  height: 1.35rem;
}

.cta:hover .cta-arrow,
.cta:focus-visible .cta-arrow {
  transform: translateX(4px);
}

/* ---------- Games & apps ---------- */

.shelf {
  margin-top: clamp(4rem, 11vw, 6rem);
}

.shelf-heading {
  margin: 0 0 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
  /* Capped track width, so items stay tile-sized instead of stretching to fill the row
     when there are only one or two of them. */
  grid-template-columns: repeat(auto-fill, minmax(16rem, 20rem));
  justify-content: start;
}

.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* keeps the screenshot clipped to the rounded corners */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-card);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(20, 26, 26, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-shot {
  position: relative;
  /* flex, not grid: a percentage height on the image only resolves against a definite
     flex container, so a grid track here leaves portrait shots at natural size */
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, #faf5e9, #f1e9da);
}

.card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

/* Portrait (phone) captures sit whole, as a device screen, rather than being cropped.
   Set --shot on the wrapper to the same image for the blurred backdrop. */
/* Scaled past the band so the shot reads at a glance, framed on the upper third of the
   screen: at 175% the image's 1/3 point lands dead centre when shifted up 4.8% of its own
   height. Top and bottom run off the edges. Recentre with: translateY = 0.5/zoom - 1/3. */
.card-shot--device {
  align-items: flex-start;
  padding-block: 0;
}

.card-shot--device img {
  position: relative; /* above the ::before backdrop */
  width: auto;
  height: 175%;
  max-width: 100%;
  object-fit: contain;
  transform: translateY(-4.8%);
  border-radius: 12px;
  box-shadow: 0 0.6rem 1.6rem rgba(20, 26, 26, 0.18);
}

/* the hover lift has to restate the offset, or the shot jumps back down */
a.card:hover .card-shot--device img,
a.card:focus-visible .card-shot--device img {
  transform: translateY(-4.8%) scale(1.03);
}

.card-shot--device::before {
  content: "";
  position: absolute;
  inset: -12%;
  background-image: var(--shot);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.15);
  opacity: 0.55;
}

a.card:hover .card-shot img,
a.card:focus-visible .card-shot img {
  transform: scale(1.03);
}

.card-shot-blank {
  display: grid;
  place-items: center;
  border-bottom-style: dashed;
  border-bottom-color: #ddd2c0;
  background: repeating-linear-gradient(
    -45deg,
    #f7f1e6,
    #f7f1e6 10px,
    #fdfaf5 10px,
    #fdfaf5 20px
  );
  color: var(--orange);
  font-size: 2rem;
}

.card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem 1.1rem;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

a.card:hover,
a.card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--orange);
  box-shadow: 0 0.9rem 1.8rem rgba(20, 26, 26, 0.1);
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-name-ko {
  margin-left: 0.4rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.card-tags span {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #fff1db;
  color: var(--orange-ink);
  font-size: 0.72rem;
  font-weight: 600;
}

.card-blurb {
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.45;
}

.card-host {
  margin-top: auto; /* pins the domain to the bottom so cards line up */
  padding-top: 0.9rem;
  color: var(--orange-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.card-soon {
  border-style: dashed;
  border-color: #ddd2c0;
  background: transparent;
  box-shadow: none;
  opacity: 0.7;
}

/* One full-width card per row on phones, with a taller band so the shot doesn't shrink */
@media (max-width: 34rem) {
  /* trimmed so the switcher clears the logo, which starts right below it on a phone */
  .lang button {
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card-shot {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Footer ---------- */

.footer {
  margin-top: clamp(4rem, 10vw, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

/* ---------- Accessibility ---------- */

:focus-visible {
  outline: 2px solid var(--orange-deep);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
