/* Personal site: one type scale, one neutral palette and purposeful navigation. */
:root {
  --bg: #eef0f3; --surface: #fff; --surface-alt: #e2e5ea; --ink: #191c21;
  --muted: #535b66; --line: #cbd0d8; --action: #234eb7; --blue: #234eb7;
  --radius: 12px; --ease: cubic-bezier(.2,.8,.2,1); --gut: clamp(24px,5.55vw,80px);
  --space-ink: var(--ink); --space-muted: var(--muted); --space-line: var(--line);
  --space-panel: var(--surface); --space-accent: var(--action);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #131517; --surface: #1b1e22; --surface-alt: #22262b; --ink: #f0f1f2;
  --muted: #b0b6bf; --line: #383e46; --action: #a8c3ff; --blue: #a8c3ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--action); outline-offset: 4px;
}
h1, h2, h3, p { margin-top: 0; }
p { line-height: 1.65; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: var(--gut); padding: 12px 16px; background: var(--ink); color: var(--bg); transform: translateY(-160%); z-index: 100; }
.skip-link:focus { transform: none; }
.home-shell, .login-shell, .hub-shell { width: min(100% - 2 * var(--gut),1280px); margin: auto; }
.site-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 19px; font-weight: 700; letter-spacing: -.035em; }
.wordmark img { object-fit: contain; }
.header-actions, .hub-header-actions { display: flex; align-items: center; gap: 16px; }
.hub-header-actions form { margin: 0; }
.btn, .theme-toggle, .logout-button, .primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--ink); font-size: 14px; line-height: 1.4;
}
.btn--primary, .primary-button { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.theme-toggle { font-size: 13px; }
.text-link, .back-link, .link { min-height: 44px; display: inline-flex; align-items: center; gap: 12px; font-size: 14px; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.home-shell { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
.home-main { display: grid; grid-template-columns: 5fr 7fr; gap: 8%; align-items: center; padding: 56px 0; }
.intro { padding: 0; }
.home-role { margin-bottom: 24px; font-size: 16px; font-weight: 500; color: var(--muted); }
.intro h1 { margin: 0 0 32px; font-size: clamp(48px,5.55vw,80px); line-height: 1.03; letter-spacing: -.05em; }
.name-en { display: block; margin-top: 12px; font-size: .48em; letter-spacing: -.035em; font-weight: 500; }
.intro .home-about { position: static; font-size: 18px; color: var(--ink); text-align: left; margin-bottom: 24px; }
.home-resume-link { color: var(--action); font-size: 16px; font-weight: 500; }
.portal-grid { display: grid; gap: 0; margin: 0; min-width: 0; }
.three-worlds .portal {
  position: relative; display: grid; grid-template-columns: 1fr 152px; align-items: center;
  min-height: 168px; padding: 20px 0 20px 24px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent; overflow: visible; box-shadow: none;
}
.three-worlds .portal:last-child { border-bottom: 1px solid var(--line); }
.portal-art { grid-column: 2; grid-row: 1; width: 152px; height: 132px; position: relative; overflow: hidden; }
.portal-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 180ms var(--ease); }
.portal-art .pose-active { opacity: 0; }
.portal-copy { grid-column: 1; grid-row: 1; min-width: 0; padding: 0; }
.portal-title { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.portal-title h2 { margin: 0; font-size: clamp(24px,2.2vw,32px); line-height: 1.2; letter-spacing: -.03em; font-weight: 700; }
.portal-title .arrow { width: auto; height: auto; color: var(--muted); font-size: 22px; font-weight: 400; }
.portal-copy p { margin: 0 0 8px; font-size: 16px; color: var(--ink); word-break: keep-all; }
.portal-detail { color: var(--muted); font-size: 13px; }
.portal:hover .arrow, .portal:focus-visible .arrow { color: var(--action); }
@media (hover:hover) and (pointer:fine) {
  .portal.has-swap:hover .pose-idle, .portal:hover .has-swap .pose-idle { opacity: 0; }
  .portal.has-swap:hover .pose-active, .portal:hover .has-swap .pose-active { opacity: 1; }
}
.portal:focus-visible .has-swap .pose-idle { opacity: 0; }
.portal:focus-visible .has-swap .pose-active { opacity: 1; }
/* Copy is beside the artwork; imagery is never given a caption or a tinted stage. */
.hub-main { padding: 56px 0 64px; }
.hub-intro, .demo-heading { margin-bottom: 48px; }
.hub-intro h1, .demo-heading h1, .login-art h1, .construction-main h1 {
  font-size: clamp(36px,4vw,56px); line-height: 1.08; letter-spacing: -.04em; margin: 0 0 16px;
}
.hub-intro p, .demo-heading p, .login-art p, .construction-main p { font-size: 18px; margin: 0 0 16px; }
.connection-tag { color: var(--muted); font-size: 13px; }
.hub-local-note { padding: 16px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.illustrated-tools { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.tool-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: transparent; box-shadow: none; }
.tool-illustration { display: grid; place-items: center; height: 168px; margin-bottom: 24px; }
.tool-illustration img { width: 100%; height: 100%; object-fit: contain; }
.tool-copy { flex: 1; display: flex; flex-direction: column; }
.tool-card h2 { font-size: 24px; letter-spacing: -.03em; line-height: 1.3; margin: 0 0 12px; }
.tool-card p { font-size: 16px; margin: 0 0 24px; color: var(--ink); word-break: keep-all; }
.tool-action { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--action); }
.demo-portals { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.demo-portal { display: grid; grid-template-columns: 1fr 136px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: transparent; min-width: 0; }
.demo-portal .portal-art { width: 136px; height: 168px; }
.demo-portal .portal-copy { display: flex; flex-direction: column; }
.demo-portal .portal-title h2 { font-size: 24px; overflow-wrap: anywhere; }
.demo-launch { margin-top: auto; padding-top: 24px; font-size: 14px; color: var(--action); display: flex; justify-content: space-between; }
.login-shell, .personal-shell { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
.login-main { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,440px); gap: 12%; align-items: center; padding: 64px 0; }
.login-art { text-align: left; }
.login-art img { display: block; max-width: 280px; width: 100%; height: auto; margin: 24px 0 0; }
.login-card { padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.login-card h2 { margin: 0 0 8px; font-size: 26px; }
.muted { color: var(--muted); font-size: 14px; }
.login-card form label { display: block; margin: 24px 0 8px; font-size: 14px; }
.login-card input:not([type=hidden]) { display: block; width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 16px; }
.login-card .primary-button { width: 100%; margin-top: 24px; }
.login-help, .forgot-link { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.forgot-link .link { font-size: 13px; color: var(--action); }
.notice { padding: 16px; font-size: 14px; background: var(--surface-alt); border-radius: 6px; line-height: 1.6; }
.notice.error { border-left: 3px solid #c84f56; }
.preview-box { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.construction-main { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 64px 0; }
.construction-art { width: 100%; max-width: 440px; margin: auto; }
.construction-art img { width: 100%; height: auto; object-fit: contain; }
.home-return { width: fit-content; margin-top: 24px; gap: 24px; }
/* The loader describes a real pending request; it has no walking or cycling mascot. */
.research-loading { position: fixed; inset: 0; display: grid; place-items: center; z-index: 90; background: var(--bg); }
.research-loading[hidden] { display: none; }
.research-loading-card { max-width: 420px; padding: 32px; text-align: left; }
.research-loading h2 { font-size: 22px; line-height: 1.4; }
.research-loading p { font-size: 14px; color: var(--muted); }
.loading-actions { display: flex; gap: 16px; align-items: center; margin-top: 24px; font-size: 14px; }
.loading-actions[hidden] { display: none; }
.loading-actions button { padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
[hidden] { display: none !important; }

/* Utility screens keep their data-dense layouts; only the presentation layer changes. */
html[data-theme] body[data-surface="research"] {
  --navy: var(--surface); --navy-soft: var(--surface-alt); --shadow: none;
  background: var(--bg); color: var(--ink);
}
html[data-theme] body[data-surface="research"] :is(.sidebar,.topbar,.main-panel,.panel-card,.planning-panel,.strategy-panel,.stat-card,.modal,.drawer) {
  background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: none;
}
html[data-theme] body[data-surface="research"] .sidebar { border-right: 1px solid var(--line); }
html[data-theme] body[data-surface="research"] .brand-copy strong { color: var(--ink); }
html[data-theme] body[data-surface="research"] :is(.brand-copy small,.nav-item,.breadcrumb,.page-description,.stat-label,.stat-meta,.section-kicker,.app-footer,.nav-section-label) { color: var(--muted); font-size: 13px; }
html[data-theme] body[data-surface="research"] .nav-item { min-height: 44px; font-size: 14px; }
html[data-theme] body[data-surface="research"] .nav-item.active { color: var(--ink); background: var(--surface-alt); box-shadow: inset 2px 0 var(--action); border-radius: 4px; }
html[data-theme] body[data-surface="research"] .page-heading h1 { font-size: 32px; }
html[data-theme] body[data-surface="research"] .page-description { max-width: 76ch; line-height: 1.7; }
html[data-theme] body[data-surface="research"] .stat-icon { display: none; }
html[data-theme] body[data-surface="research"] .stat-value { color: var(--ink); }
html[data-theme] body[data-surface="research"] :is(.primary-button,.secondary-button) { min-height: 40px; font-size: 13px; box-shadow: none; }
html[data-theme] body[data-surface="research"] .primary-button { background: var(--action); color: var(--bg); border-color: var(--action); }
html[data-theme] body[data-surface="research"] .secondary-button { background: transparent; color: var(--ink); border-color: var(--line); }
html[data-theme] body[data-surface="research"] .mascot-card { background: transparent; border: 0; padding: 0; text-align: left; }
html[data-theme] body[data-surface="research"] .mascot-card img { width: 100px; height: 100px; margin: 0; }
html[data-theme] body[data-surface="research"] .mascot-card strong { color: var(--muted); font-size: 13px; }
html[data-theme] body[data-surface="research"] .workspace-note { font-size: 13px; padding-left: 0; }
html[data-theme] body[data-surface="expenses"] {
  --ex-bg: var(--bg); --ex-panel: var(--surface); --ex-soft: var(--surface-alt);
  --ex-text: var(--ink); --ex-muted: var(--muted); --ex-line: var(--line); --ex-blue: var(--action);
}
html[data-theme] body[data-surface="expenses"] .intro-row h1 { font-size: 40px; line-height: 1.15; }
html[data-theme] body[data-surface="expenses"] .intro-row p { font-size: 16px; }
html[data-theme] body[data-surface="expenses"] .intro-icon { display: none; }
html[data-theme] body[data-surface="expenses"] :is(.expense-wordmark,.report-tag,footer) { text-transform: none; letter-spacing: 0; font-size: 13px; }
html[data-theme] body[data-surface="expenses"] :is(button,.upload-label,select) { min-height: 44px; }
html[data-theme] body[data-surface="expenses"] .metric.emphasis { background: var(--surface-alt); color: var(--ink); border-color: var(--line); }
html[data-theme] body[data-surface="expenses"] .metric.emphasis :is(span,small) { color: var(--muted); }

/* Resume keeps its content and tabs, with the same restrained surfaces and accent. */
body[data-typography="resume"] { background: var(--bg); }
body[data-typography="resume"] #root > div { background: var(--bg) !important; animation: none; }
body[data-typography="resume"] #root > div { padding: clamp(24px,4vw,56px); }
html[data-theme] body[data-surface="research"] .nav-icon { display: none; }
body[data-typography="resume"] :is(.bg-gray-800,.bg-gray-700,.bg-gray-900) { background: var(--surface); box-shadow: none; border: 1px solid var(--line); }
body[data-typography="resume"] :is(.text-gray-200,.text-white) { color: var(--ink); }
body[data-typography="resume"] :is(.text-gray-300,.text-gray-400) { color: var(--muted); }
body[data-typography="resume"] :is(.text-sky-400,.text-blue-300,.text-blue-400) { color: var(--action); }
body[data-typography="resume"] :is(.bg-blue-600,.bg-blue-500) { background: var(--action); color: var(--bg); }
body[data-typography="resume"] .shadow-lg { box-shadow: none; }
body[data-typography="resume"] .animate-glowPulse { animation: none; }
body[data-typography="resume"] .border-blue-500 { border-color: var(--line); border-width: 1px; }
body[data-typography="resume"] :is(.animate-fadeIn,.animate-tabContentFadeIn) { animation: none; opacity: 1; }
@media (max-width:1023px) {
  .home-main { grid-template-columns: 1fr 1.2fr; gap: 32px; }
  .three-worlds .portal { grid-template-columns: 1fr 104px; padding-left: 12px; }
  .portal-art { width: 104px; height: 120px; }
  .portal-copy p { font-size: 14px; }
  .illustrated-tools { gap: 16px; }
  .tool-card { padding: 20px; }
  .tool-illustration { height: 140px; }
  .demo-portal { grid-template-columns: 1fr; }
  .demo-portal .portal-art { grid-column: 1; grid-row: 2; justify-self: end; height: 140px; margin-top: 16px; }
  .demo-portal .portal-copy { grid-row: 1; }
}
@media (max-width:760px) {
  .site-header { min-height: 76px; gap: 16px; }
  .wordmark { font-size: 17px; gap: 8px; }
  .wordmark img { width: 28px; height: 28px; }
  .home-main { grid-template-columns: 1fr; gap: 40px; padding: 40px 0; }
  .intro h1 { font-size: 52px; margin-bottom: 24px; }
  .home-role { margin-bottom: 16px; font-size: 14px; }
  .intro .home-about { font-size: 16px; margin-bottom: 12px; }
  .three-worlds .portal { grid-template-columns: 1fr 104px; min-height: 132px; padding: 16px 0; }
  .portal-art { height: 100px; }
  .portal-title h2 { font-size: 25px; }
  .portal-copy p { font-size: 15px; }
  .site-footer { gap: 16px; font-size: 13px; }
  .header-actions, .hub-header-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .hub-header-actions .theme-toggle { padding-inline: 10px; }
  .hub-header-actions .text-link { width: 100%; justify-content: flex-end; min-height: 32px; }
  .hub-main { padding: 40px 0; }
  .hub-intro, .demo-heading { margin-bottom: 32px; }
  .illustrated-tools, .demo-portals { grid-template-columns: 1fr; }
  .tool-card { flex-direction: row; gap: 24px; align-items: center; }
  .tool-illustration { order: 2; height: 120px; width: 96px; flex: 0 0 96px; margin: 0; }
  .tool-copy { order: 1; min-width: 0; }
  .tool-card h2 { font-size: 22px; }
  .tool-card p { font-size: 16px; margin-bottom: 16px; }
  .tool-action { font-size: 14px; padding-top: 12px; }
  .demo-portal { grid-template-columns: 1fr 96px; gap: 16px; }
  .demo-portal .portal-art { grid-column: 2; grid-row: 1; width: 96px; margin: 0; }
  .demo-portal .portal-copy { grid-column: 1; }
  .demo-portal .portal-title h2 { font-size: 22px; }
  .login-main { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; }
  .login-art img { display: none; }
  .login-art h1 { font-size: 40px; }
  .login-art p { font-size: 16px; }
  .login-card { padding: 24px; }
  .construction-main { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  .construction-art { max-width: 260px; }
  html[data-theme] body[data-surface="research"] .page-heading h1 { font-size: 27px; }
}
@media (max-width:360px) {
  .wordmark { font-size: 15px; }
  .theme-toggle { padding-inline: 10px; }
  .three-worlds .portal { grid-template-columns: 1fr 80px; }
  .portal-art { width: 80px; }
  .portal-copy p { font-size: 14px; }
  .tool-card { padding: 16px; gap: 12px; }
  .tool-illustration { width: 72px; flex-basis: 72px; }
  .demo-portal { grid-template-columns: 1fr; }
  .demo-portal .portal-art { grid-column: 1; grid-row: 2; justify-self: end; height: 96px; }
}
@media (prefers-reduced-motion:reduce) {
  .portal-art img { transition: none; }
}
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { --bg: #fff; --ink: #191c21; --muted: #535b66; --surface: #fff; --line: #cbd0d8; --action: #234eb7; }
}
