/* ==========================================================================
   Portfolio styles.
   Direction: Microsoft Command Line look. White page, black ink, blue links,
   lime highlight, Inter Tight for text and Cascadia Code for labels.
   Light and dark themes are both first-class.
   ========================================================================== */

@font-face { font-family: "Inter Tight"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/inter-tight-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/inter-tight-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/inter-tight-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cascadia Code"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/cascadia-code-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cascadia Code"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/cascadia-code-latin-600-normal.woff2") format("woff2"); }

:root,
:root[data-theme="light"] {
  /* Palette and type taken from Microsoft Command Line: white page, black ink,
     blue links, lime highlight. */
  --bg: #ffffff;
  --surface: #f2f2f2;
  --ink: #000000;
  --muted: #555555;
  --line: #cccccc;
  --field-line: #767676;
  --accent: #1a5fc4;
  --on-accent: #ffffff;
  --focus: #1a5fc4;
  --lime: #e3f671;
  --font-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111111;
  --surface: #1a1a1a;
  --ink: #ffffff;
  --muted: #999999;
  --line: #2e2e2e;
  --field-line: #7a7a7a;
  --accent: #e3f671;
  --on-accent: #111111;
  --focus: #e3f671;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.wrap {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Focus: always visible, never removed ───────────────────────────── */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  min-height: 3.5rem;
  padding-block: 0.25rem;
}

.brand {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  order: 3;
  width: 100%;
  gap: 0 0.25rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.6rem;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.theme-toggle {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--field-line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (min-width: 52rem) {
  html {
    scroll-padding-top: 5rem;
  }

  .site-nav {
    order: 0;
    width: auto;
    margin-right: auto;
  }

  .brand {
    margin-right: 0;
  }
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.link-button {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  min-height: 2.75rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.link-button:hover {
  text-decoration-thickness: 2px;
}

/* ── Intro ──────────────────────────────────────────────────────────── */
.intro {
  display: grid;
  gap: 2rem;
  padding-block: 3rem 3.5rem;
}

.intro h1 {
  font-size: clamp(2.25rem, 7vw, 4rem);
  margin-bottom: 0.75rem;
}

.intro-role {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.lede {
  font-size: 1.15rem;
  line-height: 1.6;
}

.intro-status {
  font-weight: 500;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  max-width: none;
}

.portrait {
  margin: 0;
  max-width: 17rem;
}

.portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

@media (min-width: 52rem) {
  .intro {
    grid-template-columns: minmax(0, 1fr) 17rem;
    align-items: start;
    gap: 4rem;
    padding-block: 5rem 5rem;
  }
}

/* ── Sections ───────────────────────────────────────────────────────── */
.section {
  padding-block: 3.5rem;
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  margin-bottom: 1rem;
}

.section-note {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Projects ───────────────────────────────────────────────────────── */
.project-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.project-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  margin-right: 0.5rem;
}

.project h3 {
  font-size: 1.5rem;
  margin-bottom: 0.9rem;
}

.project-stack {
  font-size: 0.95rem;
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
  margin: 0.25rem 0 0;
  max-width: none;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.project-featured {
  margin-bottom: 1rem;
}

.project-featured h3 {
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
}

.project-body {
  max-width: 48rem;
}

.project-text p:last-child {
  margin-bottom: 0.5rem;
}

/* Every project is a card; the open one is highlighted. */
.project {
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
}

.project.is-open {
  background: var(--surface);
  border-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .project {
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
}

@media (min-width: 52rem) {
  .project {
    padding: 2rem 2.25rem;
  }

}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-list .project {
  margin-bottom: 1rem;
}

/* ── Tools ──────────────────────────────────────────────────────────── */
.defects {
  margin: 0;
  max-width: 54rem;
}

.defects>div {
  display: grid;
  gap: 0.15rem 2rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}

.defects dt {
  font-weight: 600;
}

.defects dd {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 40rem) {

  .defects>div {
    grid-template-columns: 12rem minmax(0, 1fr);
  }
}

/* ── Experience ─────────────────────────────────────────────────────── */
.experience h3 {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.defects {
  margin-bottom: 1.5rem;
}

/* ── Certifications ─────────────────────────────────────────────────── */
.rank {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.rank img {
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
}

.rank p {
  margin: 0;
}

.certs {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 54rem;
}

.certs li {
  display: grid;
  gap: 0.1rem 1.5rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}

.cert-name {
  font-weight: 600;
}

.cert-meta {
  color: var(--muted);
}

.certs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

@media (min-width: 40rem) {
  .certs li {
    grid-template-columns: minmax(0, 1fr) 14rem 11rem;
    align-items: center;
  }
}

/* ── Education ──────────────────────────────────────────────────────── */
.education {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 54rem;
}

.education li {
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}

.education h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.education p {
  margin-bottom: 0.4rem;
}

/* ── Contact ────────────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  gap: 2.5rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  display: grid;
  padding-block: 0.6rem;
  border-top: 1px solid var(--line);
}

.contact-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  overflow-wrap: anywhere;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--field-line);
  border-radius: 6px;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--accent);
  border-width: 2px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  max-width: none;
}

.form-status {
  min-height: 1.5rem;
}

@media (min-width: 52rem) {
  .contact-grid {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2.5rem 3rem;
    align-items: start;
  }
  .contact-grid #contact-form { grid-column: 1 / -1; }
}

@media (min-width: 64rem) {
  .contact-grid {
    grid-template-columns: 15rem minmax(0, 1fr) minmax(0, 1.2fr);
  }
  .contact-grid #contact-form { grid-column: auto; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

/* ── Diagram dialog ─────────────────────────────────────────────────── */
.diagram-dialog {
  width: min(72rem, 96vw);
  height: min(48rem, 90vh);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}

.diagram-dialog[open] {
  display: flex;
  flex-direction: column;
}

.diagram-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.diagram-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
}

.diagram-bar h2 {
  font-size: 1.1rem;
  margin: 0;
}

.diagram-dialog iframe {
  flex: 1;
  width: 100%;
  border: 0;
}

/* ── Error page ─────────────────────────────────────────────────────── */
.not-found {
  padding-block: 6rem;
}

.not-found h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  margin-bottom: 1rem;
}

/* ── Motion: hover and focus only. Nothing loops. ───────────────────── */
@media (prefers-reduced-motion: no-preference) {

  .button,
  .theme-toggle,
  a {
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ── Mono labels (Cascadia Code, as on the Microsoft Command Line site) ── */
.site-nav a,
.button,
.link-button,
.project-meta,
.project-stack,
.cert-meta,
.contact-label,
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.project-stack {
  font-size: 0.85rem;
}

.site-nav a,
.button {
  font-size: 0.8rem;
}

/* Black tag chips, uppercase mono, as on the reference's "Deep Dive" labels. */
.project-num {
  background: var(--ink);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Lime highlight button in light theme (black on #e3f671 is 16:1). */
:root:not([data-theme="dark"]) .button-primary {
  background: var(--lime);
  color: #000;
  border-color: #000;
}

.brand {
  font-family: var(--font-sans);
  font-weight: 500;
}

.section h2 {
  letter-spacing: -0.05em;
}

/* ── Dark theme extras ─────────────────────────────────────────────── */

/* ── Internship certificate ─────────────────────────────────────────── */
.cert-figure {
  margin: 1.5rem 0 0;
  max-width: 44rem;
}

.cert-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.cert-figure figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ── Scroll cue (mouse outline with a bobbing dot, from the Framer ScrollIcon) ── */
.scroll-cue {
  grid-column: 1 / -1;
  justify-self: center;
  display: flex;
  justify-content: center;
  width: 30px;
  height: 50px;
  padding-top: 12px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--bg);
}

.scroll-cue span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue span {
    animation: scroll-cue 2s ease-in-out infinite;
  }
}

@keyframes scroll-cue {
  0%, 75%, 100% { transform: translateY(0); }
  37% { transform: translateY(7.5px); }
}

/* ── Floating pill navigation (from the Framer FloatingPillNavigation) ──── */
.site-nav {
  position: relative;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px;
  gap: 0;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  position: relative;
  z-index: 1;
  flex: none;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.site-nav a:hover {
  text-decoration: none;
  color: var(--ink);
}

.site-nav a[aria-current="true"],
.site-nav a[aria-current="true"]:hover {
  color: var(--bg);
}

:root[data-theme="dark"] .site-nav a[aria-current="true"],
:root[data-theme="dark"] .site-nav a[aria-current="true"]:hover {
  color: var(--on-accent);
}

.nav-pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--ink);
  pointer-events: none;
}

:root[data-theme="dark"] .nav-pill {
  background: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .nav-pill.is-ready {
    transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.05), width 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.05);
  }
}

@media (max-width: 51.99rem) {
  .site-nav {
    max-width: 100%;
  }
}

/* ── Glass buttons (CSS take on the Framer LiquidGlassButtons: blur, rim light,
   soft depth, and a highlight that follows the pointer; no refraction map) ── */
.button,
.theme-toggle {
  --mx: 50%;
  --my: 0%;
  --glass: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  background-color: color-mix(in srgb, var(--ink) 4%, transparent);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.16);
}

.button::before,
.theme-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(120px circle at var(--mx) var(--my), rgba(255, 255, 255, calc(0.5 * var(--glass))), transparent 70%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03) 42%, rgba(255, 255, 255, 0.18));
}

.button:hover,
.theme-toggle:hover {
  --glass: 1;
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  color: var(--ink);
}

.button:active,
.theme-toggle:active {
  transform: scale(0.98);
}

.button-primary,
.button-primary:hover {
  background-color: var(--accent);
  color: var(--on-accent);
}

:root:not([data-theme="dark"]) .button-primary,
:root:not([data-theme="dark"]) .button-primary:hover {
  background-color: var(--lime);
  color: #000;
  border-color: rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .theme-toggle {
    transition: transform 0.15s ease, border-color 0.2s ease;
  }
}

/* ── Projects accordion (from the Framer Flexible Accordion idea) ─────── */
.project-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 2.75rem;
}

.project-toggle::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--field-line);
  border-radius: 50%;
  color: var(--ink);
}

.project.is-open .project-toggle::after {
  content: "\2212";
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.project h3 {
  margin-bottom: 0;
}

.project-panel {
  display: grid;
  grid-template-rows: 0fr;
}

.project.is-open .project-panel {
  grid-template-rows: 1fr;
}

.project-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 0;
}

.project.is-open .project-panel-inner {
  padding-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .project-panel {
    transition: grid-template-rows 0.4s cubic-bezier(0.2, 0.9, 0.25, 1);
  }
}

/* ── Project hook, limits label, sub-heading ─────────────────────────── */
.project-hook {
  margin: 0.4rem 2.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.limits::before {
  content: "Limits";
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.intro-tools {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1rem 0 0;
}

.field-error {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Business card (contact section) and contact card page ───────────── */
.bizcard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: min(100%, 24rem);
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 0.5rem solid var(--lime);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.bizcard:hover {
  border-color: var(--accent);
  border-left-color: var(--lime);
}

.bizcard-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.bizcard-text:hover .bizcard-cta { text-decoration: underline; }

.bizcard-name {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.bizcard-role,
.bizcard-place,
.bizcard-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.bizcard-cta {
  margin-top: 0.6rem;
  color: var(--ink);
}

/* Bloom QR: a bouquet that turns into the code (js/bloom.js). The plate stays white in both themes: a QR code needs a light quiet zone. */
.bloom-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

.bloom {
  display: block;
  width: min(100%, 14rem);
  padding: 0.5rem;
  border: 0;
  border-radius: 6px;
  background: #fff;
  line-height: 0;
  cursor: pointer;
}

.bloom-canvas { display: none; width: 100%; aspect-ratio: 1; }
.bloom-fallback { display: block; width: 100%; height: auto; }
.bloom.has-bloom .bloom-canvas { display: block; }
.bloom.has-bloom .bloom-fallback { display: none; }

.bloom-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}


.card-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.card-wrap {
  width: min(100% - 2rem, 28rem);
  padding-block: 2rem;
}

.card {
  border: 1px solid var(--line);
  border-top: 0.6rem solid var(--lime);
  border-radius: 12px;
  background: var(--surface);
  padding: 1.75rem 1.5rem 1.5rem;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-head img {
  flex: none;
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.card-role,
.card-place {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0;
  color: var(--muted);
}

.card-role {
  color: var(--ink);
  font-weight: 600;
}

.card-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.card-list li {
  display: grid;
  padding-block: 0.55rem;
  border-top: 1px solid var(--line);
}

.card-list span {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  max-width: none;
}

.card-back {
  text-align: center;
  margin: 1.25rem 0 0;
  max-width: none;
}

/* ==========================================================================
   Extras: sound toggle, hero globe, terminal, interactive diagrams, scroll
   story and certificate ring.
   ========================================================================== */

:root { --bad: #c62f2f; --good: #1f7a43; }
:root[data-theme="dark"] { --bad: #ff7b72; --good: #7ee787; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Glass fallback for browsers without the SVG lens (Safari, Firefox): plain blur. */
.button,
.theme-toggle {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@media (max-width: 30rem) {
  .theme-toggle { padding: 0 0.6rem; font-size: 0.75rem; }
  .header-inner { gap: 0 0.5rem; }
}

/* ── Globe: sits in the Contact heading, beside "I'm in Hyderabad" ───── */
.contact-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.contact-head .section-note { margin-bottom: 1.5rem; }
.globe-fig { margin: 0 0 1rem; flex: none; text-align: center; }
.contact-globe { display: block; width: 8rem; height: 8rem; margin-inline: auto; }
.globe-fig figcaption { margin-top: 0.25rem; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--muted); }

@media (max-width: 40rem) {
  .contact-globe { width: 5.5rem; height: 5.5rem; }
  .globe-fig figcaption { display: none; }
}

/* ── Terminal ───────────────────────────────────────────────────────── */
.term {
  --t-bg: #141517;
  --t-fg: #e8e8e8;
  --t-dim: #9aa0a6;
  --t-ok: #7ee787;
  --t-warn: #f2cc60;
  --t-err: #ff7b72;
  --t-hi: #e3f671;
  background: var(--t-bg);
  color: var(--t-fg);
  border: 1px solid #3a3b3e;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  max-width: 56rem;
}

.term:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(#2d2e31, #222326);
  border-bottom: 1px solid #101011;
}

.dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.term-title { margin-inline: auto; padding-right: 3.5rem; font-size: 0.75rem; color: #b4b4b4; }

.term-screen {
  height: min(26rem, 60vh);
  overflow: auto;
  padding: 0.9rem 1rem 0.4rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-screen .line { min-height: 1.55em; }
.t-dim { color: var(--t-dim); }
.t-ok { color: var(--t-ok); }
.t-warn { color: var(--t-warn); }
.t-err { color: var(--t-err); }
.t-hi { color: var(--t-hi); }
.t-prompt { color: var(--t-hi); }
.term-screen a { color: #79b8ff; }

.term-form { display: flex; align-items: center; gap: 0.6rem; padding: 0.2rem 1rem 0.9rem; }
.term-prompt { color: var(--t-hi); white-space: nowrap; }

.term-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  caret-color: var(--t-hi);
  outline: none;
}

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0;
  max-width: none;
}

@media (max-width: 40rem) {
  .term-form input { font-size: 1rem; }
  .term-prompt { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; }
}

/* ── Interactive diagrams ───────────────────────────────────────────── */
.diagram-dialog { width: min(80rem, 96vw); height: min(50rem, 92vh); }

.diagram-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
}

.diagram-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.diagram-stage { flex: 1; overflow: auto; padding: 0.75rem; }
.diagram-svg { display: block; width: 100%; min-width: 44rem; height: auto; }

.diagram-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

.diagram-panel { border-left: 1px solid var(--line); padding: 1rem; overflow: auto; font-size: 0.95rem; }
.diagram-panel h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.diagram-panel p { margin-bottom: 0.75rem; }

.diagram-cap {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface);
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  min-height: 3.6rem;
  margin: 0 0 1rem;
}

.diagram-links a { display: block; min-height: 2.75rem; line-height: 2.75rem; }
.diagram-legend { font-size: 0.8rem; color: var(--muted); }
.limits-note { color: var(--muted); }

@media (max-width: 52rem) {
  .diagram-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); }
  .diagram-panel { border-left: 0; border-top: 1px solid var(--line); }
}

.diagram-svg text { font-family: var(--font-mono); }
.node { cursor: pointer; outline: none; }
.node rect { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.node.kind-aws rect { stroke: var(--accent); }
.node.kind-cloud rect { stroke: var(--accent); } /* Azure services, the same blue as AWS ones */
.node.kind-ext rect { stroke: var(--field-line); }
.node.kind-bad rect { stroke: var(--bad); }
.node.kind-ghost { opacity: 0; pointer-events: none; }
.node.is-sel rect { fill: var(--surface); stroke-width: 3; }
.node:focus-visible rect { stroke: var(--focus); stroke-width: 4; }
.node-label { font-size: 13px; font-weight: 600; fill: var(--ink); }
.node-sub { font-size: 11px; fill: var(--muted); }
.node.is-dead rect { stroke: var(--bad); fill: color-mix(in srgb, var(--bad) 14%, var(--bg)); }
.node.is-gone { opacity: 0.25; }
.node.is-pulse rect { stroke-width: 3; }

.edge line { stroke: var(--field-line); stroke-width: 1.5; }
.edge.is-on line { stroke: var(--accent); stroke-width: 2.5; }
.edge.is-failing line { stroke: var(--bad); stroke-dasharray: 5 4; }
.edge.is-gone { opacity: 0.15; }
.edge.is-planned line { stroke-dasharray: 3 5; }
.edge.is-hidden { opacity: 0; }

.edge-label {
  font-size: 11px;
  fill: var(--muted);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
}

.arrow { fill: var(--field-line); }
.arrow-on { fill: var(--accent); }
.packet { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.group-box { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 6 5; }
.group-label { font-size: 11px; fill: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .node rect, .edge line, .node, .edge { transition: stroke 0.3s ease, fill 0.3s ease, opacity 0.5s ease; }
  .node.is-new { animation: pop 0.6s cubic-bezier(0.2, 0.9, 0.25, 1); }
}

@keyframes pop { from { opacity: 0; } to { opacity: 1; } }

/* ── Scroll story (Infosys deployment) ──────────────────────────────── */
.story { position: relative; height: calc(var(--steps) * 70vh + 40vh); margin-top: 1.5rem; }

.story-stage {
  position: sticky;
  top: 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2rem;
  align-items: center;
  min-height: min(26rem, calc(100vh - 8rem));
}

.story-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }

.story-steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  column-gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 8px;
  opacity: 0.55;
}

.story-steps li.is-on { opacity: 1; background: var(--surface); border-color: var(--line); }

.story-n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
}

.story-term { font-weight: 600; }
.story-text { grid-column: 2; display: none; color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }
.story-steps li.is-on .story-text { display: block; }

.story-fig { border: 1px solid var(--line); border-radius: 10px; padding: 1rem; background: var(--surface); }
.story-svg { width: 100%; height: auto; display: block; }
.s-box rect { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.s-t { font: 600 13px var(--font-mono); fill: var(--ink); }
.s-s { font: 11px var(--font-mono); fill: var(--muted); }
.s-line { stroke: var(--field-line); stroke-width: 2; fill: none; }
.s-line.bad { stroke: var(--bad); stroke-dasharray: 6 5; }
.s-line.ok { stroke: var(--good); }
.s-note { font: 12px var(--font-mono); }
.s-note.bad { fill: var(--bad); }
.s-note.ok { fill: var(--good); }
.s-x { font: 700 18px var(--font-mono); fill: var(--bad); }
.story-state { font-family: var(--font-mono); font-size: 0.85rem; margin: 0.6rem 0 0; }
.story-state.bad { color: var(--bad); }
.story-state.ok { color: var(--good); }

@media (max-width: 52rem) {
  .story-stage { grid-template-columns: 1fr; top: 6.5rem; gap: 1rem; }
  .story-steps li { padding: 0.4rem 0.6rem; }
  .story-text { font-size: 0.85rem; }
}

/* ── Certificate ring ───────────────────────────────────────────────── */
.ring-view {
  perspective: 1100px;
  height: 13rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.ring-spin {
  position: relative;
  width: 15rem;
  height: 9.5rem;
  transform-style: preserve-3d;
  transform: rotateY(var(--rot, 0deg));
}

.ring-card {
  position: absolute;
  inset: 0;
  transform: rotateY(var(--a)) translateZ(var(--r, 13rem));
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  backface-visibility: hidden;
}

/* A scrim instead of opacity: dimmed text would fail contrast checks even though the card is aria-hidden. */
.ring-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  pointer-events: none;
}

.ring-card.is-front { border-color: var(--accent); }
.ring-card.is-front::after { opacity: 0; }
.ring-n, .ring-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin: 0; }
.ring-name { font-size: 1.1rem; line-height: 1.2; }
.ring-link { margin-top: auto; font-size: 0.9rem; }

.ring-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.ring-count { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); text-align: center; min-width: 0; }

@media (prefers-reduced-motion: no-preference) {
  .ring-spin { transition: transform 0.8s cubic-bezier(0.2, 0.9, 0.25, 1); }
  .ring-card::after { transition: opacity 0.4s ease; }
}


/* The header carries the sound toggle too, so it gets a little more room on wide screens. */
.header-inner { width: min(100% - 2rem, 80rem); }
.site-nav a { padding: 0 0.65rem; }

/* Experience: the certificate sits in the empty space to the right of the intro text. */
.experience-top { display: grid; gap: 1.5rem 3rem; }
.experience-top .cert-figure { margin: 0.4rem 0 0; max-width: none; }

@media (min-width: 52rem) {
  .experience-top { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); align-items: start; }
}

/* ── Mobile polish: tap targets, terminal, diagrams and the scroll story ── */
.term-form input { min-height: 2.75rem; }
.cert-figure figcaption a,
.ring-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
.scroll-cue { position: relative; }
.scroll-cue::after { content: ""; position: absolute; inset: -0.5rem -0.9rem; } /* bigger tap area, same look */
.diagram-hint { display: none; }

@media (max-width: 40rem) {
  .term-host { display: none; }
  .term-chips { gap: 0.5rem; }

  .term-chip {
    height: auto;
    min-height: 2.75rem;
    padding: 0.4rem 0.9rem;
    border-radius: 1.4rem;
    justify-content: flex-start;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.35;
  }

  /* Five steps should not mean four screens of scrolling on a phone. */
  .story { height: calc(var(--steps) * 45vh + 20vh); }

  /* Diagrams get the whole screen, and scroll sideways rather than shrinking to nothing. */
  .diagram-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .diagram-body { grid-template-rows: minmax(0, 1.5fr) minmax(0, 1fr); }
  .diagram-svg { min-width: 58rem; }
  .diagram-actions { padding: 0.5rem 0.75rem; }
  .diagram-hint { display: block; position: sticky; left: 0; margin: 0.5rem 0 0; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
}

/* ==========================================================================
   Section bars, the page rail and the section names (after PdfCraft's page).
   ========================================================================== */

:root { --bar-h: 2.6rem; }
body { overflow-x: clip; } /* the full-width bars use 100vw */
html { scroll-padding-top: calc(var(--header-h, 3.5rem) + var(--bar-h)); }
section[id] { scroll-margin-top: calc(-1 * var(--bar-h)); } /* a jump puts the bar, not the heading, under the header */

/* ── Sticky section bar: each section pins its own under the header ──── */
.section { --sec-pt: 3.5rem; }
.intro { --sec-pt: 3rem; }

.sec-bar {
  position: sticky;
  top: var(--header-h, 3.5rem);
  z-index: 10;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
  width: 100vw;
  height: var(--bar-h);
  margin: calc(-1 * var(--sec-pt)) 0 var(--sec-pt) calc(50% - 50vw);
  padding: 0.5rem 1rem; /* fallback, then the version that lines text up with the page column */
  padding: 0.5rem max(1rem, calc((100vw - 68rem) / 2));
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sec-bar b { font-weight: 400; color: var(--muted); }
.sec-bar > span:first-child { color: var(--ink); }
.sec-bar > span:first-child b { color: var(--muted); }
.intro .sec-bar { margin-bottom: calc(var(--sec-pt) - 2rem); }

@media (min-width: 52rem) { .intro { --sec-pt: 5rem; } }

@media (max-width: 40rem) {
  :root { --bar-h: 2.25rem; }
  .sec-bar { font-size: 0.6875rem; letter-spacing: 0.1em; }
  .sec-bar-r { display: none; }
}

/* ── Phones: the photo sits beside the name instead of hanging below ──── */
@media (max-width: 51.99rem) {
  .intro { grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; row-gap: 0; align-items: start; }
  .intro-text { display: contents; }
  .intro h1 { grid-column: 1; grid-row: 2; align-self: end; margin-bottom: 0.5rem; font-size: clamp(1.75rem, 8.2vw, 2.4rem); }
  .intro-role { grid-column: 1; grid-row: 3; align-self: start; margin-bottom: 1.25rem; }
  .portrait { grid-column: 2; grid-row: 2 / span 2; align-self: center; width: clamp(4.5rem, 22vw, 6rem); margin: 0; }
  .intro-text > :not(h1):not(.intro-role) { grid-column: 1 / -1; }
  .scroll-cue { grid-column: 1 / -1; margin-top: 1.5rem; }
}

/* ── The rail: a ruler for the page, on wide screens ──────────────────── */
html.rail-on { scrollbar-width: none; }
html.rail-on::-webkit-scrollbar { display: none; }

.rail {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 15;
  width: 60px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.rail:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

.rail-bg {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-mask-image: linear-gradient(to left, #000 40%, transparent 100%);
  mask-image: linear-gradient(to left, #000 40%, transparent 100%);
}

.rail-tape { position: absolute; inset: 0 0 auto 0; will-change: transform; }
.rail-tick { position: absolute; inset-inline: 0; height: 0; }

.rail-tick i {
  position: absolute;
  right: 0;
  top: 0;
  width: 10px;
  height: 1px;
  background: var(--ink);
  opacity: 0.4;
  transform-origin: right center;
}

.rail-tick.is-major i { width: 20px; opacity: 0.8; }

.rail-tick span {
  position: absolute;
  right: 24px;
  top: 0;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.rail-thumb {
  position: absolute;
  inset-inline: 0;
  top: 0;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-left: 2px solid var(--ink);
  opacity: 0;
}

.rail-marker { position: absolute; inset-inline: 0; top: 0; height: 0; will-change: transform; }

.rail-marker::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: var(--accent);
}

.rail-readout {
  position: absolute;
  right: 2px;
  top: 4px;
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.rail-digits { display: inline-flex; height: 1em; overflow: hidden; }
.rail-col { display: flex; flex-direction: column; }
.rail-col span { display: block; height: 1em; }

.rail-guide {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  margin-top: -1.5px;
  background: var(--ink);
  opacity: 0;
}

.rail.is-hover .rail-thumb,
.rail.is-hover .rail-guide { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .rail-col { transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.25, 1); }
  .rail-thumb, .rail-guide { transition: opacity 0.2s ease; }
}

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2"); }

/* ── Section names riding the rail ────────────────────────────────────── */
.rail-labels { position: fixed; inset: 0; z-index: 16; pointer-events: none; }
.rail-label { position: absolute; left: 0; top: 0; }

.rail-letter {
  position: absolute;
  left: 0;
  top: 0;
  font-family: "Archivo", var(--font-sans); /* the same face and width PdfCraft uses for its section names */
  font-size: 34px;
  font-weight: 620;
  font-stretch: 118%;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: pre;
  text-shadow: 0 0 4px var(--bg), 0 0 10px var(--bg);
  will-change: transform;
}

.rail-link { position: absolute; display: block; pointer-events: auto; cursor: pointer; }

/* Keep the bar's right-hand text clear of the stack of names on wide screens. */
@media (min-width: 64rem) {
  .sec-bar { padding-right: max(max(1rem, calc((100vw - 68rem) / 2)), 15rem); }
}

.rail-marker.is-low .rail-readout { top: -14px; }
