/* 22pm developer site
   Concept: the studio window at night. A live Seoul clock sits in the hero;
   after 10 PM the desk lamp switches on (body.is-lit). Everything else stays quiet. */

:root {
  --night: #1A1D3B;      /* page background: indigo night, not black */
  --dusk: #232750;       /* raised surfaces */
  --rule: #343868;       /* dividers, table lines */
  --moon: #ECE8F7;       /* primary text */
  --haze: #9A9CC4;       /* secondary text */
  --lamp: #FFB547;       /* tungsten lamp: lit clock, primary action, focus */
  --lamp-ink: #2A1A00;   /* text on lamp */

  --serif: "Hahmlet", "Noto Serif KR", "AppleMyungjo", serif;
  --sans: "IBM Plex Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;

  /* type scale, ~perfect fourth */
  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-h3: 1.375rem;
  --fs-h2: 1.75rem;
  --fs-h1: clamp(1.75rem, 1.1rem + 2.6vw, 2.75rem);

  --gutter: 16px;
  --measure: 34em;
  color-scheme: dark;
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

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

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

body {
  margin: 0;
  background: var(--night);
  color: var(--moon);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* the lamp glow bleeds past the viewport */
}
@supports (overflow: clip) { body { overflow-x: clip; } }

/* bilingual: both languages live in the HTML, one is shown */
html[data-lang="ko"] body [lang="en"],
html[data-lang="en"] body [lang="ko"] { display: none !important; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--lamp); }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--lamp); color: var(--lamp-ink);
  padding: 0.5rem 0.875rem; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 12px; }

/* header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.5rem;
  position: relative; z-index: 2;
}
.wordmark {
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem;
  letter-spacing: -0.02em; text-decoration: none;
}
.lang-switch { display: flex; gap: 0.25rem; }
.lang-switch button {
  font: inherit; font-size: var(--fs-small); color: var(--haze);
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 0.25rem 0.75rem; cursor: pointer;
}
.lang-switch button:hover { color: var(--moon); }
.lang-switch button[aria-pressed="true"] { color: var(--moon); border-color: var(--rule); }

/* hero: the clock and the lamp */
.hero {
  position: relative;
  padding-top: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}
/* The lamp is a document-wide layer (not inside .hero) so its glow can spread
   behind the header without pushing the page wider than the viewport.
   --clock-x lines the light up with the left edge of the clock. */
.lamp {
  --clock-x: calc(50% - min(30rem, 50%) + var(--gutter) + 9rem);
  position: absolute; top: 0; left: 0; right: 0;
  height: 56rem;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(40rem 28rem at var(--clock-x) clamp(9rem, 18vw, 15rem), rgba(255, 181, 71, 0.22), transparent 65%),
    radial-gradient(16rem 11rem at var(--clock-x) clamp(9rem, 18vw, 15rem), rgba(255, 214, 150, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.site-header, main, .site-footer { position: relative; z-index: 1; }
body.is-lit .lamp { opacity: 1; animation: switch-on 1.6s ease-out 1; }

@keyframes switch-on {
  0%   { opacity: 0; }
  10%  { opacity: 0.75; }
  16%  { opacity: 0.15; }
  26%  { opacity: 0.9; }
  32%  { opacity: 0.45; }
  100% { opacity: 1; }
}

.clock {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(5.5rem, 24vw, 12.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--haze);
  transition: color 1.2s ease, text-shadow 1.2s ease;
}
.clock .colon { display: inline-block; padding-inline: 0.02em; transform: translateY(-0.06em); }
body.is-lit .clock {
  color: var(--lamp);
  text-shadow: 0 0 48px rgba(255, 181, 71, 0.35);
}
body.is-lit .clock .colon { animation: tick 2s steps(1) infinite; }
@keyframes tick { 50% { opacity: 0.35; } }

.status {
  margin: 1.75rem 0 0;
  color: var(--haze);
  font-size: var(--fs-small);
}
body.is-lit .status { color: var(--moon); }

.hero h1 {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  max-width: 18em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-h1);
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.lede {
  margin: 1rem 0 0;
  max-width: var(--measure);
  color: var(--haze);
}

/* sections */
.block {
  padding-top: clamp(2rem, 5vw, 3.5rem);
}
main > .block:last-child { padding-bottom: clamp(3rem, 8vw, 5rem); }
.block > h2 {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.section-note {
  margin: 0.75rem 0 0;
  max-width: var(--measure);
  color: var(--haze);
}

/* apps: rows, not cards */
.apps { list-style: none; margin: 2rem 0 0; padding: 0; }
.app {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.5rem;
  padding-block: 2rem;
}
.app + .app { border-top: 1px solid var(--rule); }

.app-icon {
  width: 96px; height: 96px;
  border-radius: 22px;
  display: block;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}
.app-icon--glyph {
  display: grid; place-items: center;
  background: #FFD95A; color: #201A16;
  font-family: var(--serif); font-weight: 700; font-size: 2.5rem;
}

.app-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1.35;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem;
}
.tag {
  font-family: var(--sans);
  font-size: 0.8125rem; font-weight: 500;
  color: var(--haze);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.0625rem 0.625rem;
}
.app-sub { margin: 0.125rem 0 0; color: var(--haze); font-size: var(--fs-small); }
.app-desc { margin: 0.75rem 0 0; max-width: var(--measure); }

.app-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.25rem; }
.btn {
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.125rem;
  border-radius: 10px;
  border: 1px solid var(--rule);
  font-size: var(--fs-small); font-weight: 500;
  text-decoration: none;
  color: var(--moon);
  background: transparent;
}
.btn:hover { border-color: var(--haze); color: var(--moon); }
.btn-primary { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); font-weight: 600; }
.btn-primary:hover { background: #FFC56E; border-color: #FFC56E; color: var(--lamp-ink); }

@media (max-width: 520px) {
  .app { grid-template-columns: 64px 1fr; gap: 1rem; }
  .app-icon { width: 64px; height: 64px; border-radius: 15px; }
  .app-icon--glyph { font-size: 1.75rem; }
}

/* policies: a real table, stacked on narrow screens */
.policies {
  width: 100%;
  margin-top: 2rem;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.policies th, .policies td {
  text-align: left;
  vertical-align: top;
  padding: 0.875rem 1rem 0.875rem 0;
  border-bottom: 1px solid var(--rule);
}
.policies thead th { color: var(--haze); font-weight: 500; }
.policies tbody th { font-weight: 600; font-size: var(--fs-body); white-space: nowrap; }
.policies a { color: var(--moon); overflow-wrap: anywhere; }
.policies a:hover { color: var(--lamp); }

@media (max-width: 720px) {
  .policies thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .policies, .policies tbody, .policies tr, .policies th, .policies td { display: block; width: 100%; }
  .policies tr { padding-block: 1rem; border-bottom: 1px solid var(--rule); }
  .policies th, .policies td { border: 0; padding: 0; }
  .policies tbody th { margin-bottom: 0.5rem; }
  .policies td { display: grid; grid-template-columns: 8.5em 1fr; gap: 0.75rem; padding-block: 0.25rem; }
  html[data-lang="ko"] .policies td::before { content: attr(data-label-ko); color: var(--haze); }
  html[data-lang="en"] .policies td::before { content: attr(data-label-en); color: var(--haze); }
  .policies td a { grid-column: 2; }
}

/* contact */
.email {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 0.9rem + 1.6vw, 1.75rem);
  overflow-wrap: anywhere;
}

/* footer */
.site-footer > div {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--haze);
  font-size: var(--fs-small);
}
.site-footer p { margin: 0; }
.site-footer p:first-child { margin-right: auto; }

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