:root {
  color-scheme: light;
  --paper: #f8faf9;
  --ink: #233849;
  --muted: #5b6d77;
  --line: #d8e3e6;
  --accent: #326b7b;
  --tint: #eaf2f4;
  --sea: #6e9ba7;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0;
  background: radial-gradient(ellipse 720px 460px at 100% 0, #e8f1f4, transparent), var(--paper);
  color: var(--ink);
  font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dbe9ee; color: var(--ink); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
button { font: inherit; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 2; top: -80px; left: 20px; padding: 8px 14px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 16px; }
.page { width: min(100% - 96px, 1100px); margin-inline: auto; }
.site-header { display: flex; align-items: center; gap: 28px; padding: 32px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.wordmark { display: flex; align-items: center; gap: 5px; text-decoration: none; font-size: 25px; font-weight: 650; letter-spacing: -.08em; line-height: 1; }
.brand-mark { flex: none; width: 23px; height: 23px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.external-icon { display: inline-block; position: relative; width: 10px; height: 10px; margin-left: 2px; color: inherit; }
.external-icon::before { content: ""; position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; }
.external-icon::after { content: ""; position: absolute; top: 5px; right: 0; width: 11px; border-top: 1px solid currentColor; transform: rotate(-45deg); }
.location { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.location-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.language-switch { display: flex; flex: none; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff80; }
.language-switch a { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 5px 11px; border-radius: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; text-decoration: none; white-space: nowrap; }
.language-switch a:hover { color: var(--accent); background: var(--tint); }
.language-switch a[aria-current="page"] { background: var(--accent); color: var(--paper); }
html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
html:lang(ko) .eyebrow { letter-spacing: .03em; }
html:lang(ko) .response-header { padding-right: 150px; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 64px; }
.sidebar { align-self: start; position: sticky; top: 40px; padding-top: 68px; font-size: 12px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; gap: 14px; align-items: center; width: fit-content; min-height: 38px; text-decoration: none; }
.nav-number { color: var(--muted); font: 10px var(--mono); }
.sidebar nav a:hover .nav-number { color: var(--accent); }
.text-link { display: inline-block; margin-top: 36px; color: var(--muted); font-size: 11px; }
main { min-width: 0; }
.hero { --hero-top: 60px; position: relative; padding: var(--hero-top) 0 32px; }
/* The fish overlap the replay row; reserve their height when replay is hidden. */
.hero:has(> .stream-toggle[hidden]) { padding-bottom: 80px; }
.hero-stage { display: grid; }
.introduction-content, .portrait-studio { grid-area: 1 / 1; min-width: 0; align-self: start; }
.introduction-content { opacity: 1; visibility: visible; transition: opacity .22s ease, filter .22s ease, transform .22s ease, visibility 0s; }
.hero-stage:has(> .portrait-studio[open]) > .introduction-content { opacity: 0; visibility: hidden; filter: blur(5px); transform: translateY(-6px); pointer-events: none; transition: opacity .22s ease, filter .22s ease, transform .22s ease, visibility 0s .22s; }
.portrait-label, .hero:has(.portrait-studio[open]) .introduction-label { display: none; }
.hero:has(.portrait-studio[open]) .portrait-label { display: inline; }
.ocean-mark, .seaweed-mark { color: var(--sea); opacity: .65; pointer-events: none; }
.ocean-mark { position: absolute; right: 0; bottom: 12px; width: 136px; height: 68px; }
.seaweed-mark { display: block; width: 108px; height: 94px; margin: 18px 8px -36px auto; }
.response-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; min-height: 42px; margin-bottom: 34px; padding-right: 180px; }
.response-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 11px var(--mono); }
.stream-toggle { margin-top: 22px; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; background: transparent; color: var(--muted); cursor: pointer; font: 11px/1.6 var(--mono); }
.stream-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); }
.eyebrow { margin: 0 0 12px; color: var(--accent); font: 10px/1.7 var(--mono); letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0 0 24px; font: 400 clamp(60px, 7vw, 88px)/1.08 Georgia, "Times New Roman", serif; letter-spacing: -.06em; }
.intro { margin: 0 0 21px; font-size: clamp(22px, 2.8vw, 30px); line-height: 1.45; font-weight: 400; letter-spacing: -.035em; }
.bio { max-width: 520px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.contact-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; width: fit-content; max-width: 100%; margin-top: 28px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 8px 28px #2338490a; font-size: 12px; }
.contact-links a { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; padding: 6px 4px; }
.contact-links .primary-link { border: 1px solid var(--accent); border-radius: 5px; padding: 8px 15px; background: var(--accent); color: var(--paper); text-decoration: none; }
.contact-links .primary-link:hover { background: #245261; }
.portrait-studio { margin-top: 0; }
.generate-image { position: absolute; top: var(--hero-top); right: 0; display: flex; align-items: center; gap: 9px; width: fit-content; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 24px; background: #ffffffb3; color: var(--ink); cursor: pointer; list-style: none; font-size: 12px; }
.generate-image::-webkit-details-marker { display: none; }
.generate-image::marker { content: ""; }
.generate-image:hover { border-color: var(--accent); background: var(--tint); color: var(--accent); }
.generate-image:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.generate-image > svg { width: 18px; height: 18px; color: var(--accent); }
.hide-image-label, .portrait-studio[open] .generate-label { display: none; }
.portrait-studio[open] .hide-image-label { display: inline; }
.portrait-conversation { max-width: 520px; }
.portrait-studio[open] .portrait-conversation { animation: portrait-enter .45s .15s both; }
/* Keep the loading surface and revealed photo at the same responsive size. */
.portrait-card { width: 228px; max-width: 100%; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.portrait-surface { position: relative; overflow: hidden; aspect-ratio: 1; background: var(--tint); }
.portrait-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease, filter .6s ease; }
.portrait-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; padding: 12px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
/* Reserve the ready caption's wrapped height while the shorter status is shown. */
.portrait-caption { display: grid; min-width: 0; }
.portrait-caption > span { grid-area: 1 / 1; align-self: center; }
.portrait-caption-reserve { visibility: hidden; }
.portrait-format { flex: none; color: var(--accent); font: 10px var(--mono); }
.portrait-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.portrait-progress { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 7px; background: linear-gradient(115deg, var(--tint), #ffffffb3, var(--tint)); background-size: 220% 100%; animation: portrait-shimmer 1.6s linear infinite; }
.portrait-progress > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: portrait-pulse 1s ease-in-out infinite alternate; }
.portrait-progress > span:nth-child(2) { animation-delay: .2s; }
.portrait-progress > span:nth-child(3) { animation-delay: .4s; }
.is-generating .portrait-progress { display: flex; }
.is-generating .portrait-image { opacity: 0; filter: blur(12px); }
@keyframes portrait-shimmer { to { background-position: -220% 0; } }
@keyframes portrait-pulse { from { opacity: .3; transform: translateY(2px); } to { opacity: 1; transform: translateY(-2px); } }
@keyframes portrait-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
section { border-top: 1px solid var(--line); padding: 29px 0 36px; }
.section-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 30px; }
.section-number { color: var(--accent); font: 10px/1.5 var(--mono); }
h2 { margin: 0; font-size: 13px; font-weight: 550; letter-spacing: -.015em; }
.section-note { margin-left: auto; color: var(--muted); font: 10px/1.5 var(--mono); }
.project { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
.project:first-of-type { padding-top: 0; border-top: 0; }
.project:last-child { padding-bottom: 0; }
.project-index { padding-top: 5px; color: var(--muted); font: 10px/1.7 var(--mono); }
h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.5; font-weight: 550; letter-spacing: -.025em; }
.project p, .job p, .education > p, .skills > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.project .role { margin-bottom: 10px; color: var(--ink); font-size: 12px; }
.job > p + p, .skills > p + p { margin-top: 10px; }
.project .tech, .job .tech { margin-top: 10px; color: var(--accent); font: 10px/1.8 var(--mono); }
.project-kind { align-self: start; margin-top: 3px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 9px/1.5 var(--mono); }
.job + .job { margin-top: 29px; }
.education > p + .job-heading { margin-top: 29px; }
.job-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 16px; }
.date { color: var(--muted); font: 10px/1.8 var(--mono); white-space: nowrap; }
.job .role { margin-bottom: 10px; color: var(--ink); font-size: 12px; }
footer { display: flex; flex-wrap: wrap; gap: 4px 16px; border-top: 1px solid var(--line); padding: 31px 0 30px; font-size: 13px; }
footer p { margin: 0; color: var(--muted); }
footer > a { margin-left: auto; }
.footer-note { display: flex; justify-content: space-between; gap: 16px; width: 100%; margin-top: 39px; color: var(--muted); font: 10px/1.7 var(--mono); }

/* Only the optional visual layer hides words. The source and accessibility tree
   always contain the complete text, with no live-region announcements. */
.is-streaming .stream-word[data-pending] { opacity: 0; }
.stream-word { position: relative; }
.stream-cursor::after { content: ""; position: absolute; left: calc(100% + 2px); bottom: .08em; width: 2px; height: .95em; background: var(--accent); pointer-events: none; }

/* Reserve a right rail so the floating panel never covers portfolio content. */
@media screen and (min-width: 1100px) {
  .page { width: min(100% - 264px, 1100px); margin-inline: max(48px, calc((100% - 1324px) / 2)) auto; }
  .contact-links { position: fixed; z-index: 2; top: 50%; right: max(24px, calc((100% - 1324px) / 2)); transform: translateY(calc(-50% + var(--contact-offset, 0px))); flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 6px; width: 144px; max-height: calc(100dvh - 32px); overflow: visible; margin-top: 0; border-radius: 22px; box-shadow: 0 12px 36px #23384912; }
  /* Overlap the bottom border and keep the tail clear of the rounded corner. */
  .contact-links::after { content: ""; position: absolute; bottom: -8px; right: 24px; width: 16px; height: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-right-radius: 2px; background: var(--paper); transform: rotate(45deg); pointer-events: none; }
  .contact-links a { justify-content: space-between; padding-inline: 12px; }
}
/* Keep every contact link reachable in unusually short desktop windows. */
@media screen and (min-width: 1100px) and (max-height: 240px) {
  .contact-links { overflow-y: auto; }
  .contact-links::after { display: none; }
}
@media (min-width: 1500px) { .layout { gap: 96px; } }
@media (max-width: 1000px) {
  .page { width: calc(100% - 64px); }
  .layout { grid-template-columns: 155px minmax(0, 1fr); gap: 38px; }
  .project { grid-template-columns: 20px minmax(0, 1fr); }
  .project-kind { display: none; }
  .section-note { display: none; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 20px; }
  .page { width: min(100% - 40px, 560px); }
  .site-header { padding: 25px 0; gap: 12px; }
  .location { font-size: 10px; gap: 5px; }
  .language-switch a { min-height: 38px; padding-inline: 9px; }
  .layout { display: block; }
  .sidebar { position: static; padding-top: 17px; }
  .sidebar .text-link, .nav-number { display: none; }
  .sidebar nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; }
  .sidebar nav a { font-size: 10px; min-height: 40px; }
  .hero { --hero-top: 34px; padding: var(--hero-top) 0 24px; }
  .hero:has(> .stream-toggle[hidden]) { padding-bottom: 62px; }
  .ocean-mark { bottom: 6px; width: 112px; height: 56px; }
  .seaweed-mark { width: 88px; height: 76px; margin-bottom: -30px; }
  .response-header { margin-bottom: 28px; }
  h1 { font-size: clamp(58px, 12vw, 76px); }
  .intro { font-size: 25px; }
  .bio { font-size: 14px; }
  .contact-links { gap: 8px 16px; }
  section { padding: 25px 0 30px; }
  .section-heading { margin-bottom: 25px; }
  .job-heading { align-items: start; }
  .date { font-size: 9px; }
  .education .date { width: 100%; margin-bottom: 5px; }
  footer > a { margin-left: 0; }
  footer p { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { padding-bottom: 80px; }
  .contact-links { --contact-offset: 0px !important; }
  .introduction-content, .hero-stage:has(> .portrait-studio[open]) > .introduction-content { transition: none; transform: none; filter: none; }
  .portrait-studio[open] .portrait-conversation { animation: none; }
  .portrait-image { transition: none; }
  .portrait-progress, .portrait-progress > span { animation: none; }
  .is-streaming .stream-word[data-pending] { opacity: 1; }
  .stream-cursor::after, .stream-toggle { display: none; }
}
@media print {
  html { scroll-behavior: auto; }
  body { background: white; color: black; font-size: 11pt; }
  .page { width: 100%; }
  .site-header { padding: 0 0 16px; }
  .layout { display: block; }
  .sidebar, .language-switch, .stream-toggle, .stream-cursor::after, .skip-link, .response-header, .ocean-mark, .seaweed-mark { display: none; }
  .portrait-studio { display: none; }
  .hero-stage { display: block; }
  .hero-stage:has(> .portrait-studio[open]) > .introduction-content { visibility: visible; opacity: 1; filter: none; transform: none; transition: none; }
  .contact-links { padding: 0; border: 0; box-shadow: none; break-inside: avoid; }
  .hero, .hero:has(> .stream-toggle[hidden]) { padding: 24px 0; }
  h1 { font-size: 40pt; }
  .intro { font-size: 18pt; }
  section { padding: 20px 0; }
  article, .education { break-inside: avoid; }
  .is-streaming .stream-word[data-pending] { opacity: 1; }
  .footer-note { margin-top: 18px; }
}
