:root {
  color-scheme: dark;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --background: #202225;
  --surface: #25282d;
  --bar: #2b2e34;
  --inset: #292e36;
  --ink: #f0f2f5;
  --muted: #b5bfce;
  --border: #49525f;
  --accent: #dfbb76;
  --connector: #aa8c56;
  --dot: #8995a52a;
  --button: #dfb66d;
  --button-ink: #272017;
  --key: #8bc9ed;
  --status-ok: #48bb78;
  --boot-amber: #ffbd2e;
  --shadow: #10121728;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}


* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(90px + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(var(--dot) .7px, transparent .8px) 0 0 / 24px 24px, var(--background);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, summary, a[href], [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, summary, [role="button"], .telemetry-drawer-handle, .terminal-chip, .terminal-pill-btn {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button:disabled, [aria-disabled="true"] { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel summary:focus-visible { outline-offset: -2px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon { width: 20px; height: 20px; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 15px; padding: 8px 15px; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: calc(74px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(24px, calc((100vw - 1580px) / 2)) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.scroll-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, rgba(223, 187, 118, 0.4), var(--accent) 70%, #fff 100%);
  transform-origin: left;
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(223, 187, 118, 0.65);
  transition: opacity .2s ease;
  will-change: transform;
}
.scroll-progress-bar.is-active {
  opacity: 1;
}
@supports (backdrop-filter: blur(12px)) {
  .topbar {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}
.brand { font: 19px var(--mono); white-space: nowrap; color: var(--muted); }
.brand strong, .terminal { color: var(--accent); }
.terminal { margin-right: 10px; text-shadow: 0 0 10px rgba(223, 187, 118, .5); }
.terminal-cursor { display: inline-block; font-weight: bold; color: var(--accent); text-shadow: 0 0 8px var(--accent); animation: cursor-blink .8s steps(1) infinite; }
@keyframes cursor-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.navigation { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 25px); }
.navigation a { position: relative; color: var(--muted); font: 14px var(--mono); padding: 27px 0; transition: color .2s ease; }
.navigation a[aria-current] { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .navigation a:hover { color: var(--accent); } }
.navigation a::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s var(--ease-out-quint), opacity .2s ease;
  opacity: 0;
}
.navigation a[aria-current]::after { transform: scaleX(1); opacity: 1; }
@media (hover: hover) and (pointer: fine) { .navigation a:hover::after { transform: scaleX(1); opacity: .5; } }
@media (hover: hover) and (pointer: fine) { .navigation a[aria-current]:hover::after { opacity: 1; } }

.controls { display: flex; align-items: center; gap: 8px; }
.control { min-width: 40px; height: 40px; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; display: grid; place-items: center; font: 14px var(--mono); color: var(--muted); transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s var(--ease-out-quart); }
@media (hover: hover) and (pointer: fine) { .control:hover { background: var(--inset); border-color: var(--border); color: var(--ink); } }
.control:active { transform: scale(.95); }
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  gap: 2px;
}
.lang-option {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1 var(--mono);
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .18s ease, background-color .2s var(--ease-out-quint), box-shadow .2s ease, transform .15s var(--ease-out-quint);
  user-select: none;
}
@media (hover: hover) and (pointer: fine) { .lang-option:hover {
  color: var(--ink);
} }
.lang-option.is-active {
  background: var(--accent);
  color: #1a1712;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-weight: 700;
}
.lang-option:active {
  transform: scale(0.94);
}
.menu-toggle { display: none; }

.shell { width: min(1580px, calc(100% - 48px)); margin: auto; padding: 38px 0 24px; }
.board { position: relative; display: grid; grid-template-columns: 0.88fr 1.12fr; grid-template-areas: "profile resume" "profile portfolio" "experience certificates"; gap: 32px 72px; align-items: start; }
.board > * { min-width: 0; }
.connections { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.connections path { stroke: var(--connector); stroke-width: 1.5; }
.connections circle { fill: var(--accent); stroke: var(--background); stroke-width: 2; }
.panel {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 8px 22px var(--shadow);
  overflow: hidden;
  transition:
    transform 200ms var(--ease-out),
    border-color 180ms ease,
    box-shadow 200ms var(--ease-out);
}
.panel:active,
.panel:has(> summary:active) {
  border-color: var(--accent);
  box-shadow: 0 12px 28px var(--shadow), 0 0 20px rgba(223, 187, 118, .2);
}
@media (hover: hover) and (pointer: fine) {
  .panel:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 36px var(--shadow), 0 0 24px rgba(223, 187, 118, .2); }
}
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .motion-ready .reveal { opacity: 0; transform: translateY(15px); transition: opacity .55s ease, transform .65s var(--ease-out-quint); }
  .motion-ready .reveal.is-visible { opacity: 1; transform: none; }
}
.filebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 0 16px; background: var(--bar); border-bottom: 1px solid var(--border); font: 13px var(--mono); color: var(--muted); }
.file-label { display: flex; align-items: center; gap: 9px; }
.file-label .icon { width: 16px; height: 16px; }
.window-dots { display: flex; gap: 5px; }
.window-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .55;
  transform: scale(1);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition:
    background-color .32s ease,
    transform .38s var(--ease-out-quint),
    opacity .3s ease,
    box-shadow .35s ease;
}
.window-dots i:nth-child(1) { transition-delay: 0s; }
.window-dots i:nth-child(2) { transition-delay: 45ms; }
.window-dots i:nth-child(3) { transition-delay: 90ms; }

.panel.is-focused,
.code-window.is-focused {
  border-color: rgba(223, 187, 118, 0.65);
  box-shadow: 0 10px 30px var(--shadow), 0 0 24px rgba(223, 187, 118, 0.26);
  transition: border-color .3s ease, box-shadow .35s var(--ease-out-quint);
}
.code-window.is-focused .window-dots i {
  opacity: 1;
  transform: scale(1.28);
}
.code-window.is-focused .window-dots i:nth-child(1) {
  background-color: #ff5f56;
  box-shadow: 0 0 6px rgba(255, 95, 86, 0.55);
}
.code-window.is-focused .window-dots i:nth-child(2) {
  background-color: #ffbd2e;
  box-shadow: 0 0 6px rgba(255, 189, 46, 0.55);
}
.code-window.is-focused .window-dots i:nth-child(3) {
  background-color: #27c93f;
  box-shadow: 0 0 6px rgba(39, 201, 63, 0.55);
}

@media (hover: hover) and (pointer: fine) {
  .panel:hover .window-dots i,
  .code-window:hover .window-dots i {
    opacity: 1;
    transform: scale(1.28);
  }
  .panel:hover .window-dots i:nth-child(1),
  .code-window:hover .window-dots i:nth-child(1) {
    background-color: #ff5f56;
    box-shadow: 0 0 6px rgba(255, 95, 86, 0.55);
  }
  .panel:hover .window-dots i:nth-child(2),
  .code-window:hover .window-dots i:nth-child(2) {
    background-color: #ffbd2e;
    box-shadow: 0 0 6px rgba(255, 189, 46, 0.55);
  }
  .panel:hover .window-dots i:nth-child(3),
  .code-window:hover .window-dots i:nth-child(3) {
    background-color: #27c93f;
    box-shadow: 0 0 6px rgba(39, 201, 63, 0.55);
  }
}

.profile { grid-area: profile; align-self: start; display: flex; flex-direction: column; }
.profile-body { padding: 24px 20px 19px; display: flex; flex-direction: column; flex: 1; }
.identity { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: 19px; }
.portrait { width: 152px; height: 170px; object-fit: cover; object-position: left center; border: 1px solid var(--border); border-radius: 6px; }
.identity-info { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; }
.identity-header { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
h1 { font-size: clamp(28px, 2.2vw, 36px); line-height: 1.15; letter-spacing: -.9px; margin: 0; }
.identity-info .contact-buttons { display: inline-flex; align-items: center; gap: 6px; grid-column: 2; grid-row: 1; align-self: start; justify-self: end; }
.identity-info .contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 28px;
  min-height: 28px;
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  transition: color .18s ease, transform .22s var(--ease-out-quint);
}
.identity-info .contact-button .icon { width: 18px; height: 18px; stroke-width: 1.6; }
.identity-info .contact-button[aria-disabled="true"] { opacity: .4; }
.identity-info .contact-button[href]:focus-visible { color: var(--accent); background: transparent; transform: translateY(-1.5px); }
@media (hover: hover) and (pointer: fine) { .identity-info .contact-button[href]:hover { color: var(--accent); background: transparent; transform: translateY(-1.5px); } }
.identity-info .contact-button:active {
  transform: scale(.92);
  transition: transform 100ms var(--ease-out-quint);
}
.role {
  color: var(--accent);
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
  min-height: 26px;
  word-break: break-word;
}
.typewriter-cursor {
  display: inline-block;
  color: var(--accent);
  margin-left: 3px;
  font-family: var(--mono);
  font-weight: 700;
  vertical-align: -1px;
  user-select: none;
  animation: typewriter-blink 1.05s steps(2, start) infinite;
  transition: filter .15s ease, opacity .15s ease;
}
.typewriter-cursor.is-typing {
  animation: none;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(223, 187, 118, .7));
}
@keyframes typewriter-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.location { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 6px; align-items: center; margin: 14px 0 0; color: var(--muted); font: 13px var(--mono); }
.location .icon { width: 14px; height: 14px; }
.bio { display: grid; grid-column: 1 / -1; grid-row: 3; color: var(--muted); font: 14px/1.8 var(--mono); margin: 15px 0 0; }
.bio-source, .bio-typed { grid-area: 1 / 1; }
.bio-typed { display: none; }
.bio[data-animated="true"]::before { content: attr(data-reserve); visibility: hidden; grid-area: 1 / 1; }
.bio[data-animated="true"] .bio-typed { display: block; }
.bio[data-typing="false"] .typewriter-cursor { display: none; }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 25px; padding: 0; list-style: none; }
.skills li {
  font: 13px var(--mono);
  padding: 8px 11px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .22s var(--ease-out-quint), border-color .2s ease, background-color .2s ease, box-shadow .22s ease, color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .skills li:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 16px var(--shadow), 0 0 14px rgba(223, 187, 118, .25);
  color: var(--accent);
} }
.skills li:active {
  transform: translateY(-1px) scale(0.97);
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(223, 187, 118, .35);
  color: var(--accent);
  transition-duration: 0.08s;
}

@keyframes skill-cascade {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .motion-ready .profile:not(.is-visible) .skills li {
    opacity: 0;
  }
  .motion-ready .profile.is-visible .skills li {
    animation: skill-cascade 0.38s var(--ease-out-quint) backwards;
  }
  .motion-ready .profile.is-visible .skills li:nth-child(1) { animation-delay: 0.04s; }
  .motion-ready .profile.is-visible .skills li:nth-child(2) { animation-delay: 0.08s; }
  .motion-ready .profile.is-visible .skills li:nth-child(3) { animation-delay: 0.12s; }
  .motion-ready .profile.is-visible .skills li:nth-child(4) { animation-delay: 0.16s; }
  .motion-ready .profile.is-visible .skills li:nth-child(5) { animation-delay: 0.20s; }
  .motion-ready .profile.is-visible .skills li:nth-child(6) { animation-delay: 0.24s; }
  .motion-ready .profile.is-visible .skills li:nth-child(7) { animation-delay: 0.28s; }
  .motion-ready .profile.is-visible .skills li:nth-child(8) { animation-delay: 0.32s; }
}

.code-window {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .2s ease, box-shadow .2s ease, transform .12s ease-out;
}
@media (hover: hover) and (pointer: fine) { .code-window:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--shadow);
} }
.code-window:active {
  transform: scale(0.985);
}
.code-window.is-copied {
  border-color: var(--status-ok);
  box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.35), 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: border-color .15s ease, box-shadow .2s ease, transform .12s ease-out;
}
.code-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(223, 187, 118, .2), transparent) top / 100% 50px no-repeat;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
@media (hover: hover) and (pointer: fine) {
  .code-window:hover::after {
    animation: code-scan 1.2s cubic-bezier(.4, 0, .2, 1);
  }
}
.code-window.is-copied::after {
  animation: code-scan 1.2s cubic-bezier(.4, 0, .2, 1);
}
@keyframes code-scan {
  0% { transform: translateY(-50px); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}
.code-window .filebar { font-size: 12px; }
.code-file-label { display: flex; align-items: center; gap: 7px; }
.copy-hint {
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transition: opacity .2s ease, color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .code-window:hover .copy-hint {
  opacity: 1;
  color: var(--accent);
} }
.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27c93f;
  box-shadow: 0 0 8px #27c93f;
  animation: live-glow 1.6s ease-in-out infinite;
}
@keyframes live-glow {
  0%, 100% { opacity: .5; transform: scale(.85); box-shadow: 0 0 4px #27c93f; }
  50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 12px #27c93f, 0 0 18px rgba(39, 201, 63, .4); }
}
.profile-code { font: 13px/2 var(--mono); margin: 0; padding: 18px 12px; color: var(--muted); counter-reset: code-line; }
.code-line {
  display: flex;
  gap: 13px;
  white-space: pre-wrap;
  padding: 1px 4px;
  margin: 0 -4px;
  border-radius: 3px;
  transition: background-color .15s ease;
}
@media (hover: hover) and (pointer: fine) { .code-line:hover { background-color: var(--inset); } }
.code-line::before { content: counter(code-line); counter-increment: code-line; width: 10px; flex: none; text-align: right; color: var(--muted); opacity: .7; }
.code-text { border-left: 1px solid var(--border); padding-left: 12px; overflow-wrap: anywhere; }
.key { color: var(--key); }
.value { color: var(--accent); }

.portfolio { grid-area: portfolio; position: relative; z-index: 1; display: grid; gap: 17px; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.portfolio-summary { padding: 0; }
.portfolio-summary-body { padding: 15px; }
.image-slot {
  position: relative;
  display: block;
  width: 100%;
  height: 235px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.blueprint-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.portfolio-card[open] .image-slot {
  height: 265px;
}
@media (max-width: 600px) {
  .image-slot { height: 185px; }
  .portfolio-card[open] .image-slot { height: 210px; }
}

.blueprint-zoom-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(16, 20, 26, 0.88);
  border: 1px solid rgba(223, 187, 118, 0.45);
  border-radius: 5px;
  color: var(--accent);
  font: 11px var(--mono);
  font-weight: 600;
  cursor: pointer;
  z-index: 3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 120ms var(--ease-out-quint), background-color .15s ease, border-color .15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) { .blueprint-zoom-btn:hover {
  background: rgba(223, 187, 118, 0.2);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
} }
.blueprint-zoom-btn:active {
  transform: scale(0.95);
}
.zoom-icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}
.bp-scanline {
  animation: bp-radar-sweep 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) { .portfolio-card:hover .bp-scanline {
  animation-duration: 2s;
} }
@keyframes bp-radar-sweep {
  0% { transform: translateX(-160px); opacity: 0; }
  15% { opacity: 0.9; }
  85% { opacity: 0.9; }
  100% { transform: translateX(540px); opacity: 0; }
}

.bp-flow {
  stroke: var(--accent);
  stroke-dasharray: 6 3;
  animation: bp-stream 1.5s linear infinite;
  opacity: 0.9;
}
@media (hover: hover) and (pointer: fine) { .portfolio-card:hover .bp-flow {
  animation-duration: 0.65s;
  stroke: #ffffff;
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 8px rgba(223, 187, 118, 0.7));
} }
.bp-node-box {
  stroke: var(--border);
  fill: var(--surface);
  transition: stroke .25s ease, filter .25s ease, fill .25s ease;
}
@media (hover: hover) and (pointer: fine) { .portfolio-card:hover .bp-node-box {
  stroke: var(--key);
  filter: drop-shadow(0 0 4px rgba(139, 201, 237, 0.3));
} }
@keyframes bp-stream {
  from { stroke-dashoffset: 18; }
  to { stroke-dashoffset: 0; }
}
.bp-argo-box {
  stroke: var(--accent);
  stroke-width: 1.8px;
}
.portfolio-image { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.portfolio-caption { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 3px 0; }
.portfolio-caption h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.portfolio-arrow { display: grid; place-items: center; width: 30px; height: 27px; border: 1px solid var(--connector); border-radius: 5px; color: var(--accent); transition: transform .3s var(--ease-out-quint); }
.portfolio-card[open] .portfolio-arrow { transform: rotate(90deg); }
.portfolio-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .32s var(--ease-out-quint);
  padding: 0 18px;
}
.portfolio-card[open] .portfolio-detail {
  grid-template-rows: 1fr;
}
.portfolio-detail > * {
  min-height: 0;
  overflow: hidden;
}
.project-description { margin: 0 0 15px; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.project-link { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 16px; color: var(--accent); font: 14px var(--mono); }

.experience { grid-area: experience; }
@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }
}
.experience details::details-content,
.certificates::details-content {
  transition: height .28s var(--ease-out-quint), opacity .22s ease, content-visibility .28s allow-discrete;
  height: 0;
  overflow: clip;
  opacity: 0;
}
.experience details[open]::details-content,
.certificates[open]::details-content {
  height: auto;
  opacity: 1;
}
.disclosure-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 19px; }
.disclosure-summary h2 { font-size: 17px; font-weight: 600; line-height: 1.4; margin: 0; }
.disclosure-summary > div { min-width: 0; }
.disclosure-summary .chevron { flex: none; color: var(--accent); width: 17px; height: 17px; transition: transform .3s var(--ease-out-quint); }
details[open] > .disclosure-summary .chevron { transform: rotate(180deg); }
.summary-meta { display: block; color: var(--muted); font: 13px/1.6 var(--mono); margin-top: 8px; }
details[open] .summary-meta { display: none; }
.timeline { border-top: 1px solid var(--border); }
.timeline-entry { position: relative; display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 13px; padding: 21px 18px 22px 25px; transition: background-color .2s ease; }
@media (hover: hover) and (pointer: fine) { .timeline-entry:hover { background-color: var(--inset); } }
.timeline-entry::before { content: ""; position: absolute; width: 1px; left: 23px; top: 28px; bottom: -26px; background: var(--connector); }
.timeline-entry:last-child::before { bottom: 28px; }
.timeline-entry::after { content: ""; position: absolute; left: 20px; top: 27px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--inset); transition: transform .25s var(--ease-out-quint), box-shadow .25s ease; }
.timeline-entry.is-active-node::after {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px var(--inset), 0 0 10px var(--accent);
}
@media (hover: hover) and (pointer: fine) { .timeline-entry:hover::after {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px var(--inset), 0 0 10px var(--accent);
} }
.timeline-entry.is-active-node .timeline-text h3 {
  color: var(--accent);
}
.timeline-entry:first-child::after { animation: beacon-pulse 2s cubic-bezier(.16, 1, .3, 1) infinite; }
@keyframes beacon-pulse {
  0% { box-shadow: 0 0 0 3px var(--inset), 0 0 0 0 rgba(223, 187, 118, .9); }
  65% { box-shadow: 0 0 0 3px var(--inset), 0 0 0 12px rgba(223, 187, 118, 0); }
  100% { box-shadow: 0 0 0 3px var(--inset), 0 0 0 0 rgba(223, 187, 118, 0); }
}
.timeline-entry + .timeline-entry { border-top: 1px solid var(--border); }
.timeline-date { padding-left: 12px; color: var(--key); font: 12px/1.75 var(--mono); }
.timeline-date time { display: block; }
.timeline-text { border-left: 1px solid var(--border); padding-left: 14px; min-width: 0; }
.timeline-text h3 { font-size: 16px; line-height: 1.4; margin: 0; transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) { .timeline-entry:hover .timeline-text h3 { color: var(--accent); } }
.company { color: var(--accent); font-size: 15px; margin: 4px 0 10px; }
.achievement { font-size: 14px; line-height: 1.8; color: var(--muted); margin: 0; }
.metric {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 12px 14px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font: 14px/1.6 var(--mono);
  transition: border-color .2s ease, transform .22s var(--ease-out-quint), box-shadow .22s ease, background-color .2s ease;
  touch-action: manipulation;
}
.metric:active {
  transform: scale(0.985);
  border-color: var(--connector);
}
.metric strong {
  color: var(--accent);
  font-weight: 700;
  display: inline-block;
  transition: transform .2s var(--ease-out-quint), color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .timeline-entry:hover .metric {
  border-color: var(--accent);
  background-color: var(--surface);
  transform: translateX(4px);
  box-shadow: 0 4px 16px var(--shadow), 0 0 12px rgba(223, 187, 118, 0.15);
} }
@media (hover: hover) and (pointer: fine) { .timeline-entry:hover .metric strong {
  transform: scale(1.04);
  color: #fff;
  text-shadow: 0 0 8px rgba(223, 187, 118, 0.45);
} }
.metric .icon {
  color: var(--accent);
  flex: none;
  width: 18px;
  height: 18px;
  transition: transform .25s var(--ease-out-quint);
}
@media (hover: hover) and (pointer: fine) { .timeline-entry:hover .metric .icon {
  transform: scale(1.15) rotate(4deg);
} }

.certificates { grid-area: certificates; }
.certificates > summary { padding: 0; display: block; }
.certificates > summary .filebar { border-bottom: none; }
.certificates .file-label { margin: 0; font: inherit; }
.certificate-list { display: grid; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.certificate { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--inset); }
@media (hover: hover) and (pointer: fine) { .certificate:hover { border-color: var(--connector); } }
.seal { width: 36px; height: 40px; flex: none; position: relative; display: grid; place-items: center; color: var(--accent); font: 12px var(--mono); }
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.certificate h3 { margin: 0; font-size: 14px; line-height: 1.55; font-weight: 500; text-wrap: balance; }
.certificate time { display: block; margin-top: 4px; color: var(--accent); font: 12px var(--mono); }
.certificate-preview { padding: 15px 18px; color: var(--muted); font-size: 14px; }
.certificates[open] .certificate-preview { display: none; }

.resume { grid-area: resume; padding: 17px; }
.resume-button {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 59px;
  padding: 15px 17px;
  background: var(--button);
  color: var(--button-ink);
  border: 1px solid var(--button);
  border-radius: 7px;
  font-size: 21px;
  font-weight: bold;
  transition: filter .2s ease, transform .2s var(--ease-out-quint), box-shadow .2s ease;
}
.resume-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-160%) skewX(-20deg);
  transition: transform .65s var(--ease-out-quint);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .resume-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(223, 182, 109, 0.28);
} }
@media (hover: hover) and (pointer: fine) { .resume-button:hover::after {
  transform: translateX(250%) skewX(-20deg);
} }
.resume-button:active {
  transform: translateY(0) scale(0.985);
}
.resume-button .arrow-icon {
  transition: transform .25s var(--ease-out-quint);
}
@media (hover: hover) and (pointer: fine) { .resume-button:hover .arrow-icon {
  transform: translateX(4px);
} }
.resume-button:active .arrow-icon {
  transform: translate(2px, 3px);
}
.resume-button-label { display: flex; align-items: center; gap: 12px; }
.resume-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: var(--muted); font: 13px var(--mono); }
.resume-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  border-radius: 4px;
  transition: color .2s ease, transform 120ms var(--ease-out-quint), opacity 100ms ease;
}
@media (hover: hover) and (pointer: fine) { .resume-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  transform: translateY(1.5px);
} }
.resume-links a:active {
  transform: scale(0.96) translateY(2px);
  opacity: 0.85;
}

.board.staggered { display: block; }
.board.staggered > :not(.connections) { position: absolute; top: var(--card-top); }
.board.staggered > [data-col='left'] { left: 0; width: calc(47% - 36px); }
.board.staggered > [data-col='right'] { right: 0; width: calc(53% - 36px); }
.board.staggered > .resume { right: 0; width: calc(53% - 36px); }
.board.staggered :is(#profile > .filebar, #experience > .filebar, #portfolio-01 .filebar, #certificates .filebar) { cursor: grab; user-select: none; }
.board.staggered .filebar :is(a, button) { cursor: pointer; }
.board.staggered .filebar .window-dots { cursor: pointer; padding: 8px 4px; margin: -8px -4px; }
.board.is-board-dragging, .board.is-board-dragging * { cursor: grabbing !important; user-select: none; }
.board.is-board-dragging .panel { transition: none; }
@media (hover: hover) and (pointer: fine) { .board.is-board-dragging .panel:hover { transform: translateY(1.5px); } }
.board .is-dragging { z-index: 5; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; color: var(--muted); font: 12px var(--mono); }

@media (max-width: 1200px) {
  .topbar { gap: 16px; }
  .brand { font-size: 17px; }
  .navigation { gap: 14px; }
  .navigation a { font-size: 13px; }
  .identity { grid-template-columns: 132px minmax(0,1fr); gap: 14px; }
  .portrait { width: 132px; height: 148px; }
  .profile-body { padding-left: 17px; padding-right: 17px; }
  .bio { font-size: 13px; }
  .profile-code { font-size: 12px; }
  .timeline-entry { grid-template-columns: 85px minmax(0,1fr); gap: 9px; padding-right: 15px; }
  .timeline-text { padding-left: 12px; }
}

@media (max-width: 1100px) {
  .board { gap: 24px 88px; }

  .profile { align-self: start; }
  .code-window { margin-top: 0; }
  .navigation { gap: 11px; }
  .identity { grid-template-columns: 134px minmax(0,1fr); }
  .portrait { width: 134px; height: 150px; }
  .resume { max-width: 650px; width: 100%; justify-self: center; }
}

@media (max-width: 1250px) {
  .topbar { min-height: 66px; padding: 0 18px; gap: 12px; }
  .brand { font-size: 17px; }
  .menu-toggle { display: grid; }
  .navigation {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    left: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 30px var(--shadow);
    transform-origin: top right;
    transition: opacity .18s ease, transform .22s var(--ease-out-quint);
  }
  .navigation[data-open="false"]:not(.is-closing) { display: none; }
  .navigation.is-closing {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  .navigation[data-open="true"] {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  @starting-style {
    .navigation[data-open="true"] {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
  }
  .navigation a {
    padding: 13px 14px;
    font-size: 15px;
    transition: background-color .15s ease, color .15s ease, transform .12s var(--ease-out-quint);
    touch-action: manipulation;
  }
  .navigation a::after { inset: 9px auto 9px 0; width: 2px; height: auto; border-radius: 1px; transform: scaleY(0); transform-origin: top; opacity: 1; transition: transform 200ms var(--ease-out); }
  .navigation a[aria-current]::after,
  .navigation a[aria-current]:hover::after { transform: scaleY(1); opacity: 1; }
  .navigation a:hover::after { transform: scaleY(0); opacity: 1; }
  .navigation[data-open="true"] a[aria-current]::after { animation: nav-current-in 200ms var(--ease-out) 140ms backwards; }
  @media (prefers-reduced-motion: reduce) {
    .navigation a::after { transition: none; }
    .navigation[data-open="true"] a[aria-current]::after { animation: none; }
  }
  @media (hover: hover) and (pointer: fine) { .navigation a:hover { background: var(--inset); border-radius: 4px; } }
  .navigation a:active { transform: scale(0.98); background: var(--inset); }

  .navigation[data-open="true"] a {
    animation: nav-item-drop .24s var(--ease-out-quint) backwards;
  }
  .navigation[data-open="true"] a:nth-child(1) { animation-delay: 30ms; }
  .navigation[data-open="true"] a:nth-child(2) { animation-delay: 65ms; }
  .navigation[data-open="true"] a:nth-child(3) { animation-delay: 100ms; }
  .navigation[data-open="true"] a:nth-child(4) { animation-delay: 135ms; }
}

@keyframes nav-current-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes nav-item-drop {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 74px; }
  .shell { width: min(590px, calc(100% - 32px)); padding-top: 24px; }
  .board { display: flex; flex-direction: column; gap: 38px; }
  .connections { display: block; }
  .topbar { min-height: 58px; padding: 0 16px; flex-wrap: nowrap; justify-content: space-between; gap: 10px; }
  .brand { font-size: 16px; flex: none; }
  .controls { margin-left: auto; gap: 5px; }
  .control { width: 34px; min-width: 34px; height: 34px; padding: 0; font-size: 13px; }
  .board > :not(.connections) { width: 100%; }


  .panel, .portfolio-card { overflow: visible; }
  .filebar { border-radius: 8px 8px 0 0; }
  .identity { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
  .identity-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: start;
    column-gap: 8px;
  }
  .identity-header {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }
  .identity-info .contact-buttons {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    align-self: start;
    justify-self: end;
    gap: 0;
    margin-top: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
  }
  .identity-info .contact-button {
    min-width: 32px;
    min-height: 32px;
    padding: 3px;
  }
  .identity-info .contact-button .icon {
    width: 15px;
    height: 15px;
  }
  h1 { font-size: clamp(20px, 4.8vw, 25px); line-height: 1.15; letter-spacing: -0.6px; }
  .portrait { width: 120px; height: 134px; }
  .role { font-size: 15px; }
  .location { grid-column: 1 / -1; grid-row: 2; margin: 8px 0 0; }
  .bio { grid-column: 1 / -1; grid-row: 3; margin: 10px 0 0; font: 14px/1.7 "Trebuchet MS", "Segoe UI", sans-serif; }
  .skills { margin-bottom: 16px; }
  .code-window { display: block; margin-top: 12px; }
  .profile-code { font: 12px/1.85 var(--mono); padding: 12px 10px; }
  .code-line { gap: 10px; }
  .copy-hint { opacity: .7; font-size: 10px; }
  .profile-body { padding: 21px 18px; }
  .timeline-entry { display: flex; flex-direction: column; gap: 10px; padding: 22px 18px 24px 44px; position: relative; }
  .timeline-entry::before { left: 20px; top: 29px; }
  .timeline-entry::after { left: 17px; top: 27px; }
  .timeline-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--key); background: var(--inset); border: 1px solid var(--border); padding: 3px 8px; border-radius: 4px; width: fit-content; margin-bottom: 2px; }
  .timeline-date time { display: inline; }
  .timeline-text { border-left: none; padding-left: 0; }
  .achievement { font-size: 15px; }
  .certificate h3 { font-size: 15px; }
  .resume { max-width: none; order: 10; }
  .resume-button { font-size: 22px; }
  .footer { font-size: 11px; }
}

@media (max-width: 420px) {
  .brand-tagline { display: none; }
  .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; min-height: 54px; }
  .controls { gap: 3px; }
  .control { width: 32px; min-width: 32px; height: 32px; padding: 0; font-size: 12px; }
  .lang-switch { padding: 2px; }
  .lang-option { padding: 5px 8px; font-size: 11px; }
  .identity { grid-template-columns: 108px minmax(0,1fr); gap: 13px; }
  .identity-info .contact-button { min-width: 28px; min-height: 28px; padding: 2px; }
  .identity-info .contact-button .icon { width: 14px; height: 14px; }
  .portrait { width: 108px; height: 120px; }
  h1 { font-size: 23px; }
  .role { font-size: 15px; min-height: 42px; }
  .location { font-size: 12px; }
  .skills li { font-size: 12px; padding: 7px 9px; }
  .profile-code { font-size: 11px; padding: 10px 8px; }
  .code-text { padding-left: 8px; }
  .timeline-entry { padding-left: 36px; padding-right: 12px; }
  .timeline-entry::before { left: 16px; }
  .timeline-entry::after { left: 13px; }
  .filebar { padding-left: 13px; padding-right: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typewriter-cursor { display: none !important; }
}

.certificate { padding: 0; border: 0; background: transparent; gap: 10px; transition: transform .25s var(--ease-out-quint); }
@media (hover: hover) and (pointer: fine) { .certificate:hover { transform: translateY(-2px); } }
.certificate { gap: 24px; }
.cert-badge { display: block; flex: none; width: 176px; }
.cert-badge img { display: block; width: 100%; height: auto; }
.certificate-list { container-type: inline-size; }
@container (max-width: 600px) {
  .certificate {
    display: grid;
    grid-template-columns: clamp(112px, 42cqw, 150px) minmax(0, 1fr);
    grid-template-areas: "badge date" "badge verified" "title title" "tags tags" "view view";
    align-items: center;
    gap: 0 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--inset);
    transition: border-color .2s ease, transform .25s var(--ease-out-quint);
  }
  @media (hover: hover) and (pointer: fine) { .certificate:hover { border-color: var(--accent); } }
  .certificate:active { background-color: var(--surface); border-color: var(--accent); }
  .certificate .cert-badge { grid-area: badge; width: auto; align-self: center; }
  .certificate :is(.credential-frame, .credential-text, .credential-head) { display: contents; }
  .certificate time { grid-area: date; align-self: end; margin: 0 0 4px; font-size: 13px; line-height: 1.45; text-wrap: balance; word-break: keep-all; }
  .certificate .verified { grid-area: verified; justify-self: start; align-self: start; margin-top: 4px; }
  .certificate h3 { grid-area: title; margin-top: 16px; font-size: 15px; line-height: 1.4; text-wrap: balance; }
  .certificate .credential-tags { grid-area: tags; display: flex; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
  .certificate .cert-view { grid-area: view; justify-self: stretch; justify-content: center; margin-top: 14px; min-height: 44px; padding: 0 18px; }
}
@container (max-width: 300px) { .certificate h3 { font-size: 14px; } }
.credential-frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 1;
  min-width: 0;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--inset);
  transition: border-color .2s ease, box-shadow .25s var(--ease-out-quint), transform .2s ease;
}
@media (hover: hover) and (pointer: fine) { .certificate:hover .credential-frame {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow), 0 0 16px rgba(223, 187, 118, 0.16);
  transform: translateX(2px);
} }
.certificate:active {
  transform: scale(0.985);
}
.certificate:active .credential-frame {
  border-color: var(--accent);
  background-color: var(--surface);
}
.credential-text { min-width: 0; }
.verified { display: inline-flex; align-items: center; gap: 5px; flex: none; color: #7fe0ac; background: #214337; padding: 6px 9px; border-radius: 6px; font: 13px var(--mono); transition: transform .2s ease; }
@media (hover: hover) and (pointer: fine) { .certificate:hover .verified { transform: scale(1.05); } }
.verified .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
  transition: transform .35s var(--ease-out-quint);
}
@media (hover: hover) and (pointer: fine) { .certificate:hover .verified .icon { transform: scale(1.24) rotate(6deg); } }
@media (max-width: 1050px) { .credential-frame { align-items: flex-start; flex-direction: column; gap: 8px; } }

.connections .connector-base {
  stroke: var(--connector);
  stroke-width: 1.5;
  fill: none;
  transition: stroke .25s ease, stroke-width .25s ease;
}
.connections circle.connector-node {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
  opacity: 0.95;
  transition: transform .25s var(--ease-out-quint), fill .2s ease;
}
.connections .transmission {
  fill: #ffffff;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0.95;
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 6px rgba(229, 169, 59, 0.45));
  pointer-events: none;
  transition: filter .3s ease;
}

@media (max-width: 760px) {
  .connections circle.connector-node { r: 1.75px; stroke-width: 1; }
  .connections .transmission {
    r: 1.4px;
    stroke-width: .7;
    filter: drop-shadow(0 0 1.5px var(--accent)) drop-shadow(0 0 3px rgba(229, 169, 59, 0.45));
  }
  .connections .transmission + .transmission { r: 1.15px; }
  .connections .spine-packet { r: 2.5px; }
}

@media (hover: hover) and (pointer: fine) {
  .board:has(.panel:hover, .portfolio-card:hover) .connections .connector-base {
    stroke: var(--accent);
    stroke-width: 1.8;
  }
  .board:has(.panel:hover, .portfolio-card:hover) .connections .transmission {
    filter: drop-shadow(0 0 5px #ffffff) drop-shadow(0 0 10px var(--accent)) drop-shadow(0 0 16px rgba(229, 169, 59, 0.8));
  }
}
.portfolio-summary:active, .disclosure-summary:active, .certificates > summary:active { background: var(--inset); }
.disclosure-summary:active { transform: scale(0.985); }
@media (prefers-reduced-motion: no-preference) {
  .board:not(.staggered) :is(#profile > .filebar, #experience > .filebar, #portfolio-01 .filebar, #certificates .filebar) { transition: background-color .15s ease; }
}

.experience-overview { display: grid; gap: 6px; }
.summary-result { color: var(--accent); }
.portfolio-card, .experience, .certificates {
  transition:
    border-color .32s ease,
    box-shadow .35s var(--ease-out-quint);
}
.portfolio-summary-body, .disclosure-summary, .certificates > summary .filebar {
  transition: background-color .28s ease;
}
.portfolio-arrow .icon { transition: transform 200ms var(--ease-out-quint); }
.portfolio-card:has(> summary:focus-visible), .experience:has(.disclosure-summary:focus-visible), .certificates:has(> summary:focus-visible),
.portfolio-card:active, .experience:has(.disclosure-summary:active), .certificates:has(> summary:active) { border-color: var(--accent); }
.portfolio-card:has(> summary:focus-visible) .portfolio-summary-body,
.experience .disclosure-summary:focus-visible,
.certificates > summary:focus-visible .filebar,
.portfolio-card:active .portfolio-summary-body,
.experience:has(.disclosure-summary:active) .disclosure-summary,
.certificates:has(> summary:active) > summary .filebar { background: var(--inset); }
.portfolio-card:not([open]):has(> summary:focus-visible) .portfolio-arrow .icon,
.portfolio-card:not([open]):active .portfolio-arrow .icon { transform: translateX(3px); }
@media (hover: hover) and (pointer: fine) {
  .portfolio-card:hover, .experience:has(.disclosure-summary:hover), .certificates:has(> summary:hover) { border-color: var(--accent); }
  .portfolio-card:hover .portfolio-summary-body, .disclosure-summary:hover, .certificates > summary:hover .filebar { background: var(--inset); }
  .portfolio-card:not([open]):hover .portfolio-arrow .icon { transform: translateX(3px); }
}

@keyframes target-pulse {
  0% { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229, 169, 59, 0.45), 0 8px 24px var(--shadow); }
  50% { border-color: var(--accent); box-shadow: 0 0 0 6px rgba(229, 169, 59, 0.18), 0 8px 24px var(--shadow); }
  100% { border-color: var(--border); box-shadow: 0 4px 14px var(--shadow); }
}
:target {
  animation: target-pulse 1.4s var(--ease-out-quint);
}

:root.animations-paused .live-pulse-dot,
:root.animations-paused .timeline-entry:first-child::after,
:root.animations-paused .terminal-cursor {
  animation-play-state: paused !important;
}

.hud-toast {
  position: fixed;
  z-index: 100;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(24px) scale(.95);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 30px;
  color: var(--ink);
  font: 13px/1.2 var(--mono);
  box-shadow: 0 16px 36px var(--shadow), 0 0 18px rgba(223, 187, 118, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .2s ease;
}
.hud-toast[data-active="true"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity .25s var(--ease-out-quint), transform .28s var(--ease-out-quint);
}
.hud-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #27c93f;
  color: #0d1117;
  font-size: 11px;
  font-weight: bold;
  transform: scale(0.85);
  transition: transform .25s var(--ease-out-quint);
}
.hud-toast[data-active="true"] .hud-check {
  transform: scale(1);
}

.telemetry-header-slot { display: none; }

.telemetry-capsule-wrap {
  position: fixed;
  z-index: 50;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.telemetry-capsule {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font: 11px/1.3 var(--mono);
  box-shadow: 0 4px 16px var(--shadow), 0 0 12px rgba(223, 187, 118, 0.12);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s var(--ease-out-quart), box-shadow .2s var(--ease-out-quart), transform .2s var(--ease-out-quart);
}

@media (hover: hover) and (pointer: fine) {
  .telemetry-capsule:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px var(--shadow), 0 0 16px rgba(223, 187, 118, 0.22);
    transform: translateY(-2px);
  }
}

.telemetry-capsule:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.telemetry-capsule:active {
  transform: scale(0.96);
  transition: transform 100ms var(--ease-out-quint);
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-ok);
  position: relative;
  flex-shrink: 0;
}

.telemetry-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--status-ok);
  animation: telemetry-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes telemetry-ping {
  0% { transform: scale(0.8); opacity: 1; }
  75%, 100% { transform: scale(2.4); opacity: 0; }
}

.telemetry-pill-text {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.telemetry-status {
  color: var(--status-ok);
  font-weight: 700;
}
.telemetry-dot, .telemetry-status { transition: background-color .3s ease, color .3s ease; }
.telemetry-capsule.is-boot-amber .telemetry-dot { background: var(--boot-amber); }
.telemetry-capsule.is-boot-amber .telemetry-dot::after { border-color: var(--boot-amber); }
.telemetry-capsule.is-boot-amber .telemetry-status { color: var(--boot-amber); }
.telemetry-status.is-booting { font-variant-numeric: tabular-nums; }
:root:lang(zh-Hant) .telemetry-status.is-booting { letter-spacing: -0.04em; }

.telemetry-sep {
  color: var(--border);
  opacity: 0.8;
}

.telemetry-region {
  color: var(--ink);
  opacity: 0.85;
}

.telemetry-ping {
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}

.telemetry-sparkline {
  width: 28px;
  height: 10px;
  color: var(--status-ok);
  opacity: 0.85;
  flex: none;
}
.telemetry-ping-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.telemetry-sparkline-lg {
  width: 44px;
  height: 14px;
  color: var(--status-ok);
  opacity: 0.9;
  flex: none;
}
.telemetry-sparkline polyline,
.telemetry-sparkline-lg polyline {
  stroke-dasharray: 60;
  stroke-dashoffset: 0;
  transition: filter .3s ease, stroke-dashoffset .6s var(--ease-out-quint);
}
.telemetry-capsule.is-pinging .telemetry-sparkline polyline,
.telemetry-drawer.is-pinging .telemetry-sparkline-lg polyline {
  animation: sparkline-glow 0.8s ease-out, sparkline-sweep 0.75s cubic-bezier(0.2, 0.8, 0.4, 1);
}
.telemetry-capsule.is-pinging .telemetry-ping,
.telemetry-drawer.is-pinging #telemetry-drawer-ping {
  color: #fff;
  text-shadow: 0 0 6px var(--status-ok);
  transition: color .2s ease, text-shadow .25s ease;
}
@keyframes sparkline-glow {
  0% { filter: drop-shadow(0 0 1px var(--status-ok)); }
  40% { filter: drop-shadow(0 0 5px var(--status-ok)); stroke-width: 1.8; color: #fff; }
  100% { filter: none; stroke-width: 1.2; }
}
@keyframes sparkline-sweep {
  0% { stroke-dashoffset: 60; }
  100% { stroke-dashoffset: 0; }
}

.telemetry-arrow {
  font-size: 8px;
  color: var(--muted);
  margin-left: 2px;
  transition: transform .25s var(--ease-out-quart);
}

.telemetry-capsule[aria-expanded="true"] .telemetry-arrow {
  transform: rotate(180deg);
}

.telemetry-backdrop {
  position: fixed;
  inset: 0;
  z-index: 52;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.telemetry-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
.telemetry-backdrop.is-closing {
  opacity: 0;
  pointer-events: none;
}
@starting-style {
  .telemetry-backdrop:not([hidden]) {
    opacity: 0;
  }
}

.telemetry-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 460px;
  z-index: 55;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 14px 18px max(18px, env(safe-area-inset-bottom, 18px));
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.45);
  transition: transform .28s var(--ease-drawer), opacity .22s ease;
  pointer-events: auto;
}

.telemetry-drawer:not([hidden]) {
  transform: translateX(-50%) translateY(0);
}
.telemetry-drawer.is-dragging { transition: none; }
.telemetry-drawer.is-closing {
  transform: translateX(-50%) translateY(100%);
}
@starting-style {
  .telemetry-drawer:not([hidden]) {
    transform: translateX(-50%) translateY(100%);
  }
}

.telemetry-drawer-inner {
  display: flex;
  flex-direction: column;
}

.telemetry-drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
  opacity: .45;
  margin: 0 auto 12px;
  touch-action: pan-y;
  transition: transform .14s var(--ease-out-quint), opacity .15s ease, background-color .15s ease;
}
.telemetry-drawer-handle:active {
  transform: scaleX(1.15) scaleY(1.2);
  opacity: .85;
  background-color: var(--accent);
}

@media (max-width: 760px) {
  .telemetry-drawer-handle, .telemetry-drawer-header { touch-action: none; }
}

.telemetry-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--mono);
}

.telemetry-drawer-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.telemetry-drawer-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font: 10px/1.2 var(--mono);
  padding: 4px 8px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.telemetry-drawer-close:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}
@media (hover: hover) and (pointer: fine) { .telemetry-drawer-close:hover {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
} }

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.telemetry-metric {
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
}

.telemetry-metric-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.telemetry-metric-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
}

.telemetry-metric-val.status-ok {
  color: var(--status-ok);
}

.telemetry-metric-val.accent {
  color: var(--accent);
}

.telemetry-dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-ok);
  flex-shrink: 0;
}

@media (min-width: 761px) {
  .telemetry-header-slot { display: block; flex: none; }
  .telemetry-header-slot .telemetry-capsule-wrap {
    position: static;
    transform: none;
  }
  .telemetry-header-slot .telemetry-capsule {
    min-height: 44px;
    background: var(--inset);
    border-color: var(--connector);
  }
  .telemetry-header-slot .telemetry-arrow { transform: rotate(180deg); }
  .telemetry-header-slot .telemetry-capsule[aria-expanded="true"] .telemetry-arrow { transform: none; }
  .telemetry-drawer {
    top: var(--telemetry-top, 86px);
    right: var(--telemetry-right, 24px);
    bottom: auto;
    left: auto;
    width: min(460px, calc(100vw - 48px));
    max-height: calc(100dvh - var(--telemetry-top, 86px) - 24px);
    overflow-y: auto;
    transform: none;
    border-bottom: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 12px 36px var(--shadow);
  }
  .telemetry-drawer:not([hidden]) {
    transform: none;
    animation: telemetry-drop .2s var(--ease-out-quart);
  }
  .telemetry-drawer.is-closing {
    transform: translateY(-8px);
    opacity: 0;
    transition: transform .2s var(--ease-out-quart), opacity .18s ease;
  }
  .telemetry-drawer-handle { display: none; }
  .telemetry-drawer-close { min-height: 44px; padding: 8px 12px; }
}

@keyframes telemetry-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 400px) {
  .telemetry-capsule {
    padding: 4px 10px;
    font-size: 10px;
    gap: 6px;
  }
  .telemetry-pill-text {
    gap: 4px;
  }
}

.terminal-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  background: rgba(223, 187, 118, 0.1);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font: 13px/1 var(--mono), "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(223, 187, 118, 0.22);
  transition: transform .18s var(--ease-out-quint), background-color .15s ease, box-shadow .2s ease, border-color .15s ease;
  white-space: nowrap;
  min-width: 112.4px;
  justify-content: center;
}
@media (hover: hover) and (pointer: fine) {
  .terminal-pill-btn:hover {
    background: rgba(223, 187, 118, 0.2);
    box-shadow: 0 0 20px rgba(223, 187, 118, 0.42), 0 4px 12px var(--shadow);
    transform: translateY(-1px) scale(1.02);
  }
}
.terminal-pill-btn:active {
  transform: scale(0.97);
}
.pill-sparkle-icon {
  width: 14px;
  height: 14px;
  fill: var(--accent);
  color: var(--accent);
  flex: none;
}
.pill-label {
  letter-spacing: -0.2px;
}
.pill-launch-icon {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  opacity: 0.85;
  flex: none;
  transition: transform .15s ease, opacity .15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .terminal-pill-btn:hover .pill-launch-icon {
    opacity: 1;
    transform: translate(1px, -1px);
  }
}
@media (max-width: 600px) {
  .terminal-pill-btn {
    height: 36px;
    min-width: 90px;
    padding: 0 8px;
    font-size: 11px;
    gap: 5px;
    box-shadow: none;
  }
}
@media (max-width: 360px) {
  .terminal-pill-btn {
    padding: 0 7px;
    gap: 4px;
  }
}
@keyframes terminal-periodic-press {
  0% {
    transform: translateY(0) scale(1);
    animation-timing-function: var(--ease-out);
  }
  4% {
    transform: translateY(1px) scale(0.97);
    animation-timing-function: var(--ease-out);
  }
  8%, 100% { transform: translateY(0) scale(1); }
}
@media (max-width: 600px) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  .terminal-pill-btn.is-mobile-reminder {
    animation: terminal-periodic-press 3s linear infinite;
  }
}
.blueprint-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: #06080c;
  z-index: 1010;
  opacity: 1;
  transition: opacity .2s var(--ease-out-quint);
}
.blueprint-lightbox-backdrop[hidden] {
  display: none;
}
.blueprint-lightbox-backdrop.is-closing {
  opacity: 0;
  pointer-events: none;
}
.blueprint-lightbox-modal {
  position: fixed;
  inset: min(24px, 3vh) min(20px, 3vw);
  background: #0d1117;
  border: 1px solid rgba(223, 187, 118, 0.45);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(223, 187, 118, 0.15);
  z-index: 1011;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: blueprint-modal-fade .18s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translate3d(0, 0, 0);
  will-change: opacity, transform;
  transition: transform .18s var(--ease-out-quint), opacity .18s ease;
}
.blueprint-lightbox-modal[hidden] {
  display: none;
}
.blueprint-lightbox-modal.is-closing {
  transform: scale(0.96);
  opacity: 0;
  pointer-events: none;
}
@keyframes blueprint-modal-fade {
  from { opacity: 0; transform: scale(0.985) translate3d(0, 0, 0); }
  to { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}
.blueprint-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(22, 27, 34, 0.96);
  border: 1px solid rgba(223, 187, 118, 0.45);
  color: var(--muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1025;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: transform .15s var(--ease-out-quint), background-color .15s ease, border-color .15s ease, color .15s ease;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) { .blueprint-lightbox-close:hover {
  color: #fff;
  background: rgba(33, 38, 45, 0.95);
  border-color: var(--accent);
  transform: scale(1.08);
} }
.blueprint-lightbox-close:active {
  transform: scale(0.92);
}
.blueprint-lightbox-viewport {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  padding: 16px;
  background: #090c10;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}
.blueprint-lightbox-canvas {
  margin: auto;
  width: min(100%, 1020px);
  display: flex;
  justify-content: center;
  align-items: center;
}
.blueprint-lightbox-svg {
  width: 100%;
  height: auto;
  min-width: 320px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tui-window {
  width: min(1020px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(223, 187, 118, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  contain: layout paint;
}
.tui-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--inset);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  user-select: none;
}
.tui-dots {
  display: flex;
  gap: 6px;
}
.tui-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.tui-path {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--mono);
}
.tui-tag {
  color: var(--accent);
  font-family: var(--mono);
}
.tui-rec-hud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
}
.tui-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  display: inline-block;
  animation: rec-blink 1s ease-in-out infinite;
  transform: translate3d(0, 0, 0);
  will-change: opacity;
  contain: layout paint;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.tui-timecode {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.tui-fps {
  color: var(--status-ok);
  font-size: 10px;
  font-weight: 600;
}
.tui-toggle-btn {
  background: rgba(223, 187, 118, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .tui-toggle-btn:hover {
  background: var(--accent);
  color: var(--button-ink);
} }
.tui-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tui-header-main {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tui-headline {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  font-family: var(--mono);
}
.tui-headline span {
  color: var(--key);
}
.tui-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.badge-tag {
  color: var(--key);
}
.tui-stepper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 6px 12px;
  background: var(--inset);
  border-radius: 6px;
  border: 1px dashed var(--border);
  color: var(--muted);
  margin-top: 4px;
}
.stepper-step {
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.stepper-step.active {
  color: var(--accent);
  background: rgba(223, 187, 118, 0.18);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(223, 187, 118, 0.35);
}
.tree-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  width: 100%;
}
.tree-box {
  width: 100%;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--inset);
  border: 1px solid var(--border);
  position: relative;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
@media (hover: hover) and (pointer: fine) { .tree-box:hover {
  border-color: var(--accent);
} }
.tree-box.active-pulse {
  border-color: var(--accent);
  background: rgba(45, 50, 60, 0.98);
  animation: none;
}
@keyframes node-surge {
  0% { transform: scale(1); }
  100% { transform: scale(1.012); }
}
.box-double {
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 15px rgba(223, 187, 118, 0.15);
}
.box-cyan {
  border: 1px solid rgba(139, 201, 237, 0.5);
  box-shadow: 0 0 14px rgba(139, 201, 237, 0.12);
}
.box-gold {
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 18px rgba(223, 187, 118, 0.2);
}
.box-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--mono);
}
.box-title-accent { color: var(--accent); }
.box-title-key { color: var(--key); }
.box-title-green { color: var(--status-ok); }
.box-meta {
  font-size: 10px;
  color: var(--muted);
  font-weight: normal;
}
.meter-row {
  display: grid;
  grid-template-columns: 90px 130px 48px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.7;
}
.meter-label {
  color: var(--ink);
  white-space: nowrap;
}
.meter-bar {
  color: var(--key);
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 0 4px;
}
.meter-val {
  color: var(--status-ok);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.meter-route {
  color: var(--accent);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.branch-label {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  text-align: center;
  padding: 2px 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  margin: 2px auto;
  display: inline-block;
  letter-spacing: 0.3px;
}
.branch-label span {
  color: var(--accent);
  font-weight: 600;
}
.conduit-arrow {
  height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.conduit-line {
  --photon-distance: 24px;
  width: 2px;
  height: var(--photon-distance, 24px);
  border-left: 2px dashed rgba(223, 187, 118, 0.45);
  position: relative;
  background: transparent;
  overflow: visible;
  box-shadow: none;
  contain: layout paint;
}
.conduit-head {
  display: none !important;
}

.spark, .conduit-pulse {
  position: absolute;
  top: 0;
  left: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  contain: layout paint;
  animation: photon-stream 1.1s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}
.spark.spark-1, .conduit-pulse {
  background: #ffffff;
  animation-delay: 0s;
}
.spark.spark-2 {
  background: var(--key);
  animation-delay: 0.28s;
  width: 4px;
  height: 4px;
  left: -2.5px;
}
.spark.spark-3 {
  background: #ffffff;
  animation-delay: 0.56s;
  width: 4.5px;
  height: 4.5px;
  left: -2.75px;
}
.spark.spark-4 {
  background: var(--key);
  animation-delay: 0.84s;
  width: 3.5px;
  height: 3.5px;
  left: -2.25px;
}

@keyframes photon-stream {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  15% {
    opacity: 1;
    transform: translate3d(0, calc(var(--photon-distance, 24px) * .15), 0);
  }
  85% {
    opacity: 1;
    transform: translate3d(0, calc(var(--photon-distance, 24px) * .85), 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, var(--photon-distance, 24px), 0);
  }
}

.conduit-track, .branch-fork-track, .conduit-line, .branch-fork-line {
  contain: layout paint;
}

.branch-fork-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 3px 0 2px;
}
.branch-fork-track {
  --photon-distance: 24px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  height: 24px;
}
.branch-bus-line {
  position: absolute;
  top: 0;
  left: calc((100% - 24px) / 6);
  right: calc((100% - 24px) / 6);
  height: 0;
  border-top: 2px dashed rgba(139, 201, 237, 0.45);
  pointer-events: none;
}
.branch-fork-container-bottom .branch-bus-line {
  top: auto;
  bottom: 0;
}
.branch-fork-col {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
}
.branch-fork-line {
  position: relative;
  width: 2px;
  height: 100%;
  border-left: 2px dashed rgba(139, 201, 237, 0.55);
  contain: layout paint;
}

.animations-paused .spark,
.animations-paused .conduit-pulse {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .spark, .conduit-pulse {
    animation: none !important;
    display: none !important;
  }
}
.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.branch-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.branch-card.active {
  border-color: var(--key);
  box-shadow: 0 0 12px rgba(139, 201, 237, 0.25);
}
@media (hover: hover) and (pointer: fine) { .branch-card:hover {
  border-color: var(--key);
  box-shadow: 0 0 12px rgba(139, 201, 237, 0.25);
} }
.branch-card-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--key);
  display: flex;
  justify-content: space-between;
}
.branch-sub {
  font-size: 9.5px;
  color: var(--muted);
}
.branch-status {
  font-size: 10px;
  color: var(--status-ok);
  font-weight: bold;
  margin-top: 4px;
}
.tui-meter-graphic {
  display: inline-flex;
  width: 130px;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
  margin: 0;
  contain: layout paint;
}
.tui-meter-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  display: flex;
  position: relative;
  will-change: transform;
  transition: transform 200ms var(--ease-out-quint);
}
.tui-meter-solid {
  height: 100%;
  flex-grow: 1;
}
.tui-meter-checker {
  height: 100%;
  width: 24px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  contain: strict;
  transform: translateZ(0);
}
.tui-meter-checker::before {
  content: "";
  position: absolute;
  inset: 0 -8px 0 0;
  background-image: repeating-linear-gradient(45deg, var(--bar-color, #34d399) 0 25%, transparent 0 50%);
  background-size: 4px 4px;
  will-change: transform;
  animation: checker-scroll 0.6s linear infinite;
}
@keyframes checker-scroll {
  from { transform: translateX(-8px); }
  to { transform: translateX(0); }
}

.tui-meter-green {
  --bar-color: #34d399;
}
.tui-meter-green .tui-meter-solid {
  background: #34d399;
}

.tui-meter-orange {
  --bar-color: #fb923c;
}
.tui-meter-orange .tui-meter-solid {
  background: #fb923c;
}

.tui-meter-cyan {
  --bar-color: #8bc9ed;
}
.tui-meter-cyan .tui-meter-solid {
  background: #8bc9ed;
}

.diagnostic-scan {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  vertical-align: middle;
  gap: 2px;
  line-height: 1;
}
.diagnostic-scan .bracket {
  color: var(--muted);
  font-size: 11px;
  opacity: 0.85;
}
.waveform-svg {
  width: 44px;
  height: 12px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  contain: strict;
  transform: translate3d(0, 0, 0);
}
.waveform-path {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation: wave-scan 1.1s linear infinite;
  filter: none;
}
@keyframes wave-scan {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-22px, 0, 0); }
}

.tui-footer-section {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-title {
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.log-box {
  background: #141619;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  min-height: 170px;
  max-height: 195px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  contain: layout paint;
}
.log-row {
  display: grid;
  grid-template-columns: 14px 60px 80px 1fr 60px 88px;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 3px 6px;
  border-radius: 3px;
  max-height: 24px;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition: opacity 200ms var(--ease-out-quint), transform 200ms var(--ease-out-quint);
  overflow: hidden;
  contain: layout paint style;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}
.log-row.is-new {
  animation: log-fade-in 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.log-row.is-exiting {
  opacity: 0 !important;
  transform: translateY(-8px) scale(0.98) !important;
  pointer-events: none !important;
}
@keyframes log-fade-in {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.log-pointer {
  width: 14px;
  font-weight: 700;
  color: transparent;
  user-select: none;
  text-align: center;
}
.log-row.is-active .log-pointer {
  color: var(--accent);
  animation: cursor-pulse 0.8s ease-in-out infinite;
}
@keyframes cursor-pulse {
  0%, 100% { opacity: 1; transform: translateX(0); }
  50% { opacity: 0.4; transform: translateX(2px); }
}
.log-time {
  color: rgba(255, 255, 255, 0.38);
  font-size: 9.5px;
  letter-spacing: 0.2px;
}
.log-actor {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-actor-accent { color: var(--accent); }
.log-actor-key { color: var(--key); }
.log-actor-green { color: var(--status-ok); }
.log-actor-purple { color: #c084fc; }
.log-msg {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-metric {
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  font-size: 9.5px;
}
.log-pill {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-weight: 600;
  text-align: right;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
}
.log-pill-ok {
  color: var(--status-ok);
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}
.log-pill-running {
  color: var(--accent);
  background: rgba(223, 187, 118, 0.1);
  border-color: rgba(223, 187, 118, 0.3);
}
.log-pill-blue {
  color: var(--key);
  background: rgba(139, 201, 237, 0.08);
  border-color: rgba(139, 201, 237, 0.25);
}
.log-spinner {
  display: inline-block;
  width: 1em;
  text-align: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  contain: strict;
  font-weight: 700;
}

.animations-paused .tui-meter-checker::before,
.animations-paused .waveform-path,
.animations-paused .log-pointer {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .tui-meter-checker::before,
  .waveform-path,
  .log-row.is-new,
  .log-pointer {
    animation: none !important;
  }
}

.tui-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--status-ok);
  background: rgba(39, 201, 63, 0.08);
  border: 1px solid rgba(39, 201, 63, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 32px;
}
.tui-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-ok);
  box-shadow: 0 0 6px var(--status-ok);
  animation: tui-status-glow 1.6s ease-in-out infinite;
  transform: translate3d(0, 0, 0);
  will-change: opacity;
  contain: layout paint;
}

@keyframes tui-status-glow {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.log-time, .log-metric, .meter-val, #tui-live-tokens, .tui-fps, .tui-timecode, #tui-gitops-build-time, #tui-gitops-savings, #tui-gitops-rollout {
  font-variant-numeric: tabular-nums;
  contain: layout style;
}

.tui-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--inset);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.tui-bottom-bar span {
  color: var(--status-ok);
  font-weight: 600;
}
.cursor-blink {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink 1s infinite;
  margin-left: 4px;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.tui-video-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #101216;
  border: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
}
.tui-video-player {
  width: 100%;
  max-height: 65vh;
  display: block;
}

@media (max-width: 600px) {
  .tui-titlebar {
    padding: 8px 42px 8px 12px;
    gap: 8px;
    position: relative;
    justify-content: space-between;
  }
  .tui-dots {
    gap: 5px;
    flex-shrink: 0;
  }
  .tui-dots span {
    width: 8px;
    height: 8px;
  }
  .tui-path {
    display: none;
  }
  .tui-status-badge {
    margin-right: 0;
    margin-left: auto;
    font-size: 9px;
    padding: 2px 7px;
    flex-shrink: 0;
  }
  .tui-content { padding: 12px 10px; gap: 10px; }
  .box-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .box-meta {
    font-size: 9.5px;
    opacity: 0.85;
  }
  .tui-stepper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px 8px;
    text-align: center;
    font-size: 9px;
  }
  .stepper-sep {
    display: none;
  }
  .branch-grid { grid-template-columns: 1fr; gap: 8px; }
  .branch-fork-track {
    --photon-distance: 20px;
    display: flex;
    justify-content: center;
    height: 20px;
  }
  .branch-bus-line {
    display: none;
  }
  .branch-fork-col:not(:first-child) {
    display: none;
  }
  .meter-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 6px;
  }
  .meter-label { width: auto; font-size: 9.5px; }
  .meter-bar { font-size: 9px; padding: 0 4px; }
  .tui-meter-graphic {
    width: 100%;
    height: 10px;
    margin: 0;
  }
  .meter-val {
    width: auto;
    font-size: 9.5px;
    text-align: right;
  }
  .meter-route { display: none; }
  .diagnostic-scan .waveform-svg {
    width: 32px;
    height: 10px;
  }
  .log-box {
    padding: 6px 8px;
    font-size: 8.5px;
    min-height: 155px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    contain: layout paint;
  }
  .log-row {
    grid-template-columns: 8px 44px 50px minmax(0, 1fr) 40px 64px;
    gap: 4px;
    padding: 2px 2px;
    font-size: 8.5px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .log-row > * {
    min-width: 0;
  }
  .log-pointer {
    width: 8px;
    font-size: 8px;
  }
  .log-actor {
    width: auto;
    max-width: 50px;
    font-size: 8.5px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .log-msg {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .log-metric {
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .log-pill {
    padding: 1px 3px;
    font-size: 7.5px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .log-row-telemetry {
    gap: 4px;
    font-size: 8.5px;
  }
  .meter-val { font-size: 9.5px; }
  .meter-route { display: none; }
  .tui-headline { font-size: 14px; line-height: 1.35; }
  .tui-bottom-bar {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 6px 10px calc(6px + var(--sab, env(safe-area-inset-bottom, 0px))) 10px !important;
    font-size: 8.5px !important;
    line-height: 1.2 !important;
    gap: 6px !important;
  }
  .tui-bottom-bar > div {
    width: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .blueprint-lightbox-modal {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    top: max(8px, var(--sat, env(safe-area-inset-top, 8px)));
    bottom: max(8px, var(--sab, env(safe-area-inset-bottom, 8px)));
    left: max(8px, env(safe-area-inset-left, 8px));
    right: max(8px, env(safe-area-inset-right, 8px));
    inset: max(8px, var(--sat, env(safe-area-inset-top, 8px))) max(8px, env(safe-area-inset-right, 8px)) max(8px, var(--sab, env(safe-area-inset-bottom, 8px))) max(8px, env(safe-area-inset-left, 8px));
    border-radius: 8px;
  }
  .blueprint-lightbox-viewport {
    padding: 8px 6px calc(16px + var(--sab, env(safe-area-inset-bottom, 0px))) 6px;
  }
  .blueprint-lightbox-close {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    font-size: 12px;
    z-index: 1040;
  }
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 1;
  transition: opacity .18s var(--ease-out-quint);
}
.confirm-backdrop[hidden] {
  display: none;
}
.confirm-backdrop.is-closing {
  opacity: 0;
  pointer-events: none;
}
.confirm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: min(420px, calc(100vw - 32px));
  background: #14171d;
  border: 1px solid rgba(223, 187, 118, 0.4);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(223, 187, 118, 0.16);
  z-index: 1001;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: confirm-pop .22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform .16s var(--ease-out-quint), opacity .16s ease;
}
.confirm-modal[hidden] {
  display: none;
}
.confirm-modal.is-closing {
  transform: translate(-50%, -46%) scale(0.95);
  opacity: 0;
  pointer-events: none;
}
@keyframes confirm-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.93); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.confirm-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(223, 187, 118, 0.15);
  border: 1px solid rgba(223, 187, 118, 0.3);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex: none;
}
.confirm-title-wrap {
  flex: 1;
  min-width: 0;
}
.confirm-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.confirm-domain {
  display: block;
  font: 11px var(--mono);
  color: var(--muted);
  margin-top: 2px;
}
.confirm-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s ease, background-color .15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) { .confirm-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
} }
.confirm-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: #c9d1d9;
}
.confirm-desc {
  margin: 0;
  word-break: break-word;
}
.confirm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.confirm-btn {
  flex: 1;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 100ms var(--ease-out-quint), background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.confirm-cancel {
  background: #1c2128;
  border: 1px solid var(--border);
  color: #c9d1d9;
}
@media (hover: hover) and (pointer: fine) { .confirm-cancel:hover {
  background: #262c36;
  border-color: var(--connector);
  color: #fff;
} }
.confirm-cancel:active {
  transform: scale(0.96);
}
.confirm-ok {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #12151a;
  box-shadow: 0 2px 10px rgba(223, 187, 118, 0.32);
}
@media (hover: hover) and (pointer: fine) { .confirm-ok:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(223, 187, 118, 0.45);
} }
.confirm-ok:active {
  transform: scale(0.96);
}

.terminal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 998;
  opacity: 1;
  transition: opacity .18s ease;
}
.terminal-backdrop[hidden] {
  display: none;
}
.terminal-backdrop.is-closing {
  opacity: 0;
  pointer-events: none;
}
.terminal-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100vw - 28px));
  height: min(540px, calc(100vh - 48px));
  background: #101216;
  border: 1px solid rgba(223, 187, 118, 0.35);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(223, 187, 118, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  font-family: var(--mono);
  animation: terminal-pop .24s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform .18s var(--ease-out-quint), opacity .18s ease;
}
.terminal-modal[hidden] {
  display: none;
}
.terminal-modal.is-closing {
  transform: translate(-50%, -47%) scale(0.96);
  opacity: 0;
  pointer-events: none;
}
@keyframes terminal-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #171a20;
  border-bottom: 1px solid rgba(223, 187, 118, 0.2);
  user-select: none;
}
.terminal-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
}
.terminal-dot.close { background: #ff5f56; }
.terminal-dot.min { background: #ffbd2e; cursor: default; }
.terminal-dot.max { background: #27c93f; cursor: default; }
.terminal-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.terminal-session {
  font-size: 12px;
  font-weight: 600;
  color: #e6edf3;
  white-space: nowrap;
}
.terminal-engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent);
  background: rgba(223, 187, 118, 0.12);
  border: 1px solid rgba(223, 187, 118, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.terminal-live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27c93f;
  box-shadow: 0 0 6px #27c93f;
  animation: live-glow 1.6s ease-in-out infinite;
  flex: none;
}
.terminal-live-dot::before,
.terminal-live-dot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid #27c93f;
  animation: sonar-ripple 3.6s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  pointer-events: none;
}
.terminal-live-dot::after {
  animation-delay: 1.8s;
}
.terminal-engine-badge.is-loading .terminal-live-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.terminal-engine-badge.is-loading .terminal-live-dot::before,
.terminal-engine-badge.is-loading .terminal-live-dot::after { border-color: var(--accent); }
.terminal-engine-wait {
  margin-top: 6px;
  color: var(--muted);
  font: 13px var(--mono);
}
.terminal-engine-badge.is-loading #terminal-status-text::after,
.terminal-engine-wait::after {
  content: "...";
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: engine-dots 1.2s steps(4) infinite;
}
@keyframes engine-dots { to { width: 1.2em; } }
@media (prefers-reduced-motion: reduce) {
  .terminal-engine-badge.is-loading #terminal-status-text::after,
  .terminal-engine-wait::after { width: auto; animation: none; }
}
@keyframes sonar-ripple {
  0% { transform: scale(1); opacity: 0.9; }
  60% { transform: scale(3.5); opacity: 0; }
  100% { transform: scale(3.5); opacity: 0; }
}
.terminal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s ease, background-color .15s ease;
}
@media (hover: hover) and (pointer: fine) { .terminal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
} }
.terminal-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #13161a;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.terminal-chips::-webkit-scrollbar { display: none; }
.terminal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 11px var(--mono);
  padding: 4px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #c9d1d9;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease, transform .12s var(--ease-out-quint), box-shadow .15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .terminal-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--inset);
    transform: translateY(-1.5px) scale(1.02);
    box-shadow: 0 4px 12px rgba(223, 187, 118, 0.18);
  }
}
.terminal-chip:active {
  transform: translateY(0) scale(0.94);
  box-shadow: none;
}
.terminal-chip.is-triggered {
  animation: chip-ripple 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes chip-ripple {
  0% { transform: scale(0.94); box-shadow: 0 0 0 2px var(--status-ok); border-color: var(--status-ok); }
  50% { transform: scale(1.03); box-shadow: 0 0 12px var(--status-ok); border-color: var(--status-ok); color: #fff; }
  100% { transform: scale(1); box-shadow: none; }
}
.chip-k8s {
  color: #326ce5;
  font-weight: bold;
}
.chip-argo {
  color: #f17849;
  font-weight: bold;
}
.chip-ai {
  color: var(--accent);
}
.terminal-chip.argo-chip {
  border-color: rgba(241, 120, 73, 0.4);
  background: rgba(241, 120, 73, 0.08);
}
@media (hover: hover) and (pointer: fine) { .terminal-chip.argo-chip:hover {
  background: rgba(241, 120, 73, 0.18);
  border-color: #f17849;
  color: #ff9d76;
} }
.terminal-chip.ai-chip {
  border-color: rgba(223, 187, 118, 0.4);
  background: rgba(223, 187, 118, 0.08);
}
@media (hover: hover) and (pointer: fine) { .terminal-chip.ai-chip:hover {
  background: rgba(223, 187, 118, 0.16);
  border-color: var(--accent);
} }
.terminal-screen {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0d0f12;
  font-size: 13px;
  line-height: 1.55;
  color: #e6edf3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.terminal-welcome {
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 8px;
}
.terminal-welcome-title {
  color: var(--accent);
  font-weight: 600;
}
.terminal-cmd-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: terminal-entry-appear .16s var(--ease-out-quint);
}
@keyframes terminal-entry-appear {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.terminal-cmd-input {
  display: flex;
  gap: 8px;
  align-items: center;
}
.terminal-cmd-prompt {
  color: #27c93f;
  font-weight: 600;
}
.terminal-cmd-text {
  color: #fff;
}
.terminal-cmd-result {
  margin-left: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-k8s-table {
  color: #58a6ff;
  white-space: pre;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.45;
  padding: 4px 0;
}
.terminal-ai-box {
  background: rgba(223, 187, 118, 0.06);
  border: 1px solid rgba(223, 187, 118, 0.28);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 4px 0;
}
.terminal-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.terminal-ai-text {
  color: #e6edf3;
  line-height: 1.6;
}
.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.terminal-prompt {
  color: #27c93f;
  font-weight: 600;
  flex: none;
  transition: text-shadow .2s ease, transform .15s ease;
}
.terminal-prompt.is-executing {
  text-shadow: 0 0 10px #27c93f;
  transform: scale(1.04);
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
  color: #fff;
  padding: 0;
  min-width: 0;
}
.terminal-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
}
.terminal-cli-cursor {
  color: var(--accent);
  animation: typewriter-blink 1s steps(2, start) infinite;
  user-select: none;
  flex: none;
}
@media (max-width: 600px) {
  .terminal-modal {
    width: calc(100vw - 16px);
    height: min(600px, calc(100dvh - 32px));
  }
  .terminal-engine-badge {
    display: none;
  }
  .terminal-screen {
    font-size: 12px;
  }
}

@media (pointer: coarse) {
  .terminal-input {
    font-size: 16px;
  }
}

.telemetry-drawer, .terminal-screen, .terminal-chips, .blueprint-lightbox-viewport, .log-box {
  overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-arrow .icon { transform: none !important; }
  .blueprint-lightbox-modal {
    animation: none;
    transition: opacity .18s ease;
  }
  .blueprint-lightbox-modal.is-closing { transform: translate3d(0, 0, 0); }
  .telemetry-dot::after { display: none !important; }
  .telemetry-capsule { transition: none !important; }
  .telemetry-drawer { transition: none !important; animation: none !important; }
  .confirm-modal, .confirm-backdrop { transition: none !important; animation: none !important; }
  .terminal-chip.is-triggered { animation: none !important; }
  .telemetry-sparkline polyline, .telemetry-sparkline-lg polyline { animation: none !important; }
  .bp-scanline,
  .bp-flow,
  .bp-status-live,
  .bp-argo-box,
  .blueprint-svg rect[stroke-dasharray="2 2"],
  .timeline-entry:first-child::after { animation: none !important; }
  :target { animation: none !important; }
}

.animations-paused .code-window::after,
.animations-paused .bp-scanline,
.animations-paused .bp-flow,
.animations-paused .timeline-entry:first-child::after,
.animations-paused .log-row.is-new,
.animations-paused .cursor-blink,
.animations-paused .tree-box.active-pulse,
.animations-paused .tui-status-dot,
.animations-paused .terminal-live-dot,
.animations-paused .terminal-live-dot::before,
.animations-paused .terminal-live-dot::after {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .code-window::after, .tree-box.active-pulse, .tui-status-dot,
  .terminal-live-dot, .terminal-live-dot::before, .terminal-live-dot::after { animation: none !important; }
  .tui-meter-fill, .log-row { transition: opacity 150ms ease; }
  .log-row.is-exiting { transform: none !important; }
}

:root.lightbox-open .board,
:root.lightbox-open .topbar,
:root.lightbox-open .dock,
:root.lightbox-open .telemetry-capsule-wrap,
:root.lightbox-open .connections,
:root.lightbox-open #connector-canvas {
  visibility: hidden !important;
}

:root.lightbox-open .topbar,
:root.lightbox-open .telemetry-capsule,
:root.lightbox-open .blueprint-zoom-btn {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

:root.lightbox-open .board *,
:root.lightbox-open .board .bp-scanline,
:root.lightbox-open .board .bp-flow,
:root.lightbox-open .board .bp-status-live,
:root.lightbox-open .board .bp-argo-box,
:root.lightbox-open .board .live-pulse-dot,
:root.lightbox-open .timeline-entry:first-child::after,
:root.lightbox-open .telemetry-capsule-wrap * {
  animation-play-state: paused !important;
}


.fold-toggle { display: none; }
.board .fold-toggle { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: auto; margin-right: 8px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .board .fold-toggle:hover { color: var(--accent); border-color: var(--border); } }
.board .fold-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fold-toggle svg { width: 16px; height: 16px; transition: transform 120ms var(--ease-out); }
.fold-toggle[aria-expanded='false'] svg { transform: rotate(-90deg); }
.board .is-folded { overflow: hidden; border-radius: 9px; }
.board .is-swap-target { box-shadow: 0 0 0 2px var(--accent), 0 0 28px rgba(223, 187, 118, .35); }

.project-tagline { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--ink); }
.project-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.project-tags li { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--inset); font: 13px var(--mono); color: var(--ink); }
.project-tags svg { width: 18px; height: 18px; flex: none; }
.tag-react svg { color: #61dafb; }
.tag-cognito svg { color: #b57bff; }
.tag-gateway svg { color: #ff5c8a; }
.tag-bedrock svg { color: #3ddbb0; }
.tag-opensearch svg { color: #a98bff; }

.board .portfolio.is-folded { display: block; }
.board .portfolio.is-folded:not(.is-folding) > .portfolio-card + .portfolio-card { display: none; }
/* The wrapper stays unclipped so the card's own glow and border render like the other folded boxes; the card clips itself.
   While the wipe plays the card keeps its full height, and the wrapper's clip-path does the reveal. */
.board .portfolio.is-folded { overflow: visible; }
.board .portfolio.is-folded > .portfolio-card { height: 100%; }
.board .portfolio.is-folded.is-folding > .portfolio-card { height: auto; }

@media (min-width: 761px) {
  .image-slot[data-blueprint="portfolio-01"], .portfolio-card[open] .image-slot[data-blueprint="portfolio-01"] { height: auto; aspect-ratio: 540 / 205; }
}

.file-label .icon { transition: color 160ms ease, filter 160ms ease; }
@media (hover: hover) and (pointer: fine) {
  .panel:hover .file-label .icon, .portfolio-card:hover .file-label .icon { color: var(--accent); filter: drop-shadow(0 0 5px rgba(223, 187, 118, .75)); }
}
.panel:has(:focus-visible) .file-label .icon, .portfolio-card:has(:focus-visible) .file-label .icon { color: var(--accent); filter: drop-shadow(0 0 5px rgba(223, 187, 118, .75)); }

@media (min-width: 761px) {
  .timeline-entry::after { background: var(--muted); opacity: .55; transition: transform .25s var(--ease-out-quint), box-shadow .25s ease, background-color .2s ease, opacity .2s ease; }
  .timeline-entry:first-child::after { animation: none; }
  .timeline-entry.is-active-node:not(:hover)::after { transform: none; box-shadow: 0 0 0 3px var(--inset); }
  .timeline-entry.is-active-node:not(:hover) .timeline-text h3 { color: var(--ink); }
  @media (hover: hover) and (pointer: fine) { .timeline-entry:hover::after { background: var(--accent); opacity: 1; } }
}

.achievement-list { padding-left: 18px; }
.achievement-list li { margin: 0 0 8px; padding-left: 2px; }
.achievement-list li::marker { color: var(--connector); }
.achievement-list li:last-child { margin-bottom: 0; }
.achievement-list + .metric { margin-top: 14px; }


#connector-paths > g { transition: opacity 180ms var(--ease-out); }
.board.is-opening #connector-paths > g { transition-duration: 420ms; }
.board.is-opening #connector-paths > g:not(.is-drawn) { opacity: 0; }
.motion-ready .board.is-opening .reveal:not(.is-visible) { opacity: 1; transform: none; transition: none; }

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .motion-ready .board:not(.staggered):not(.is-reflowing) #connector-paths > g { transition: opacity 300ms var(--ease-out) 120ms; }
  .motion-ready .board:not(.staggered) #connector-paths > g:not(.is-revealed) { opacity: 0; transition-delay: 0s; }
  .motion-ready .board.is-opening:not(.staggered) #connector-paths > g.is-drawn { opacity: 1; transition: none; }
}

.credential-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.credential-tags li { padding: 3px 8px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font: 12px/1.4 var(--mono); }

.company-logo { display: inline-block; width: 30px; height: 30px; margin-left: 10px; vertical-align: -9px; }
.company-logo-crypto { background: url('logos/crypto-com.png') center / contain no-repeat; }
.company-logo-doubletree { background: var(--ink); -webkit-mask: url('logos/doubletree.png') center / contain no-repeat; mask: url('logos/doubletree.png') center / contain no-repeat; }

.board .is-folded.is-folding { overflow: visible; }
.board.is-reflowing #connector-paths > g { opacity: 0; transition-duration: 100ms; }
.portfolio { transition: box-shadow 140ms var(--ease-out); }

.panel.is-focused .file-label .icon { color: var(--accent); filter: drop-shadow(0 0 5px rgba(223, 187, 118, .75)); }

@media (max-width: 760px) {
  html:not([data-opening]) :is(#profile, #portfolio-01, #experience, #certificates, #resume) {
    opacity: 0;
    animation: reveal-without-script 0s 4s forwards;
  }
}
@media (max-width: 760px) {
  html:not([data-opening]) :is(#terminal-toggle, .topbar .controls) {
    opacity: 0.1;
    animation: reveal-without-script 0s 4s forwards;
  }
}
@keyframes reveal-without-script { to { opacity: 1; } }

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .motion-ready .reveal { transform: none; transition: none; }
}

@media (max-width: 760px) {
  .board .fold-toggle { width: 36px; height: 36px; margin-right: 4px; }
}

.credential-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.credential-head h3 { margin: 0; }
.credential-head .verified { padding: 3px 8px; font-size: 12px; }
.cert-view { display: inline-flex; align-items: center; flex: none; gap: 6px; padding: 7px 14px; background: rgba(16, 20, 26, 0.88); border: 1px solid rgba(223, 187, 118, 0.45); border-radius: 6px; color: var(--accent); font: 600 13px var(--mono); user-select: none; -webkit-user-select: none; transition: background-color .15s ease, border-color .15s ease, transform 120ms var(--ease-out-quint); }
.cert-view .icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .certificate:hover .cert-view { border-color: var(--accent); background: rgba(223, 187, 118, 0.12); } }
.certificate:active .cert-view { transform: scale(0.96); }
@media (max-width: 1050px) { .credential-frame .cert-view { align-self: flex-start; } }
.credential-head { gap: 6px 8px; flex-wrap: nowrap; }
.credential-head .verified { white-space: nowrap; padding: 2px 7px; }
.credential-frame { gap: 10px; }
.cert-view { padding: 6px 12px; }

@media (prefers-reduced-motion: reduce) {
  .fold-toggle svg, .cert-view, .portfolio { transition: none; }
  #connector-paths > g { transition: opacity 120ms linear; }
}

@media (max-width: 760px) {
  .cert-view { min-height: 40px; }
}

.board .fold-toggle { transition: transform 120ms var(--ease-out), color .15s ease, border-color .15s ease; touch-action: manipulation; }
.board .fold-toggle:active { transform: scale(0.92); }
@media (prefers-reduced-motion: reduce) { .board .fold-toggle { transition: color .15s ease, border-color .15s ease; } }

.board:not(.staggered) :is(#profile > .filebar, #experience > .filebar, #portfolio-01 .filebar, #certificates .filebar) { cursor: pointer; user-select: none; -webkit-user-select: none; }
.board:not(.staggered) :is(#profile > .filebar, #experience > .filebar, #portfolio-01 .filebar, #certificates .filebar):active { background: var(--inset); }

/* A custom property is used because the blueprint animations live in a <use> shadow tree, where only inherited values reach. */
.is-offscreen { --anim-play: paused; }
.live-pulse-dot, .code-window::after, .timeline-entry:first-child::after, .cursor-blink, .tree-box.active-pulse {
  animation-play-state: var(--anim-play, running);
}
:root.bp-offscreen:not(.lightbox-open) .bp-scanline,
:root.bp-offscreen:not(.lightbox-open) .bp-flow { animation-play-state: paused; }

@media (max-width: 760px) {
  .board .panel.is-focused:not(.is-folded) > .filebar > .window-dots i,
  .board .panel.is-focused:not(.is-folded) > summary > .filebar > .window-dots i { opacity: 1; transform: scale(1.28); }
  .board .panel.is-focused:not(.is-folded) > .filebar > .window-dots i:nth-child(1),
  .board .panel.is-focused:not(.is-folded) > summary > .filebar > .window-dots i:nth-child(1) { background-color: #ff5f56; box-shadow: 0 0 6px rgba(255, 95, 86, 0.55); }
  .board .panel.is-focused:not(.is-folded) > .filebar > .window-dots i:nth-child(2),
  .board .panel.is-focused:not(.is-folded) > summary > .filebar > .window-dots i:nth-child(2) { background-color: #ffbd2e; box-shadow: 0 0 6px rgba(255, 189, 46, 0.55); }
  .board .panel.is-focused:not(.is-folded) > .filebar > .window-dots i:nth-child(3),
  .board .panel.is-focused:not(.is-folded) > summary > .filebar > .window-dots i:nth-child(3) { background-color: #27c93f; box-shadow: 0 0 6px rgba(39, 201, 63, 0.55); }
}

@media (max-width: 760px) {
  html[data-opening="running"] .topbar { overflow-x: clip; }
}
