/* Terminal */
.terminal-section { border-top: 1px solid var(--line); }
.terminal-inner { display: grid; grid-template-columns: minmax(0, .68fr) minmax(0, 1.32fr); grid-template-areas: "intro terminal" "network terminal"; grid-template-rows: auto 1fr; align-items: start; gap: 16px clamp(22px, 5vw, 68px); padding-block: 34px 48px; }
.terminal-intro { grid-area: intro; }
.terminal-intro h2 { font-size: clamp(35px, 4.1vw, 56px); }
.terminal-intro > p:last-child { max-width: 280px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.terminal-window { grid-area: terminal; min-width: 0; overflow: hidden; color-scheme: dark; background: #161f2e; border: 1px solid #42516a; border-radius: 10px; color: #e3e9f3; font: 500 13px/1.6 var(--mono); }
.terminal-window :focus-visible { outline-color: #ff9a7e; outline-offset: -2px; }
.terminal-bar { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-bottom: 1px solid #344258; background: #202b3e; color: #e4eaf4; font-size: 11px; }
.terminal-lights { display: inline-flex; gap: 5px; }
.terminal-lights i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #ff8968; }
.terminal-lights i:nth-child(2) { background: #eec17a; }
.terminal-lights i:nth-child(3) { background: #8fc6ad; }
.terminal-path { margin-left: auto; color: #aab8ca; }
.terminal-output { position: relative; height: clamp(230px, 28vw, 294px); padding: 11px 14px; overflow: auto; scrollbar-color: #62728a #161f2e; overflow-wrap: anywhere; }
.terminal-output p { white-space: pre-wrap; tab-size: 4; }
.terminal-output strong, .terminal-output a { color: #a5dfc5; }
.terminal-output a { text-decoration: underline; text-underline-offset: 3px; }
.terminal-echo { color: #ffa88e; margin-top: 5px; }
.terminal-note { color: #aab8ca; }
.terminal-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 0 14px; padding: 0 0 4px; border-bottom: 1px solid #415068; }
.terminal-form label { color: #ff9a7e; font-weight: 700; }
.terminal-form input { min-width: 0; width: 100%; border: 0; border-radius: 4px; padding: 5px 4px; background: transparent; color: #fff; font: inherit; }
.terminal-form input::placeholder { color: #aab8ca; }
.terminal-form button, .terminal-shortcuts button { border: 1px solid #506078; border-radius: 5px; background: #253248; color: #e9eef7; font: inherit; font-size: 11px; cursor: pointer; }
.terminal-form button { padding: 3px 8px; }
.terminal-shortcuts { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 14px 12px; }
.terminal-shortcuts button { min-height: 27px; padding: 1px 8px; }
.terminal-form button:hover, .terminal-shortcuts button:hover { border-color: #ff9a7e; color: #ffd0c3; }
.terminal-window button:disabled, .terminal-form input:disabled { cursor: default; opacity: .65; }

.network-panel { grid-area: network; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.network-card-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.network-card-heading h3 { font-size: 14px; letter-spacing: -.01em; }
.network-card-heading button { min-height: 32px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.network-card-heading button:hover:not(:disabled) { border-color: var(--accent-text); color: var(--accent-text); }
.network-card-heading button:disabled { cursor: default; opacity: .65; }
.network-note { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.connection-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 10px 0 0; }
.connection-details dt { color: var(--muted); font-size: 11px; }
.connection-details dd { margin: 0; font: 600 12px/1.45 var(--mono); overflow-wrap: anywhere; }

/* Credentials and skills */
.certifications-inner { padding-block: 25px 29px; }
.certifications-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.certifications-heading .section-kicker { margin-bottom: 3px; }
.certifications-heading h2 { font-size: clamp(24px, 2.7vw, 36px); letter-spacing: -.045em; }
.certification-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.certification-list li { display: grid; align-content: start; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.certificate-issuer, .certificate-note { color: var(--muted); font: 700 10px/1.4 var(--mono); letter-spacing: .06em; }
.certificate-title { font-size: 14px; font-weight: 750; line-height: 1.3; }

.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skill-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fbfbf8; }
.skill-card h3 { margin-bottom: 12px; font-size: 20px; line-height: 1.2; letter-spacing: -.035em; }
.skill-card ul { margin: 0; padding: 0; list-style: none; }
.skill-card li { color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; font: 600 11px/1.35 var(--mono); }
.dark .skill-card { background: #1d2633; }

@media (max-width: 780px) {
  .certification-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .skill-grid { grid-template-columns: 1fr; }
  .terminal-inner { gap: 15px; padding-block: 27px 43px; }
  .terminal-form input { font-size: 16px; }
  .terminal-shortcuts button { min-height: 32px; }
}
@media (max-width: 360px) {
  .terminal-bar, .terminal-output { padding-inline: 10px; }
  .terminal-form { margin-inline: 10px; }
  .terminal-shortcuts { padding-inline: 10px; }
}

/* Featured AWS lab */
.project-featured { grid-column: 1 / -1; }
.project-featured .project-button { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.project-featured .project-art { height: 100%; min-height: 220px; aspect-ratio: auto; }
.art-scaling { background: #1a2538; color: #a9bdd9; }
.art-scaling > svg { width: min(95%, 520px); }
.project-featured .project-body { padding: clamp(16px, 3vw, 33px); justify-content: center; }
.project-featured .project-title { font-size: clamp(27px, 4vw, 45px); }
.project-featured .project-desc { max-width: 440px; font-size: 15px; }
.project-featured .tag-row { margin-top: 0; }
.status-scaling { background: #f4e2da; color: #883b28; }

.scaling-dialog { width: min(715px, calc(100% - 24px)); }
.scale-controls { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 13px 0 9px; border: 0; }
.scale-controls legend { margin-bottom: 5px; color: var(--muted); font: 700 11px/1.4 var(--mono); }
.scale-controls label { position: relative; }
.scale-controls input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.scale-controls label span { display: block; border: 1px solid var(--line); border-radius: 5px; padding: 7px 10px; color: var(--ink); font: 700 11px/1.4 var(--mono); cursor: pointer; }
.scale-controls input:checked + span { border-color: var(--accent-text); color: var(--accent-text); }
.scale-controls input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.scale-status, .scale-result { font: 700 11px/1.45 var(--mono); }
.scale-diagram { padding: 12px; margin: 11px 0 12px; border: 1px solid #384658; border-radius: 8px; background: #161f2e; color: #e5ecf5; }
.scale-diagram-header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; color: #a9b8ca; font: 700 9px/1.4 var(--mono); letter-spacing: .08em; }
.scale-diagram-header span:last-child { color: #a6d8bf; }
.scale-network { position: relative; isolation: isolate; }
.scale-wiring { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; overflow: visible; pointer-events: none; }
.scale-wiring path { fill: none; stroke: #718297; stroke-width: 1.5; stroke-linejoin: round; }
.scale-wiring .scale-active-route { stroke: #ffab89; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.scale-hops, .scale-nodes { display: grid; gap: clamp(6px, 2vw, 20px); padding: 0; margin: 0; list-style: none; }
.scale-hops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scale-nodes { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 36px; }
.scale-hops li, .scale-nodes li { min-width: 0; border: 1px solid #465970; border-radius: 6px; background: #202d3e; text-align: center; font: 700 10px/1.35 var(--mono); }
.scale-hops li { padding: 6px 3px 15px; }
.scale-nodes li { display: grid; gap: 3px; padding: 7px 2px; }
.scale-nodes li span { color: #adc2d6; font-size: 9px; }
.scale-hops .is-traced, .scale-nodes .is-active { border-color: #ffab89; color: #ffcfba; background: #352c31; }
.scale-packet { position: absolute; top: 0; left: 0; width: 10px; height: 10px; border: 1px solid #ffe6d9; border-radius: 50%; background: #ffab89; box-shadow: 0 0 10px 3px #fc6842a0; pointer-events: none; }
.scale-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.scale-actions .button { min-height: 36px; padding: 6px 10px; gap: 7px; font-size: 12px; cursor: pointer; }
.scale-actions button { border: 0; }

@media (max-width: 630px) {
  .project-featured .project-button { grid-template-columns: 1fr; }
  .project-featured .project-art { min-height: 0; aspect-ratio: 2.05; }
  .art-scaling > svg { width: 94%; }
}

.scale-infra { margin-top: 12px; color: var(--muted); font-size: 13px; }
.scale-infra summary { width: fit-content; color: var(--ink); font-weight: 700; cursor: pointer; }
.scale-infra p { margin-top: 5px; }

.art-https { background: #1c363e; color: #c2e4db; }
.art-edge { background: #29233c; color: #dac9ee; }
.traffic-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 13px 0; }
.traffic-form label { display: grid; gap: 4px; color: var(--muted); font: 700 11px/1.35 var(--mono); }
.traffic-form select { max-width: 100%; min-height: 36px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); font: 600 12px/1.4 var(--mono); }
.traffic-form .button { min-height: 36px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.traffic-form .button-dark { border: 0; }
.traffic-form input { accent-color: var(--accent-text); }
.traffic-output { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font: 500 12px/1.5 var(--mono); }
.traffic-status { color: var(--ink); }
.traffic-blocked .traffic-status { color: var(--accent-text); }

.traffic-dialog h2 { text-wrap: balance; }
.traffic-form .button-outline { background: transparent; }
.traffic-form button:disabled { opacity: .62; cursor: wait; }
.traffic-diagram { --flow-accent: #90e2d4; --flow-panel: #20393f; }
.edge-diagram { --flow-accent: #d4b9fc; --flow-panel: #352e47; }
.traffic-diagram .scale-diagram-header span:last-child { color: var(--flow-accent); }
.traffic-hops { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.traffic-hops li { position: relative; display: grid; align-content: start; gap: 3px; margin-inline: clamp(2px, .7vw, 5px); padding: 8px 2px 20px; font-size: clamp(9px, 1.5vw, 11px); overflow-wrap: anywhere; }
.traffic-hops li span { color: #adbed2; font-size: 9px; line-height: 1.3; }
.traffic-hops li::after { content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border: 1px solid #8c9bb1; border-radius: 50%; background: #202d3e; }
.traffic-hops li[data-state="pass"] { border-color: var(--flow-accent); background: var(--flow-panel); }
.traffic-hops li[data-state="pass"] span { color: var(--flow-accent); }
.traffic-hops li[data-state="pass"]::after { border-color: var(--flow-accent); background: var(--flow-accent); }
.traffic-hops li[data-state="fail"] { border-color: #ff9b8e; background: #462b32; }
.traffic-hops li[data-state="fail"] span { color: #ffc0b5; }
.traffic-hops li[data-state="fail"]::after { border-color: #ff9b8e; background: #ff9b8e; }
.traffic-hops li[data-state="skip"] { border-color: #394659; background: #182433; }
.traffic-track { position: absolute; z-index: -1; left: 12.5%; right: 12.5%; bottom: 9px; height: 2px; background: #72849a; }
.traffic-track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--trace-progress, 0%); background: var(--flow-accent); }
.traffic-network .scale-packet { top: auto; bottom: 5px; transform: translateX(-50%); border-color: #fff; background: var(--flow-accent); box-shadow: 0 0 12px 2px var(--flow-accent); }

.hero-portrait { position: relative; min-width: 0; margin: 0; border: 1px solid #4b586a; border-radius: 13px; background: #18232f; overflow: hidden; touch-action: pan-y pinch-zoom; }
.hero-portrait > svg { display: block; width: 100%; height: auto; }
.portrait-scroll-hint { position: absolute; left: 5%; right: 5%; bottom: 4%; border-top: 1px solid #8a9ab453; padding-top: 8px; color: #ffd0c3; font: 700 10px/1.4 var(--mono); letter-spacing: .10em; text-transform: uppercase; pointer-events: none; }
.portrait-touch-hint { display: none; }
@media (hover: none) {
  .portrait-mouse-hint { display: none; }
  .portrait-touch-hint { display: inline; }
}
.portrait-blink { opacity: 0; animation: portrait-blink 4.8s steps(1, end) infinite; }
@keyframes portrait-blink { 0%, 50%, 53%, 100% { opacity: 0; } 51%, 52% { opacity: 1; } }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-block: 41px 30px; }
  .terminal-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "terminal" "network"; grid-template-rows: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-blink { animation: none; }
}

/* Healthy targets fade in and out as the traffic preset changes. */
.scale-nodes li.is-joining { animation: scale-target-in 270ms ease-out both; }
.scale-nodes li.is-draining { animation: scale-target-out 200ms ease-in both; }
@keyframes scale-target-in {
  from { opacity: .1; }
  to { opacity: 1; }
}
@keyframes scale-target-out {
  to { opacity: 0; }
}

/* The first paint uses the portfolio's dark palette and an orange signal. */
.site-loader { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 42%, #223046, #151d2a 67%); color: #edf1f6; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 220ms ease, visibility 0s 220ms; }
.show-site-loader .site-loader { opacity: 1; visibility: visible; transition: none; }
.loader-card { display: grid; justify-items: center; text-align: center; }
.loader-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 17px; border: 1px solid #ffac8d; border-radius: 11px; background: #fc6842; color: #171f2d; font: 800 18px/1 var(--mono); }
.loader-label { color: #c0ccda; font: 700 10px/1.4 var(--mono); letter-spacing: .2em; }
.loader-name { margin-top: 5px; font-size: clamp(27px, 6vw, 43px); font-weight: 700; letter-spacing: -.035em; }
.loader-name span { color: #fc6842; }
.loader-signal { width: min(256px, 67vw); margin-top: 16px; color: #ffab89; }
.loader-signal path { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loader-track { stroke: #516176; }
.loader-trace { stroke: currentColor; stroke-dasharray: 1; stroke-dashoffset: 1; }
.loader-signal circle { fill: #1d2838; stroke: currentColor; stroke-width: 1.5; }
.loader-trace { animation: loader-signal 650ms cubic-bezier(.2, .65, .25, 1) forwards; }
@keyframes loader-signal {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-loader { display: none; }
}

.play-link { border-color: var(--accent-text); color: var(--accent-text); }
.play-link:hover { background: var(--button-hover); border-color: var(--button-hover); color: var(--button-ink); }
