@charset "UTF-8";

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #111;
  --muted: #646464;
  --line: #ececec;
  --sans: "Inter", Arial, "Apple SD Gothic Neo", "Hiragino Kaku Gothic ProN", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --gutter: 20px;
  --motion: 260ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
button, select { font: inherit; }
button, select, summary { cursor: pointer; }
a, select, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
p, h1, h2, h3, h4, dl, dd { margin: 0; overflow-wrap: anywhere; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
[hidden] { display: none !important; }
main:focus, section:focus { outline: none; }
section { scroll-margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -8rem; left: 1rem; z-index: 100; padding: 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 1rem; }
.mono, .eyebrow { font: inherit; }
.text-link { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 44px; font-size: 0.9rem; }

/* The header belongs to the document flow; it never follows the scroll. */
.header { display: grid; grid-template-columns: calc(25% - 12px) 1fr auto; align-items: center; gap: 1rem; min-height: 64px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; width: fit-content; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand__symbol { display: grid; place-content: center; grid-auto-flow: column; width: 28px; height: 28px; font-size: 1.1rem; letter-spacing: -0.09em; color: #fff; background: #111; }
.brand__symbol span { font-size: 0.85em; }
.brand__name { font-size: 0.75rem; }
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a, .header__contact { display: inline-flex; align-items: center; gap: 0.65rem; min-height: 44px; font-size: 1rem; }
.header__actions { display: flex; align-items: center; gap: 3rem; }
.language { position: relative; display: flex; align-items: center; gap: 0.4rem; }
.language__icon { width: 15px; height: 15px; pointer-events: none; }
.language select { -webkit-appearance: none; appearance: none; border: 0; border-radius: 0; background: transparent; color: var(--ink); min-height: 44px; width: 6.8rem; padding: 0.5rem 1rem 0.5rem 0; font-size: 0.8rem; }
.language select:focus { outline: none; }
.language select:focus-visible { outline: none; box-shadow: inset 0 -1px 0 var(--ink); }
.language__chevron { position: absolute; right: 0; pointer-events: none; font-size: 0.85rem; }

.hero, .section, .footer { padding-inline: var(--gutter); }
.hero { position: relative; padding-top: 164px; padding-bottom: 80px; }
.avatar { position: absolute; left: var(--gutter); top: 60px; width: calc((100% - 2 * var(--gutter) - 112px) / 8); aspect-ratio: 1; object-fit: cover; }
h1 { font-size: clamp(2.5rem, 4.445vw, 4rem); line-height: 1.1; font-weight: 400; letter-spacing: normal; }
h1::before { content: ""; float: left; width: calc(25% + 4px); height: 1em; }

.section { padding-bottom: clamp(5rem, 8vw, 9rem); }
.section__heading { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 16px; margin-bottom: 2.5rem; }
.section__heading > .section__index { grid-column: 5 / 7; }
.section__heading > :last-child { grid-column: 7 / -1; }
.section__index { align-self: start; padding-top: 0.6rem; padding-right: 1rem; font-size: 0.875rem; line-height: 1.4; }
h2 { font-size: clamp(2rem, 3.0556vw, 2.75rem); font-weight: 400; line-height: 1.12; letter-spacing: normal; white-space: pre-line; }
.section__intro { max-width: 480px; margin-top: 1rem; font-size: 0.95rem; line-height: 1.5; color: var(--muted); }
.section__body { margin-left: calc(37.5% + 6px); }
.experience { padding-top: 40px; }
.experience .section__heading { height: 0; margin-bottom: 0; }
.experience .section__index { padding-top: 0.65rem; }
.experience__group + .experience__group { margin-top: 4.5rem; }
.group-title { font-size: clamp(2rem, 3.0556vw, 2.75rem); font-weight: 400; line-height: 1.12; letter-spacing: normal; margin-bottom: 0.5rem; }
.experience__entry > summary, .experience__entry--static { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 14px; align-items: baseline; gap: 1rem; padding: 0.25rem 0; font-size: 1rem; line-height: 1.45; }
.experience__entry > summary { list-style: none; transition: color var(--motion), background var(--motion); }
summary::-webkit-details-marker { display: none; }
.experience__entry > summary:hover, .experience__entry > summary:focus-visible { color: #fff; background: #111; }
.experience__position { min-width: 0; overflow-wrap: anywhere; }
.experience__name { display: block; font-weight: 400; }
.experience__role { display: block; margin-top: 0.1rem; font-size: 0.8rem; color: var(--muted); }
.experience__entry > summary:hover .experience__role, .experience__entry > summary:focus-visible .experience__role { color: #ddd; }
.experience__description { padding: 0.8rem 1.5rem 1.2rem calc(50% + 0.5rem); color: var(--muted); font-size: 1rem; line-height: 1.6; }
.oss-row__native { font-size: 0.8em; }
.details-icon { position: relative; display: block; width: 12px; height: 12px; flex-shrink: 0; align-self: center; }
.details-icon::before, .details-icon::after { content: ""; position: absolute; top: 5px; left: 0; width: 12px; height: 1px; background: currentColor; }
.details-icon::after { transform: rotate(90deg); transition: transform var(--motion); }
details[open] > summary .details-icon::after { transform: rotate(0); }

.principles .section__heading { margin-bottom: 2.5rem; }
.principles .section__heading > h2 { grid-column: 12 / -1; }
.principles .section__body { margin-left: calc(68.75% + 11px); }
.principles summary { display: grid; grid-template-columns: 1rem minmax(0, 1fr) 12px; gap: 0.4rem; align-items: baseline; min-height: 28px; padding-block: 0; list-style: none; }
.principle-number { font-size: 0.85rem; color: var(--muted); }
.principles h3 { font-size: 1.125rem; font-weight: 400; line-height: 1.4; }
.principles details > p { padding: 0.4rem 1rem 1rem 1.4rem; font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

.work .section__heading { margin-bottom: clamp(4rem, 10vw, 10rem); }
.work .section__heading > .section__index { grid-column: 1 / 5; padding-top: 0; font-size: 1.125rem; }
.work .section__heading > h2 { grid-column: 5 / -1; font-size: 1.125rem; line-height: 1.5; }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.project { min-width: 0; }
.project__visual { display: block; aspect-ratio: 1.5; }
.project__image { transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1); width: 100%; height: 100%; object-fit: contain; }
.project__visual { overflow: hidden; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project__visual:hover .project__image { transform: scale(1.015); }
}
.project__header { margin-top: 0.9rem; }
.project h3 { font-size: 1.5rem; font-weight: 400; }
.project h3 a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; }
.project > p { max-width: 650px; font-size: 1rem; color: var(--muted); line-height: 1.6; }
.project__image--community { object-fit: cover; }
.community > .community__meta { margin-top: 1rem; font-size: 0.8rem; }
.community__details { margin-top: 1.5rem; max-width: 720px; }
.community__item > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; list-style: none; font-size: 0.9rem; }
.community__item > p { padding-bottom: 1rem; padding-right: 1.5rem; font-size: 1rem; line-height: 1.6; color: var(--muted); }
.community .text-link { margin-top: 1rem; }

.blog-entry { align-self: start; }
.blog-link { display: inline-flex; align-items: center; gap: 2rem; min-height: 48px; padding: 0.65rem 1.2rem; border: 1px solid var(--ink); transition: color var(--motion), background-color var(--motion); }
.blog-link:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.beyond__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem; }
.education > .eyebrow { display: block; margin-bottom: 1.5rem; font-size: 0.875rem; font-weight: 400; }
.education__item + .education__item { margin-top: 1.5rem; }
.education__title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.education__title h4 { font-size: 0.95rem; font-weight: 400; }
.education__title > span { font-size: 0.75rem; color: var(--muted); }
.education__item > p { margin-top: 0.5rem; font-size: 1rem; line-height: 1.6; color: var(--muted); }
.education__item > .education__note { margin-top: 0.2rem; }
.music { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1.5rem; align-items: center; margin-top: 3rem; }
.music h3 { font-size: 1rem; font-weight: 400; }
.music__copy { min-width: 0; max-width: 680px; }
.music__instrument { display: block; width: 64px; }
.music__instrument img { width: 64px; height: 96px; object-fit: contain; }
.music__caption { display: inline-block; padding-block: 0.5rem; font-size: 0.8rem; line-height: 1.5; }
.beyond__personal { margin-top: 0.4rem; font-size: 0.85rem; line-height: 1.6; color: var(--muted); }

/* Recent listening stays out of the flow: a corner launcher that opens upward. */
.listening { position: fixed; left: var(--gutter); bottom: var(--gutter); z-index: 50; }
.listening summary { display: grid; place-items: center; width: 48px; height: 48px; list-style: none; color: var(--paper); background: var(--ink); }
.listening svg { width: 20px; height: 20px; }
.listening details:not([open]) .listening__close, .listening details[open] .listening__icon { display: none; }
.listening__card { position: absolute; left: 0; bottom: calc(100% + 0.75rem); display: block; width: max-content; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.listening__card img { max-width: none; width: min(400px, calc(100vw - 2 * var(--gutter)), calc((100vh - 48px - 0.75rem - 2 * var(--gutter)) * 400 / 328)); width: min(400px, calc(100vw - 2 * var(--gutter)), calc((100dvh - 48px - 0.75rem - 2 * var(--gutter)) * 400 / 328)); }

.footer { border-top: 1px solid var(--line); padding-top: 4.5rem; padding-bottom: 1.5rem; }
.footer__row, .footer__bottom { display: grid; grid-template-columns: 7fr 5fr; margin-left: calc(25% + 4px); gap: 1rem; align-items: baseline; }
.footer__row + .footer__row { margin-top: 4rem; }
.footer__row > p { font-size: 1.125rem; }
.footer__cta { display: flex; align-items: baseline; gap: 1rem; width: fit-content; min-height: 44px; font-size: 1.125rem; letter-spacing: normal; line-height: 1.4; }
.socials { display: flex; flex-direction: column; align-items: flex-start; }
.socials a { display: flex; align-items: center; gap: 0.5rem; min-height: 30px; font-size: 1.125rem; }
.footer__bottom { margin-top: 4.5rem; font-size: 0.8rem; }
.back-top { display: inline-flex; gap: 0.75rem; align-items: center; width: fit-content; min-height: 44px; }

:lang(ko) { word-break: keep-all; }
html:lang(ko) h1, html:lang(ja) h1, html:lang(zh-Hant) h1 { line-height: 1.25; letter-spacing: normal; }
html:lang(ko) h2, html:lang(ja) h2, html:lang(zh-Hant) h2 { line-height: 1.3; }

@media (max-width: 1100px) {
  .header { grid-template-columns: 20% 1fr auto; }
  .header__actions { gap: 1.4rem; }
  .nav { gap: 1.2rem; }
  .brand__name { display: none; }
  .experience__entry > summary, .experience__entry--static { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) 12px; gap: 0.6rem; }
  .experience__description { padding-left: 0.3rem; }
  .beyond__grid { gap: 2rem; }
}

@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .experience { padding-top: 0; }
  .work .section__heading { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 3rem; }
  .work .section__heading > .section__index, .work .section__heading > h2 { grid-column: auto; margin-bottom: 0; }
  .header { grid-template-columns: auto minmax(0, 1fr); gap: 0 1rem; padding-top: 0.5rem; }
  .header__actions { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 1.2rem; }
  .header__contact { font-size: 0.75rem; }
  .language select { width: 6rem; font-size: 0.75rem; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 1rem; padding-top: 0.25rem; }
  .nav a { font-size: 0.85rem; }
  .hero { padding-top: 1.5rem; padding-bottom: 4rem; }
  .avatar { position: static; width: 92px; margin-bottom: 2rem; }
  h1 { font-size: clamp(1.9rem, 6vw, 2.75rem); line-height: 1.15; letter-spacing: normal; }
  h1::before { display: none; }
  .section { padding-bottom: 4rem; }
  .section__heading, .principles .section__heading { display: block; margin-left: 0; margin-bottom: 1.5rem; }
  .section__index { padding: 0; margin-bottom: 1.5rem; font-size: 0.9rem; }
  .section__body, .principles .section__body { margin-left: 0; }
  .experience .section__heading { height: auto; margin-bottom: 1.5rem; }
  .experience .section__index { padding: 0; }
  h2, .group-title { font-size: 1.9rem; }
  .group-title { margin-bottom: 1rem; }
  .experience__group + .experience__group { margin-top: 2.5rem; }
  .experience__entry > summary, .experience__entry--static { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr) 12px; min-height: 44px; padding: 0.65rem 0; gap: 0.75rem; align-items: start; }
  .experience__date { font-size: 0.8rem; }
  .experience__name { font-size: 1rem; }
  .experience__role { font-size: 0.8rem; }
  .experience__description { padding: 0.5rem 0 1.5rem; font-size: 1rem; }
  .principles summary { min-height: 44px; padding-block: 0.6rem; }
  .principles h3, .principles details > p { font-size: 1rem; }
  .projects { grid-template-columns: 1fr; gap: 3rem; }
  .project__header { margin-top: 0.9rem; }
  .project h3 { font-size: 1.5rem; }
  .project > p { font-size: 1rem; }
  .community__item > summary, .community__item > p { font-size: 1rem; }
  .community__item > summary { min-height: 44px; }
  .beyond__grid { grid-template-columns: 1fr; gap: 3rem; }
  .education__item > p, .beyond__personal { font-size: 1rem; }
  .education__title h4 { font-size: 1rem; }
  .education__title > span { font-size: 0.85rem; }
  .footer { padding-top: 2.5rem; padding-bottom: 5rem; }
  .footer__row, .footer__bottom { margin-left: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; }
  .footer__cta { font-size: 1.2rem; gap: 0.5rem; }
  .socials a { min-height: 44px; }
  .footer__bottom { margin-top: 3rem; font-size: 0.75rem; }
}

@media (max-width: 374px) {
  .header__actions { gap: 0.6rem; }
  .header__contact { gap: 0.4rem; font-size: 0.7rem; }
  .language select { width: 5.5rem; font-size: 0.7rem; }
  .language__icon { width: 13px; }
  h1 { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .nav a, .text-link, .header__contact, .music__caption, .socials a, .back-top {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: left calc(100% - 6px);
    background-size: 0 1px;
    transition: background-size 350ms ease;
  }
  .nav a:hover, .text-link:hover, .header__contact:hover, .music__caption:hover, .socials a:hover, .back-top:hover { background-size: 100% 1px; }
  .text-link > [aria-hidden], .header__contact > [aria-hidden], .music__caption > [aria-hidden], .socials [aria-hidden], .project h3 [aria-hidden] { transition: transform 350ms ease; }
  .text-link:hover > [aria-hidden], .header__contact:hover > [aria-hidden], .music__caption:hover > [aria-hidden], .socials a:hover [aria-hidden], .project h3 a:hover [aria-hidden] { transform: translate(2px, -2px); }
}

@media (prefers-reduced-motion: no-preference) {
  .listening__icon rect { transform-box: fill-box; transform-origin: bottom; animation: listening-bar 900ms ease-in-out infinite alternate; }
  .listening__icon rect:nth-child(1) { --low: 0.3; --high: 1.6; }
  .listening__icon rect:nth-child(2) { --low: 0.2; animation-duration: 700ms; animation-direction: alternate-reverse; }
  .listening__icon rect:nth-child(3) { --low: 0.45; --high: 2.28; animation-duration: 1100ms; }
}
@keyframes listening-bar { from { transform: scaleY(var(--low)); } to { transform: scaleY(var(--high, 1)); } }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .music__instrument img { transition: transform 450ms cubic-bezier(0.22, 1, 0.36, 1); }
  .music__instrument:hover img { transform: rotate(-4deg); }
}

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

@media print {
  .header, .back-top, .listening { display: none; }
  .hero { padding-top: 0; padding-bottom: 2rem; }
  .avatar { position: static; width: 70px; margin-bottom: 1rem; }
  h1 { font-size: 2rem; }
  h1::before { display: none; }
  .section { padding-bottom: 2rem; }
  .section__heading, .section__body, .principles .section__body, .projects, .community { margin-left: 0; }
  .experience .section__heading { height: auto; margin-bottom: 1rem; }
  .experience__entry, .project, .education__item { break-inside: avoid; }
}
