/* tienyuhuang.com — ASCII type-poster theme. Colours come from the wind-farm ASCII scene. */
:root {
  color-scheme: dark;
  --ground: #020409;        /* night */
  --panel: #060b16;
  --ink: #dbe3ef;           /* turbine white */
  --soft: #a3abbf;
  --mute: #6c6d8f;
  --sun: #e8b070;           /* the sun */
  --glow: #c7702e;
  --sea: #3a7396;           /* waves */
  --sea-deep: #1b3850;
  --foam: #8fb6cc;
  --hair: rgba(219, 227, 239, .12);
  --zh: 'Noto Sans TC';      /* Traditional Chinese font: Latin text keeps the two fonts below, Chinese falls back to this */
  --display: 'Bricolage Grotesque', var(--zh), system-ui, sans-serif;
  --mono: 'Space Mono', var(--zh), ui-monospace, Menlo, Consolas, monospace;
  --page: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.7 var(--display); overflow-x: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ascii-type { margin: 0; line-height: 1; font-family: var(--mono); white-space: pre; overflow: hidden; }

/* ---------- top-down ASCII swell behind every section after the hero ---------- */
.sea { position: fixed; inset: 0; z-index: 0; margin: 0; pointer-events: none; overflow: hidden; white-space: pre;
  font: 14px/14px var(--mono); color: var(--sea-deep); opacity: .75; }
.sea .f { color: var(--sea); }
.sea .g { color: var(--foam); }

/* a low ASCII swell behind the content that rises a little while the page glides to another section */
.tide-veil { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.tide-veil.on { display: block; }

/* ---------- navigation: liquid-glass bar, hamburger on the far left ---------- */
.nav { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  width: min(var(--page), calc(100% - 32px)); display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 8px; border-radius: 16px;
  background: rgba(14, 18, 28, .42); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 40px rgba(0, 0, 0, .4); }
.burger { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
  color: var(--ink); cursor: pointer; transition: color .25s, border-color .25s, background .2s; }
.burger:hover { background: rgba(255, 255, 255, .08); }
/* three lines that fold into an X */
.burger span { position: absolute; left: 11px; width: 16px; height: 1.6px; border-radius: 2px; background: currentColor;
  transition: transform .35s cubic-bezier(.7, 0, .2, 1), opacity .2s; }
.burger span:nth-child(1) { top: 13px; } .burger span:nth-child(2) { top: 18.2px; } .burger span:nth-child(3) { top: 23.4px; }
.menu-open .burger { color: var(--sun); border-color: rgba(232, 176, 112, .4); }
.menu-open .burger span:nth-child(1) { transform: translateY(5.2px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
.menu-open .burger span:nth-child(3) { transform: translateY(-5.2px) rotate(-45deg); }
.brand { font: 600 17px var(--display); letter-spacing: -.01em; text-decoration: none; }
/* Contact: a glass button like the rest of the bar, with an envelope icon */
.cta { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 7px 14px; color: var(--ink);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  font: 600 14px var(--display); text-decoration: none; transition: border-color .2s, background .2s, color .2s; }
.cta svg { width: 15px; height: 15px; fill: none; stroke: var(--sun); stroke-width: 2; }
.cta:hover { color: var(--sun); border-color: rgba(232, 176, 112, .45); background: rgba(232, 176, 112, .08); }
/* EN / 中 switch */
.lang { margin-left: auto; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .12); color: var(--mute); font-size: 12px; }
.lang button { all: unset; cursor: pointer; padding: 3px 8px; border-radius: 7px; font: 600 13px var(--display); color: var(--soft); }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: rgba(232, 176, 112, .14); color: var(--sun); }
.lang button:focus-visible { outline: 2px solid var(--sun); }
.menu { position: fixed; top: 78px; left: max(16px, calc(50% - var(--page) / 2)); z-index: 20; width: 280px; padding: 8px; border-radius: 14px;
  background: rgba(14, 18, 28, .6); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .1); visibility: hidden; transform: scaleY(0); transform-origin: top;
  transition: transform .38s steps(8), visibility 0s .38s; }
.menu-open .menu { visibility: visible; transform: none; transition: transform .38s steps(8); }
.menu a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; font: 700 15px var(--mono); letter-spacing: .02em; }
.menu a::before { content: "> "; color: var(--sun); }
.menu a:hover, .menu a:focus-visible, .menu a[aria-current] { background: rgba(255, 255, 255, .06); outline: none; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; z-index: 1; }
.hero .hero-scene { position: absolute; inset: 0; will-change: opacity, transform; }
.hero-copy { position: absolute; left: 24px; right: 24px; bottom: 70px; z-index: 2; will-change: opacity, transform; }
.hero-copy::before { content: ""; position: absolute; inset: -40px -24px -110px; z-index: -1; pointer-events: none;
  background: linear-gradient(transparent, rgba(2, 4, 9, .9) 40%); }
.hero-name .ascii-type { color: var(--sun); text-shadow: 0 0 6px rgba(199, 112, 46, .6); }
.hero-name > div + div { margin-top: 1.2vw; }
.scroll-cue { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; will-change: opacity; }
.scroll-cue span { font: 700 14px var(--mono); letter-spacing: .4em; padding-left: .4em; text-transform: uppercase; animation: cue-pulse 2.4s ease-in-out infinite; }
.scroll-cue pre { margin: 0; font: 700 12px/1.1 var(--mono); color: var(--sun); animation: cue-bob 1.6s ease-in-out infinite; }
@keyframes cue-pulse { 50% { opacity: .45; } }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(5px); opacity: .55; } }

/* ---------- sections ---------- */
main { position: relative; z-index: 1; }
.section { max-width: var(--page); margin: 0 auto; padding: 110px 24px 30px; }
.section h2 { margin: 0 0 28px; padding-bottom: 16px; border-bottom: 1px solid var(--hair);
  font: 800 clamp(32px, 4.2vw, 48px)/1 var(--display); letter-spacing: -.03em; }
.section h2::after { content: "."; color: var(--sun); }
.sub { margin: 44px 0 6px; color: var(--sun); font: 600 12px var(--display); letter-spacing: .16em; text-transform: uppercase; }

.intro-name { margin: 0 0 10px; font: 800 clamp(26px, 3.2vw, 36px)/1.1 var(--display); letter-spacing: -.03em; }
.intro-title { position: relative; padding-left: 1.1em; font: 400 clamp(17px, 2vw, 22px)/1.5 var(--display); color: var(--soft); }
.intro-title::before { content: "~"; position: absolute; left: 0; color: var(--sea); }

/* expertise: titles first, details slide open */
.acc { border-top: 1px solid var(--hair); }
.acc-item { border-bottom: 1px solid var(--hair); background: rgba(2, 4, 9, .55); }
.acc-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 16px; padding: 20px 4px; cursor: pointer; }
.acc-btn:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.acc-title { font: 600 clamp(19px, 2.2vw, 25px)/1.25 var(--display); letter-spacing: -.015em; transition: color .2s, transform .25s; }
.acc-icon { margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--hair); display: grid; place-items: center;
  color: var(--soft); transition: color .2s, border-color .2s; }
.acc-icon i { position: relative; display: block; width: 10px; height: 10px; transition: transform .3s; }
.acc-icon i::before, .acc-icon i::after { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px; margin-top: -.75px;
  border-radius: 1px; background: currentColor; }
.acc-icon i::after { transform: rotate(90deg); }
.acc-btn:hover .acc-title { color: var(--sun); transform: translateX(4px); }
.acc-item.open .acc-title { color: var(--sun); }
.acc-item.open .acc-icon { color: var(--sun); border-color: rgba(232, 176, 112, .4); }
.acc-item.open .acc-icon i { transform: rotate(45deg); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s cubic-bezier(.4, 0, .2, 1); }
.acc-item.open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div { overflow: hidden; }
.acc-panel ul { margin: 0; padding: 0 4px 22px; list-style: none; color: var(--soft); font-size: 17px; }
.acc-panel li { position: relative; padding: 6px 0 6px 26px; opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; }
.acc-panel li::before { content: "->"; position: absolute; left: 0; color: var(--sea); }
.acc-item.open li { opacity: 1; transform: none; }
.acc-item.open li:nth-child(2) { transition-delay: .06s; }
.acc-item.open li:nth-child(3) { transition-delay: .12s; }

/* press */
.press { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 16px; }
.press-card { min-width: 0; text-decoration: none; }
.press-img { aspect-ratio: 3 / 2; background: var(--panel); border: 1px solid var(--hair); overflow: hidden; position: relative; }
.press-img img { width: 100%; height: 100%; object-fit: cover; }
.press-img img[hidden] { display: none; }
.gal-nav { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px;
  background: rgba(2, 4, 9, .55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, .14); }
.gal-nav button { all: unset; width: 28px; height: 26px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; font: 600 15px var(--display); color: var(--ink); }
.gal-nav button:hover { background: rgba(255, 255, 255, .1); color: var(--sun); }
.gal-nav button:focus-visible { outline: 2px solid var(--sun); }
.gal-count { min-width: 30px; text-align: center; font-size: 13px; color: var(--soft); }
.press-img pre { margin: 0; font: 10px/1 var(--mono); color: #234a68; }
.press-img .ph-label { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mute); font-size: 12px; }
.press { align-items: start; }
.press-card { background: rgba(2, 4, 9, .6); padding-bottom: 6px; }
.press-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 12px 0 4px; cursor: pointer; }
.press-btn:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.press-title { font: 600 18px/1.3 var(--display); transition: color .2s; }
.press-btn .acc-icon { width: 24px; height: 24px; margin-top: 1px; }
.press-btn:hover .press-title, .press-card.open .press-title { color: var(--sun); }
.press-card.open .acc-icon { color: var(--sun); border-color: rgba(232, 176, 112, .4); }
.press-card.open .acc-icon i { transform: rotate(45deg); }
.press-card .meta { color: var(--mute); font-size: 14px; letter-spacing: .03em; }
.press-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s cubic-bezier(.4, 0, .2, 1); }
.press-card.open .press-body { grid-template-rows: 1fr; }
.press-body > div { overflow: hidden; }
.press-body p { margin: 10px 0 0; color: var(--soft); font-size: 17px; line-height: 1.65; }
/* side-open layout (wide screens): the opened card moves to the top and takes the whole row;
   a large photo on the left, and its title, date and summary slide out to the right */
@media (min-width: 721px) {
  .press-card { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 32px; align-content: start; }
  .press-card > * { grid-column: 1; }
  .press-card.open { order: -1; grid-column: 1 / -1; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr; padding: 0 0 6px; }
  .press-card.open .press-img { grid-column: 1; grid-row: 1 / 5; align-self: start; }
  .press-card.open .press-btn, .press-card.open .meta, .press-card.open .press-body { grid-column: 2; padding-right: 8px;
    animation: press-slide .55s cubic-bezier(.2, .7, .2, 1) both; }
  .press-card.open .press-btn { grid-row: 1; padding-top: 6px; }
  .press-card.open .press-title { font-size: clamp(22px, 2.3vw, 30px); line-height: 1.2; }
  .press-card.open .meta { grid-row: 2; animation-delay: .06s; }
  .press-card.open .press-body { grid-row: 3; animation-delay: .12s; }
  .press-body { display: none; }
  .press-card.open .press-body { display: block; }
  .press-card.open .press-body > div { overflow: visible; }
  .press-card.open .press-body p { margin-top: 18px; }
}
@keyframes press-slide { from { opacity: 0; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
.press-body a { display: inline-block; margin-top: 10px; color: var(--sun); font-size: 14px; text-decoration: none; border-bottom: 1px solid rgba(232, 176, 112, .4); }

/* projects: image left, text right */
.project { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; padding: 20px; background: rgba(2, 4, 9, .6); border: 1px solid var(--hair); }
.project + .project { margin-top: 22px; }
.project h4 { margin: 0 0 12px; font: 800 clamp(24px, 2.8vw, 32px)/1.05 var(--display); letter-spacing: -.03em; }
.proj-toggle { all: unset; cursor: pointer; transition: color .2s; }
.proj-toggle:hover, .project.open .proj-toggle { color: var(--sun); }
.proj-toggle:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }
.project .lead { margin: 0 0 12px; color: var(--ink); font-size: 18px; }
.project .body { margin: 0; padding-top: 2px; color: var(--soft); font-size: 17px; }
.proj-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.4, 0, .2, 1); }
.project.open .proj-more { grid-template-rows: 1fr; }
.proj-more > div { overflow: hidden; }
.more-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--sun); font: 600 12px var(--display);
  letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid rgba(232, 176, 112, .4); }
.more-btn i { font-style: normal; display: inline-block; transition: transform .3s; }
.project.open .more-btn i { transform: rotate(180deg); }
.more-btn:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

/* publications */
.pubs { border-top: 1px solid var(--hair); margin-top: 12px; }
.pub { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 16px 4px; border-bottom: 1px solid var(--hair); background: rgba(2, 4, 9, .55); }
.pub b { display: block; font: 600 18px/1.35 var(--display); }
.pub em { display: block; margin-top: 4px; color: var(--soft); font-size: 15px; }
.pub .year { color: var(--mute); font-size: 14px; }

/* contact (bottom of the last page only) */
.contact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact .mail { font: 600 clamp(20px, 2.6vw, 28px) var(--display); text-decoration: none; border-bottom: 1px solid var(--hair); transition: color .2s, border-color .2s; }
.contact .mail:hover { color: var(--sun); border-color: var(--sun); }
.contact .label { display: block; color: var(--mute); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--ink);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12); transition: color .2s, border-color .2s, background .2s; }
.icon-btn:hover { color: var(--sun); border-color: rgba(232, 176, 112, .45); background: rgba(232, 176, 112, .08); }
.icon-btn svg { width: 22px; height: 22px; }
footer { position: relative; z-index: 1; max-width: var(--page); margin: 0 auto; padding: 50px 24px 60px; color: var(--mute); font-size: 13px; }

/* Chinese: CJK glyphs need normal tracking and a little more line height */
:lang(zh-Hant) .section h2, :lang(zh-Hant) .intro-name, :lang(zh-Hant) .acc-title, :lang(zh-Hant) .project h4,
:lang(zh-Hant) .press-title, :lang(zh-Hant) .brand { letter-spacing: .02em; }
:lang(zh-Hant) .sub, :lang(zh-Hant) .more-btn { letter-spacing: .2em; }
:lang(zh-Hant) .acc-panel ul, :lang(zh-Hant) .press-body p, :lang(zh-Hant) .project .body, :lang(zh-Hant) .project .lead { line-height: 1.9; }
:lang(zh-Hant) .project h4 { line-height: 1.3; }

@media (max-width: 720px) {
  .press, .project { grid-template-columns: 1fr; }
  .section { padding-top: 84px; }
  .hero-copy { bottom: 74px; }
  .hero-name > div + div { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .acc-panel, .acc-panel li, .menu, .acc-title, .press-body, .proj-more, .more-btn i, .burger span { transition: none; }
  .scroll-cue span, .scroll-cue pre, .press-card.open .press-btn, .press-card.open .meta, .press-card.open .press-body { animation: none; }
}
