/* ==========================================================================
   shawnlee.io — one stylesheet for the whole site.
   Edit tokens below to reshape everything; the rest is layout for a small
   number of repeated patterns (room, section, entry list, link row).
   ========================================================================== */

:root {
  /* warm paper + ink, one accent */
  --paper:      #fbf7f1;
  --paper-sunk: #f4ece1;
  --ink:        #241f1b;
  --ink-soft:   #5f5449;
  --ink-faint:  #918579;
  --rule:       #e7dccd;
  --accent:     #b0532c;
  --accent-dim: #e8cdbb;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Fraunces", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --measure: 34rem;   /* comfortable line length for prose */
  --page: 44rem;      /* page column */
  --step: 2.75rem;    /* vertical rhythm between sections */
  /* Night is the default; the room switch overrides system appearance. */
  --room-night: #10141f;
  --room-text: #f4e8d6;
  --room-muted: #aaa9b3;
  --room-gold: #efbd80;
  --room-glass: #141b27d9;
  --room-line: #ead7bb30;
  --room-text-shadow: #080d18e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #16130f;
    --paper-sunk: #1d1913;
    --ink:        #f1e8dc;
    --ink-soft:   #b6a999;
    --ink-faint:  #857a6c;
    --rule:       #2b2419;
    --accent:     #e2966b;
    --accent-dim: #4a3524;
    --room-night: #10141f;
    --room-text: #f4e8d6;
    --room-muted: #aaa9b3;
    --room-gold: #efbd80;
    --room-glass: #141b27d9;
    --room-line: #ead7bb30;
    --room-text-shadow: #080d18e6;
  }
}

* { box-sizing: border-box; }

/* --- explorable desk homepage ------------------------------------------- */
.room-page { background: var(--room-night); color: var(--room-text); overflow: hidden; -webkit-user-select: none; user-select: none; }
.room-page #room { position: relative; width: 100%; height: 100svh; min-height: 420px; overflow: hidden; }
.room-page #scene, .room-page #scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.room-page button, .room-page a { -webkit-tap-highlight-color: transparent; }
.room-page button { font: inherit; color: inherit; cursor: pointer; }
.room-page [hidden] { display: none !important; }
.room-page a { color: inherit; text-decoration: none; }
.room-page a:hover { color: var(--room-gold); }
.room-page :focus-visible { outline: 2px solid var(--room-gold); outline-offset: 5px; }
.room-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #080d1880, transparent 24%, transparent 70%, #080d18c9), radial-gradient(ellipse, transparent 40%, #080d183d); }
.room-header { position: absolute; top: 30px; left: 40px; right: 40px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.room-header a { pointer-events: auto; }
.room-header > :first-child {
  text-shadow:
    0 1px 2px var(--room-text-shadow),
    0 0 4px var(--room-text-shadow),
    0 0 8px var(--room-text-shadow),
    0 0 12px var(--room-text-shadow),
    0 0 18px var(--room-text-shadow),
    0 0 18px var(--room-text-shadow),
    0 0 28px var(--room-text-shadow),
    0 0 40px var(--room-text-shadow);
}
.room-header .room-name { font: 20px/1.2 var(--display); letter-spacing: -.4px; margin: 0; color: var(--room-text); }
.room-header p { font: 14px/1.5 system-ui, sans-serif; margin: 8px 0 0; color: var(--room-muted); }
.room-header .room-korean { font-size: 15px; margin-top: 5px; color: var(--room-text); }
.room-welcome { font: 400 clamp(27px, 2.5vw, 36px)/1.13 var(--display); font-variation-settings: "SOFT" 60, "WONK" 1; letter-spacing: -.035em; color: var(--room-gold); margin: 15px 0 0; transition: opacity .25s; }
.room-page.exploring .room-welcome { opacity: 0; }
.room-location { padding-top: 6px; font: 11px var(--mono); letter-spacing: .04em; text-align: right; }
.room-coordinates { display: block; color: var(--room-muted); font-size: 9px; margin-top: 9px; }
.room-time { pointer-events: auto; display: inline-flex; align-items: center; gap: 9px; margin-top: 13px; padding: 8px 11px; border: 1px solid var(--room-line); border-radius: 22px; background: var(--room-glass); font: 10px var(--mono) !important; }
.room-time:disabled { opacity: .5; cursor: wait; }
.room-time-track { width: 25px; height: 14px; border-radius: 10px; background: var(--room-line); padding: 3px; }
.room-time-track::before { content: ''; display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--room-gold); transition: transform .15s; }
.room-time[aria-checked="true"] .room-time-track::before { transform: translateX(11px); }
/* An explicit room setting applies equally in both system color schemes. */
.room-page[data-time="day"] {
  --room-night: #dce6e8;
  --room-text: #241f1b;
  --room-muted: #514c48;
  --room-gold: #9b4726;
  --room-glass: #fbf7f1ed;
  --room-line: #5f544936;
  --room-text-shadow: #fbf7f1f2;
}
.room-page[data-time="day"] .room-vignette { background: linear-gradient(180deg, var(--room-glass), transparent 18%, transparent 84%, var(--room-glass)); opacity: .7; }
.room-live-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--room-gold); box-shadow: 0 0 12px var(--room-gold); margin-right: 8px; }
.room-footer { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); left: 40px; right: 40px; margin: 0; padding: 0; border: 0; display: block; color: var(--room-text); }
.room-instructions { display: flex; justify-content: space-between; margin-bottom: 17px; font: 10px var(--mono); color: var(--room-muted); }
#room-nav { display: flex; justify-content: center; gap: 4px; padding: 7px; width: fit-content; max-width: 100%; margin: auto; border: 1px solid var(--room-line); background: var(--room-glass); border-radius: 12px; backdrop-filter: blur(16px); }
#room-nav button { border: 0; background: transparent; padding: 10px 17px; border-radius: 7px; font: 11px var(--mono); white-space: nowrap; color: var(--room-muted); }
#room-nav button:hover, #room-nav button[aria-pressed="true"] { color: var(--room-text); background: var(--room-line); }
.room-bottom { display: flex; justify-content: space-between; margin-top: 17px; font: 9px var(--mono); color: var(--room-muted); }
.room-back { position: absolute; left: 40px; top: 120px; padding: 10px 15px; border: 1px solid var(--room-line); background: var(--room-glass); border-radius: 7px; font: 11px var(--mono) !important; }
.room-back kbd { margin-left: 25px; color: var(--room-muted); font-size: 9px; }
.room-page.in-lounge .room-back {
  left: auto; right: 40px; top: 130px;
  min-height: 44px; padding: 12px 16px;
  background: var(--room-night); color: var(--room-gold);
  border-color: var(--room-gold);
  font: 600 12px var(--mono) !important;
  box-shadow: 0 4px 18px var(--room-text-shadow);
}
.room-page.in-lounge .room-back:hover { background: var(--room-glass); }
.room-page.watching-tv .room-back kbd, .room-page.watching-tv .room-instructions > span:last-child { display: none; }
.room-tv-screen {
  position: absolute; left: 0; top: 0; width: 1280px; height: 720px;
  margin: 0; transform-origin: 0 0; overflow: hidden; color: var(--room-text);
}
.room-tv-screen.is-on { background: var(--room-night); }
.room-tv-screen iframe { display: block; width: 100%; height: 100%; border: 0; transform-origin: 0 0; }
.room-tv-screen button { font: 40px/1.25 var(--serif); }
.room-tv-power {
  width: 100%; height: 100%; padding: 0 0 60px; display: flex;
  align-items: flex-end; justify-content: center; border: 0;
  color: var(--room-text); background: transparent;
  text-shadow: 0 2px 10px var(--room-text-shadow);
}
.room-tv-power:hover { box-shadow: inset 0 0 0 6px var(--room-gold); }
.room-tv-menu { height: 100%; overflow: auto; overscroll-behavior: contain; padding: 50px 60px; }
.room-tv-menu h2 { margin: 0 0 12px; font: 52px/1.1 var(--display); color: var(--room-gold); }
.room-tv-menu p { max-width: none; margin: 0 0 30px; font: 30px/1.3 var(--serif); color: var(--room-muted); }
.room-tv-list { display: grid; gap: 16px; }
.room-tv-list button { text-align: left; padding: 22px 28px; border: 1px solid var(--room-line); border-radius: 12px; background: var(--room-glass); }
.room-tv-list button:hover { border-color: var(--room-gold); }
.room-tv-list span { display: block; margin-top: 8px; font: 30px/1.3 var(--serif); color: var(--room-muted); }
.room-tv-message { max-width: none; padding: 80px; font: 44px/1.3 var(--serif); }
.room-tv-remote {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  width: max-content; max-width: calc(100% - 32px);
}
.room-tv-remote button, .room-tv-remote a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 14px; border-radius: 7px;
  border: 1px solid var(--room-line); background: var(--room-night);
  font: 11px var(--mono); color: var(--room-text);
}
.room-tv-remote button:hover, .room-tv-remote a:hover { border-color: var(--room-gold); color: var(--room-gold); }
.room-hotspot { position: absolute; transform: translate(-50%, -50%); padding: 7px 10px; display: flex; align-items: center; gap: 6px; background: var(--room-glass); color: var(--room-text); border: 1px solid var(--room-line); border-radius: 6px; white-space: nowrap; font: 11px var(--mono) !important; box-shadow: 0 2px 8px var(--room-text-shadow); transition: background .2s, border-color .2s; }
.room-hotspot::before { content: ''; width: 3px; height: 3px; background: var(--room-gold); border-radius: 50%; }
.room-hotspot::after { content: ''; position: absolute; top: 100%; left: 50%; width: 1px; height: var(--label-stem, 6px); background: var(--room-gold); opacity: .65; pointer-events: none; }
.room-hotspot:hover, .room-hotspot:focus-visible { background: var(--room-night); border-color: var(--room-gold); }
.room-card-media { position: absolute; top: 0; left: 0; width: 1088px; transform-origin: 0 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 0 22px 16px 0; color: var(--room-text); font: 44px/1.22 var(--serif); scrollbar-width: thin; scrollbar-color: var(--room-gold) transparent; }
.room-card-media p { max-width: none; margin: 0 0 24px; white-space: pre-line; }
.room-card-media .room-card-detail { color: var(--room-muted); font-size: 37px; line-height: 1.3; }
.room-card-media figure { margin: 28px 0; }
.room-card-media img { display: block; width: 100%; max-height: 600px; object-fit: contain; border-radius: 12px; }
.room-card-media .room-card-image-intro { margin: 0 0 24px; }
.room-card-media .room-card-image-intro img { width: auto; max-width: 100%; max-height: 160px; }
.room-card-media .room-card-image-beside { float: left; max-width: 45%; margin: 0 28px 16px 0; }
.room-card-media .room-card-image-beside img { height: auto; }
.room-card-media-clear { clear: both; }
.room-card-media figcaption { margin-top: 12px; color: var(--room-muted); font-size: 34px; }
.room-card-media a { display: block; margin: 20px 0; color: var(--room-gold); font: 32px/1.4 var(--mono); text-decoration: underline; overflow-wrap: anywhere; }
.room-video { width: 100%; aspect-ratio: 16 / 9; margin-top: 24px; background: var(--room-glass); border: 1px solid var(--room-line); border-radius: 12px; overflow: hidden; }
.room-video button { width: 100%; height: 100%; padding: 30px; border: 0; background: transparent; color: var(--room-gold); font: 36px var(--mono); }
.room-video iframe { width: 100%; height: 100%; border: 0; }
.room-loading, .room-error { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 30px; text-align: center; background: var(--room-glass); border: 1px solid var(--room-line); border-radius: 14px; }
.room-loading { font: 12px var(--mono); }
.room-loading span { display: block; width: 22px; height: 22px; border: 1px solid var(--room-line); border-top-color: var(--room-gold); border-radius: 50%; margin: 0 auto 20px; animation: room-spin 1.2s linear infinite; }
.room-error { z-index: 10; width: min(90%, 450px); }
.room-error h1 { font: 28px var(--display); }
.room-error button { display: block; margin: 15px auto 0; background: transparent; border: 1px solid var(--room-line); border-radius: 5px; padding: 7px 16px; }
.room-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.room-story-controls { position: absolute; inset: 0; pointer-events: none; }
.room-story-controls button { pointer-events: auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--room-gold); }
.room-story-arrow { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 64px; }
.room-story-arrow svg { display: block; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.room-story-controls button:not(:disabled):hover, .room-story-controls button:focus-visible { background: var(--room-glass); outline: 2px solid var(--room-gold); outline-offset: -2px; }
.room-story-controls button:disabled { color: var(--room-muted); opacity: .35; cursor: default; }
.room-story-controls #story-count { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 4px; }
.room-story-dot { width: 24px; height: 28px; }
.room-story-dot::before { content: ''; width: 7px; height: 7px; border: 1px solid var(--room-muted); border-radius: 50%; }
.room-story-dot[aria-current="page"]::before { background: var(--room-gold); border-color: var(--room-gold); width: 9px; height: 9px; }
@keyframes room-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .room-header { top: 22px; left: 20px; right: 20px; }
  .room-header p { font-size: 12px; }
  .room-location { font-size: 9px; }
  .room-coordinates { font-size: 8px; }
  .room-footer { left: 15px; right: 15px; bottom: max(16px, env(safe-area-inset-bottom)); }
  #room-nav { flex-wrap: wrap; gap: 0; max-width: 400px; }
  #room-nav button { padding: 10px 12px; }
  .room-instructions { justify-content: center; font-size: 9px; margin-bottom: 12px; }
  .room-instructions > span:last-child { display: none; }
  .room-bottom { font-size: 8px; margin-top: 12px; }
  .room-back { left: 20px; top: 95px; }
  .room-page.in-lounge .room-back { right: 20px; top: 116px; }
  .room-tv-menu { padding: 40px; }
  .room-tv-menu h2 { font-size: 64px; }
  .room-tv-menu p, .room-tv-list span { font-size: 46px; }
  .room-tv-screen button { font-size: 58px; }
  .room-tv-list button { min-height: 160px; }
  .room-hotspot { padding: 7px 8px; font-size: 10px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .room-page *, .room-page *::before { animation: none !important; transition: none !important; }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* --- page frame ---------------------------------------------------------- */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 5rem;
}

/* --- navigation ---------------------------------------------------------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin-bottom: 3.5rem;
}

.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav .spacer { flex: 1 1 auto; }

/* --- sections ------------------------------------------------------------ */

section { margin-top: var(--step); }

.label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  max-width: none;   /* section rules span the full column, unlike prose */
}

p { max-width: var(--measure); margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

.lede { font-size: 1.15rem; line-height: 1.65; }

h2, h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 24;
  font-weight: 600;
  line-height: 1.25;
}

h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }

em { font-style: italic; }
strong { font-weight: 600; }

/* --- links --------------------------------------------------------------- */

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* row of standalone links (resume, github, ...) */
.linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  list-style: none;
  margin: 0;
  padding: 0;
}

.linkrow a { text-decoration: none; color: var(--ink-soft); }
.linkrow a::before { content: "↗ "; color: var(--accent); }
.linkrow a:hover { color: var(--accent); }
.linkrow a.internal::before { content: "→ "; }

/* --- entry list (work, teaching, writing, projects) ---------------------- */

.entries { list-style: none; margin: 0; padding: 0; }

.entry {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 1.5rem;
  padding: 1rem 0;
  border-top: 1px dotted var(--rule);
}

.entry:first-child { border-top: 0; padding-top: 0; }

.entry-when {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding-top: 0.42rem;
  white-space: nowrap;
}

.entry-body p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.entry-body .where { color: var(--ink-faint); font-weight: 400; }
.entry-body .linkrow { margin-top: 0.5rem; }

@media (max-width: 34rem) {
  .entry { grid-template-columns: 1fr; gap: 0.15rem; }
  .entry-when { padding-top: 0; }
}

/* --- prose page (about) -------------------------------------------------- */

.prose p { margin-bottom: 1.25rem; }
.prose > p:first-of-type::first-letter {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  font-size: 3.1rem;
  line-height: 0.85;
  float: left;
  padding: 0.15rem 0.5rem 0 0;
  color: var(--accent);
}

.figure { margin: 2.25rem 0; max-width: 30rem; }
.figure img { width: 100%; border-radius: 6px; display: block; }
.figure figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-top: 0.6rem;
}

/* --- standalone page title (about, projects) ----------------------------- */

.page-title {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 96;
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-sunk);
  padding: 0.1em 0.32em;
  border-radius: 3px;
}

/* --- the desk ------------------------------------------------------------ */
/* Inline SVG scene on the home page. Objects are <symbol>s reused as small
   marks beside section headings, so adding an object touches one place. */

.page-wide { max-width: 54rem; }

.desk-head { margin-bottom: 2rem; }

.desk-head h1 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 96;
  font-weight: 600;
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}

.desk { margin: 0 0 1.5rem; }

.desk svg { width: 100%; height: auto; display: block; color: var(--ink-soft); }

.desk figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-align: right;
  margin-top: 0.4rem;
}

/* scene furniture */
.desk .surface { fill: var(--paper-sunk); stroke: none; }
.desk .mat { fill: var(--accent-dim); opacity: 0.22; stroke: none; }
.desk .ring { fill: none; stroke: var(--accent); stroke-width: 3; opacity: 0.16; }

/* Objects are drawn with presentation attributes so the styling inherits
   through <use>. These knobs tune stroke weight per context. */
/* hotspots */
.desk .hit { fill: transparent; }

.desk .spot {
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.18s ease;
}

.desk .spot .lbl {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  text-anchor: middle;
  fill: var(--ink-faint);
  opacity: 0.5;
  transition: opacity 0.18s ease, fill 0.18s ease;
}

.desk .spot:hover,
.desk .spot:focus-visible { color: var(--accent); }
.desk .spot:hover .lbl,
.desk .spot:focus-visible .lbl { opacity: 1; fill: var(--accent); }
.desk .spot:focus-visible { outline: none; }
.desk .spot:focus-visible .hit {
  fill: var(--accent-dim);
  opacity: 0.35;
  rx: 10;
}

/* the same objects, small, next to a section heading */
.label-icon {
  --sw: 7;
  --sw2: 6;
  --swt: 5;
  width: 1.45rem;
  height: 1.45rem;
  vertical-align: -0.42rem;
  margin-right: 0.4rem;
  color: var(--accent);
  overflow: visible;
}

.label-icon use { transform-box: fill-box; }

@media (max-width: 40rem) {
  .desk .spot .lbl { font-size: 19px; opacity: 0.75; }
  .desk figcaption { text-align: left; }
}

/* --- footer -------------------------------------------------------------- */

footer {
  margin-top: 4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

footer a { color: var(--ink-faint); text-decoration: none; }
footer a:hover { color: var(--accent); }
