/*
 * Gerryon portfolio — one authoritative homepage layout.
 * The dashboard fits the viewport with all four projects visible.
 * Detailed evidence is read in scrollable dialogs, never clipped cards.
 */
:root {
  color-scheme: light;
  --canvas: #f4efe5;
  --paper: #fdfaf3;
  --surface: #fffdf8;
  --surface-soft: #f5f0e4;
  --ink: #302d23;
  --muted: #675f50;
  --line: #dfd5c3;
  --accent: #586631;
  --accent-ink: #ffffff;
  --accent-soft: #ececd8;
  --focus: #a45e18;
  --shadow: 0 12px 36px #302d2310;
  --radius: 18px;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #201d18;
  --paper: #29251e;
  --surface: #353026;
  --surface-soft: #40392c;
  --ink: #f7f0e0;
  --muted: #cec2aa;
  --line: #544a38;
  --accent: #d0d89d;
  --accent-ink: #2c3320;
  --accent-soft: #42482d;
  --focus: #f5c77b;
  --shadow: 0 12px 36px #00000020;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
a { color: var(--accent); text-underline-offset: 3px; }
button, a, summary { outline-offset: 4px; }
:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
img, svg { display: block; max-width: 100%; }
button svg, a svg { width: 19px; height: 19px; flex: 0 0 auto; }
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px 14px;
  font-weight: 650;
  line-height: 1.3;
}
button:hover:not(:disabled) { border-color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  border-radius: 8px;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--ink);
}
.skip-link:focus { top: 12px; }

/* Desktop shell. Every flexible grid/flex child can shrink without overflow. */
.portfolio-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  --profile-lift: clamp(0px, calc(8dvh - 52px), 12px);
  padding: calc(21px - var(--profile-lift)) 20px 21px;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
/* Shift space from above the portrait to the two section breaks below it. */
.sidebar > :is(.identity, .sidebar-bottom) { margin-block: auto; }
.sidebar > .identity { padding-block-end: calc(var(--profile-lift) / 2); }
.sidebar > .sidebar-experience { margin-block-end: calc(var(--profile-lift) / 2); }
.wordmark { display: flex; align-items: center; gap: 1px; min-height: 32px; color: var(--ink); font-family: var(--font-display); font-size: 22px; font-weight: 750; line-height: 1.25; letter-spacing: -1px; text-decoration: none; }
.wordmark > span { color: var(--accent); }
.wordmark small { margin-left: auto; color: var(--muted); font-family: var(--font-body); font-size: 9px; font-weight: 650; letter-spacing: .16em; }
.identity { text-align: center; }
.avatar {
  width: 176px;
  height: 176px;
  margin: 0 auto 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface-soft);
}
.identity-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.6px;
}
.identity-role { margin-top: 8px; font-size: 13px; font-weight: 600; }
.identity-location { margin-top: 6px; color: var(--muted); font-size: 12px; }
.side-nav { display: grid; gap: 3px; }
.side-nav :is(button, a) {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
}
.side-nav a > span { flex: 0 0 auto; margin-inline-start: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.side-nav :is(button, a):hover { background: var(--surface-soft); }
.side-nav button[aria-selected="true"],
.side-nav button[aria-current="page"],
.side-nav button.is-active {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-bottom { display: grid; gap: 10px; }
.sidebar-experience { min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.sidebar-experience > h2 { margin: 0 0 8px; color: var(--accent); font-family: var(--font-body); font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.sidebar-experience-roles { display: grid; gap: 8px; }
.sidebar-experience-roles strong, .sidebar-experience-roles span { display: block; }
.sidebar-experience-roles strong { font-size: 12px; line-height: 1.35; font-weight: 650; }
.sidebar-experience-roles span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.sidebar-experience-link { display: none; }
.sidebar-bottom > a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}
.sidebar-bottom > a:hover { border-color: var(--accent); }
.social-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 36px;
  min-height: 36px;
  padding: 7px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.social-links a:hover { background: var(--accent-soft); color: var(--accent); }
.sidebar-bottom small { color: var(--muted); text-align: center; font-size: 11px; }
.sidebar-signature { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sidebar-signature .wordmark { min-height: 0; font-size: 18px; line-height: 1.25; }
.sidebar-signature small { white-space: nowrap; }
.main-area {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) 66px;
  gap: 15px;
  min-width: 0;
  min-height: 0;
  padding: 19px 28px 22px;
  overflow: hidden;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.desktop-topline { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .11em; }
.desktop-topline > span { padding: 0 8px; color: var(--line); }
.intro-link { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 5px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.intro-link:hover { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-actions button, .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.mobile-identity, .mobile-nav { display: none; }
.workspace, .view-panel { min-width: 0; min-height: 0; }
.view-panel { height: 100%; }
.view-panel[data-view-panel="work"] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}
.hero { min-width: 0; text-align: center; }
.hero-copy { min-width: 0; max-width: 920px; margin: 0 auto; }
.about-experience > h3 { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.experience-item { min-width: 0; }
.experience-item + .experience-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.experience-item :is(h3, h4) { margin: 0; font-family: var(--font-body); font-size: 13px; font-weight: 700; line-height: 1.35; }
.experience-dates { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.experience-focus { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 870px;
  margin: 8px auto 0;
  font-size: clamp(30px, 3.35vw, 49px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero h1 span { color: var(--accent); }
.hero-description { max-width: 720px; margin: 11px auto 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.section-heading { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.section-heading h2 { font-size: 17px; font-weight: 650; line-height: 1.25; letter-spacing: -.3px; }
.section-heading small { color: var(--muted); font-size: 12px; }
.project-count { color: var(--muted); font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; min-height: 0; }
.project-card {
  display: grid;
  grid-template-columns: clamp(96px, 13vw, 176px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.project-image {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  overflow: hidden;
}
.project-image img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.project-copy { grid-column: 2; grid-row: 1; min-width: 0; align-self: center; }
.project-kicker { color: var(--accent); font-size: 10.5px; font-weight: 700; line-height: 1.3; letter-spacing: .055em; text-transform: uppercase; }
.project-copy h3 { margin-top: 4px; font-size: 19px; font-weight: 650; line-height: 1.15; letter-spacing: -.55px; }
.project-scope { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.project-actions { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 8px; min-width: 0; align-self: end; }
.action-label-short, .scope-short { display: none; }
.project-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.project-actions .project-link { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.project-actions a:hover { border-color: var(--accent); }
.project-actions a svg { width: 15px; height: 15px; }
.work-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.work-footer small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.work-footer > :is(button, a) { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.work-footer > a:hover { border-color: var(--accent); }

/* Other dashboard views use the same fixed workspace. */
.view-panel[data-view-panel="services"] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 17px;
}
.view-intro h2 { font-size: clamp(26px, 2.6vw, 39px); line-height: 1.12; letter-spacing: -.8px; }
.view-intro > p:not(.eyebrow) { max-width: 720px; margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.view-intro .eyebrow + h2 { margin-top: 6px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; min-height: 0; }
.service-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
  min-width: 0;
  min-height: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.service-card > svg, .service-icon { width: 30px; height: 30px; color: var(--accent); }
.service-number { color: var(--accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-card h3 { font-size: 21px; font-weight: 650; line-height: 1.2; letter-spacing: -.4px; }
.service-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.service-card > a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--accent); font-size: 12px; font-weight: 650; text-decoration: none; }
.service-card > a:hover { text-decoration: underline; }
.service-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.service-actions, .about-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.service-actions > a, .about-links > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 650; }
.view-panel[data-view-panel="about"] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 24px; }
.about-layout { display: grid; grid-template-columns: 1.05fr 1fr; align-content: center; gap: 28px; min-width: 0; min-height: 0; }
.about-summary { min-width: 0; }
.about-summary > p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.about-summary > p + p { margin-top: 14px; }
.about-summary strong { color: var(--ink); }
.about-experience { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.about-experience .experience-item :is(h3, h4) { font-size: 15px; }
.about-experience .experience-dates { font-size: 12px; }
.about-experience .experience-focus { font-size: 13px; }
.about-facts { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 9px; margin: 0; }
.fact { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fact strong { display: block; margin-top: 4px; font-size: 19px; line-height: 1.2; }
.fact span, .fact small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.fact > span:first-child { margin-top: 0; font-size: 10px; font-weight: 650; letter-spacing: .055em; }
.about-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: center; gap: 12px; min-width: 0; }
.about-actions button, .about-actions > a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 66px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
}
.about-actions > a:hover { border-color: var(--accent); }
.about-actions .about-links { grid-column: 1 / -1; }
.contact-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.availability-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.availability-copy { display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0; font-size: 13px; line-height: 1.35; }
.availability-copy strong, .availability-copy b { display: block; font-weight: 650; }
.availability-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.contact-primary, .contact-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 16px;
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.contact-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.contact-secondary { background: var(--surface); color: var(--ink); }
.contact-secondary:hover { border-color: var(--accent); }

/* Evidence and longer copy scroll only after a deliberate dialog action. */
dialog {
  position: fixed;
  inset: 0;
  width: min(800px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 100px #201d1860;
}
dialog::backdrop { background: #201d18bf; backdrop-filter: blur(3px); }
.detail-dialog[open] { display: flex; flex-direction: column; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 0 0 auto; padding: 15px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-header h2 { min-width: 0; font-size: 20px; font-weight: 650; line-height: 1.25; letter-spacing: -.4px; }
.dialog-close { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px; flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }
.dialog-body { min-width: 0; min-height: 0; padding: 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.dialog-body p, .dialog-body li { font-size: 15px; line-height: 1.65; }
.dialog-body p + p, .dialog-body ul, .dialog-body ol { margin-top: 14px; }
.dialog-body h3 { margin: 22px 0 8px; font-size: 20px; line-height: 1.3; }
.dialog-body h3:first-child { margin-top: 0; }
.dialog-body img { width: 100%; max-height: 65vh; max-height: 65dvh; object-fit: contain; }
.dialog-body figure { margin: 0; }
.dialog-body figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.dialog-body :is(.detail-grid, .gallery, .photo-grid, .certificate-grid, .setup-facts) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dialog-body dl { margin: 16px 0; }
.dialog-body dt { color: var(--muted); font-size: 12px; }
.dialog-body dd { margin: 3px 0 14px; font-weight: 600; overflow-wrap: anywhere; }
.dialog-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dialog-body th, .dialog-body td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dialog-actions > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 650; }
.document-dialog { width: min(1180px, calc(100vw - 30px)); height: calc(100vh - 30px); height: calc(100dvh - 30px); max-height: none; }
.document-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.document-frame { grid-column: 1; grid-row: 2; width: 100%; height: 100%; min-height: 0; border: 0; background: var(--paper); }
.dialog-loading { z-index: 1; grid-column: 1; grid-row: 2; display: grid; place-items: center; min-height: 0; padding: 24px; background: var(--paper); color: var(--muted); font-size: 14px; text-align: center; }
.document-actions { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.document-actions > a { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; font-size: 12px; font-weight: 650; text-decoration: none; }
.image-dialog { width: min(1100px, calc(100vw - 24px)); }
.image-dialog .dialog-body { padding: 14px; }
.image-dialog .dialog-body img { max-height: calc(100dvh - 130px); }
.detail-intro { margin-bottom: 20px; color: var(--muted); }
.detail-card, .contact-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.detail-card h3, .contact-card h3 { margin: 0 0 8px; font-size: 18px; }
.detail-note { margin-top: 18px; padding: 13px 16px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); color: var(--muted); font-size: 13px; line-height: 1.6; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.detail-actions > a, .contact-card > a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 650; text-decoration: none; }
.detail-actions > a:hover, .contact-card > a:hover { border-color: var(--accent); }
.timeline { display: grid; gap: 0; padding: 0; margin: 16px 0; list-style: none; }
.timeline-item { position: relative; padding: 0 0 22px 22px; border-left: 1px solid var(--line); }
.timeline-item::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item h3 { margin: 0 0 5px; font-size: 18px; }
.timeline-item small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.gallery-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gallery-card > :is(a, button) { display: block; width: 100%; border: 0; padding: 0; background: transparent; }
.gallery-card img { width: 100%; height: 220px; border-radius: 7px; object-fit: contain; }
.gallery-card :is(h3, figcaption, p) { margin: 9px 2px 2px; font-size: 13px; line-height: 1.45; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.contact-card p { margin-bottom: 12px; color: var(--muted); overflow-wrap: anywhere; }
.contact-card > .email-address { display: block; min-height: 0; max-width: 100%; padding: 0; border: 0; background: transparent; overflow-wrap: anywhere; text-align: left; line-height: 1.6; }
.setup-facts > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.dialog-body .setup-facts dd { margin-bottom: 0; }
.password-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.password-row code { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.password-row button { margin-left: auto; font-size: 12px; }
.noscript-note { position: fixed; inset: auto 8px 8px; z-index: 50; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px; text-align: center; }

@media (min-width: 981px) and (max-height: 760px) {
  .sidebar-experience > h2, .sidebar-experience-roles { display: none; }
  .sidebar-experience-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 34px; padding: 6px 9px; font-size: 11px; }
}

@media (min-width: 981px) and (max-height: 840px) {
  .sidebar { gap: 10px; padding: calc(16px - var(--profile-lift)) 18px 14px; }
  .sidebar-experience { padding-top: 7px; }
  .avatar { margin-bottom: 8px; }
  .identity-name { font-size: 20px; }
  .identity-role { margin-top: 5px; }
  .identity-location { margin-top: 4px; }
  .side-nav { gap: 2px; }
  .side-nav :is(button, a) { min-height: 34px; padding-block: 4px; }
  .sidebar-bottom { gap: 7px; }
}

@media (min-width: 981px) and (max-height: 700px) {
  .avatar { width: 128px; height: 128px; border-radius: 28px; }
  .main-area { grid-template-rows: 34px minmax(0, 1fr) 58px; gap: 10px; padding: 12px 22px 14px; }
  .view-panel[data-view-panel="work"] { gap: 9px; }
  .hero h1 { font-size: clamp(29px, 3vw, 39px); }
  .hero-description { margin-top: 7px; font-size: 14px; }
  .project-card { gap: 4px 10px; padding: 8px; }
  .project-kicker { display: none; }
  .project-copy h3 { font-size: 18px; }
  .project-actions a { min-height: 32px; padding: 5px 8px; font-size: 11px; }
  .about-summary > p { font-size: 14px; line-height: 1.6; }
}

@media (min-width: 981px) and (max-height: 620px) {
  .sidebar { gap: 4px; padding-block: 8px; }
  .avatar { width: 112px; height: 112px; margin-bottom: 6px; }
  .identity-name { font-size: 18px; }
  .side-nav { gap: 1px; }
  .side-nav :is(button, a) { min-height: 28px; padding-block: 2px; font-size: 13px; }
  .sidebar-experience { padding-top: 4px; }
  .sidebar-bottom { gap: 5px; }
  .sidebar-bottom > a { min-height: 38px; padding-block: 6px; }
}

/* Tablets/phones: all four projects in a compact two-by-two grid. */
@media (max-width: 980px) {
  .portfolio-shell { display: block; }
  .sidebar { display: none; }
  .main-area { height: 100%; grid-template-rows: 56px 44px minmax(0, 1fr) 60px; gap: 12px; padding: 16px 20px; }
  .topbar { gap: 10px; }
  .desktop-topline { display: none; }
  .mobile-identity { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.2; }
  .mobile-identity img { width: 56px; height: 56px; flex: 0 0 auto; object-fit: cover; border-radius: 14px; }
  .mobile-identity small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
  .topbar-actions button { min-width: 42px; min-height: 42px; padding: 8px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
  .mobile-nav button { min-height: 36px; padding: 7px 9px; border-color: transparent; border-radius: 8px; background: transparent; font-size: 13px; }
  .mobile-nav button[aria-selected="true"], .mobile-nav button[aria-current="page"], .mobile-nav button.is-active { background: var(--accent-soft); color: var(--accent); }
  .view-panel[data-view-panel="work"] { gap: 11px; }
  .hero { display: block; }
  .hero h1 { max-width: 700px; margin-top: 6px; font-size: clamp(27px, 4.4vw, 38px); line-height: 1.08; letter-spacing: -.04em; }
  .hero-description { margin-top: 8px; font-size: 14px; line-height: 1.45; }
  .eyebrow { font-size: 10px; letter-spacing: .09em; }
  .section-heading h2 { font-size: 15px; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .project-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(28px, 1fr) auto auto; gap: 5px; align-items: stretch; padding: 9px; border-radius: 14px; }
  .project-kicker { display: none; }
  .action-label-full, .scope-full { display: none; }
  .action-label-short, .scope-short { display: inline; }
  .project-image { grid-column: 1; grid-row: 1; align-self: stretch; height: 100%; border-radius: 8px; }
  .project-copy { grid-column: 1; grid-row: 2; align-self: center; }
  .project-copy h3 { margin-top: 0; font-size: 16px; line-height: 1.2; letter-spacing: -.3px; }
  .project-scope { margin-top: 3px; font-size: 12px; line-height: 1.3; }
  .project-actions { grid-column: 1; grid-row: 3; gap: 5px; align-self: end; }
  .project-actions a { min-height: 32px; padding: 5px 8px; font-size: 11.5px; }
  .work-footer { gap: 9px; }
  .work-footer small { font-size: 11px; }
  .work-footer > :is(button, a) { min-height: 36px; padding: 7px 9px; font-size: 11.5px; }
  .contact-bar { gap: 9px; padding: 7px 10px; border-radius: 12px; }
  .availability-copy { font-size: 12px; }
  .availability-copy small { font-size: 10px; }
  .contact-primary, .contact-secondary { min-height: 44px; padding: 9px 12px; font-size: 12px; }
  .view-panel[data-view-panel="services"] { gap: 12px; }
  .view-intro h2 { font-size: 30px; }
  .view-intro > p:not(.eyebrow) { margin-top: 7px; font-size: 14px; line-height: 1.45; }
  .service-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .service-card { display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: center; justify-content: stretch; column-gap: 12px; row-gap: 5px; padding: 14px; border-radius: 14px; }
  .service-card > svg, .service-icon { grid-column: 1; grid-row: 1 / -1; width: 25px; height: 25px; align-self: center; }
  .service-number { grid-column: 1; grid-row: 1 / -1; align-self: center; }
  .service-card h3 { grid-column: 2; font-size: 18px; }
  .service-card p { grid-column: 2; font-size: 13px; line-height: 1.45; }
  .service-card > a { grid-column: 2; min-height: 30px; }
  .service-note { font-size: 12px; }
  .service-actions { gap: 8px; }
  .service-actions button, .service-actions > a { min-height: 40px; font-size: 12px; }
  .view-panel[data-view-panel="about"] { gap: 15px; }
  .about-layout { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 18px; }
  .about-summary > p { font-size: 14px; line-height: 1.55; }
  .about-summary > p + p { margin-top: 10px; }
  .about-experience { padding: 12px 14px; }
  .about-experience .experience-item :is(h3, h4) { font-size: 14px; }
  .about-experience .experience-focus { font-size: 12px; }
  .about-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; gap: 8px; }
  .fact { padding: 10px; }
  .fact strong { font-size: 17px; }
  .fact span, .fact small { font-size: 11px; }
  .about-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .about-actions button, .about-actions > a { min-height: 52px; padding: 11px 13px; font-size: 13px; }
}

@media (max-width: 480px) {
  .main-area { padding: 12px; gap: 10px; }
  .intro-link { display: none; }
  .hero h1 { font-size: 30px; }
  .project-card { padding: 8px; }
  .project-copy h3 { font-size: 16px; }
  .project-kicker { font-size: 10px; letter-spacing: .025em; }
  .project-actions { gap: 6px; }
  .project-actions a { padding: 5px 7px; font-size: 11px; }
  .availability-dot { display: none; }
  .contact-bar { gap: 7px; padding: 7px 8px; }
  .availability-copy { font-size: 11.5px; }
  .contact-primary, .contact-secondary { padding: 9px 10px; font-size: 11.5px; }
  .contact-secondary svg { display: none; }
  .dialog-header { padding: 11px 13px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-body { padding: 18px; }
  .dialog-body :is(.detail-grid, .gallery, .photo-grid, .certificate-grid, .setup-facts, .contact-grid) { grid-template-columns: minmax(0, 1fr); }
  dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 13px; }
  .document-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .document-dialog .dialog-close { min-width: 44px; padding: 8px; font-size: 12px; }
  .document-actions { gap: 9px; }
  .document-actions > a { font-size: 11px; }
  .gallery-card img { height: 190px; }
}

/* Three service cards need the compact arrangement before the overall shell
   switches to its short-screen layout. Keep card text inside its own row. */
@media (max-width: 980px) and (max-height: 820px) {
  .hero-description { display: none; }
  .view-panel[data-view-panel="about"] { gap: 9px; }
  .about-summary > p { font-size: 13px; line-height: 1.45; }
  .about-summary > p + p { display: none; }
  .about-experience .experience-focus { display: none; }
  .about-links > a { min-height: 34px; font-size: 12px; }
  .about-layout { gap: 12px; }
  .about-experience { padding: 10px 12px; }
  .about-experience > h3 { margin-bottom: 7px; font-size: 10px; }
  .about-experience .experience-dates { font-size: 11px; }
  .about-experience .experience-item + .experience-item { margin-top: 7px; padding-top: 7px; }
  .view-panel[data-view-panel="services"] { gap: 9px; }
  .services-view .view-intro > p { display: none; }
  .services-view .view-intro h2 { margin-top: 0; font-size: 22px; line-height: 1.2; }
  .service-grid { gap: 7px; }
  .service-card { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; padding: 7px 9px; column-gap: 9px; row-gap: 3px; }
  .service-card > svg, .service-icon { width: 22px; height: 22px; }
  .service-number { display: none; }
  .service-card h3 { grid-column: 1; grid-row: 1; font-size: 14px; }
  .service-card p { grid-column: 1 / -1; grid-row: 2; font-size: 12px; line-height: 1.35; }
  .service-card > a { grid-column: 2; grid-row: 1; min-height: 26px; gap: 4px; font-size: 10.5px; white-space: nowrap; }
  .service-note { font-size: 11px; line-height: 1.4; }
  .service-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 6px; }
  .service-actions button, .service-actions > a { justify-content: center; min-height: 40px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; font-size: 10.5px; line-height: 1.3; text-align: center; text-decoration: none; }
}

/* Short portrait screens keep readable controls and all four project cards.
   The optional hero paragraph is repeated by the project scope/evidence views. */
@media (max-width: 980px) and (max-height: 660px) {
  .main-area { grid-template-rows: 48px 40px minmax(0, 1fr) 50px; gap: 6px; padding: 8px; }
  .mobile-nav { padding: 2px; }
  .mobile-nav button { min-height: 34px; font-size: 12px; padding: 6px; }
  .mobile-identity { gap: 8px; font-size: 13px; }
  .mobile-identity img { width: 48px; height: 48px; }
  .topbar-actions button { min-height: 38px; min-width: 38px; }
  .view-panel[data-view-panel="work"] { gap: 7px; }
  .hero h1 { margin-top: 4px; font-size: 25px; line-height: 1.2; }
  .hero-description { display: none; }
  .eyebrow { font-size: 9.5px; }
  .section-heading h2 { font-size: 13px; }
        .project-grid { gap: 7px; }
  .project-card { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 7px; border-radius: 11px; }
  .project-kicker { display: none; }
  .project-copy h3 { margin-top: 0; font-size: 15px; line-height: 1.2; }
  .project-scope { margin-top: 3px; font-size: 12px; line-height: 1.3; }
  .project-actions a { min-height: 30px; padding: 4px 6px; font-size: 10.5px; }
  .project-actions a svg { width: 13px; height: 13px; }
  .work-footer { gap: 8px; }
  .work-footer small { font-size: 10px; line-height: 1.3; }
  .work-footer > :is(button, a) { min-height: 32px; padding: 6px 8px; font-size: 11px; }
  .contact-bar { padding: 3px 6px; }
  .availability-copy { font-size: 11px; }
  .availability-copy small { display: none; }
  .contact-primary, .contact-secondary { min-height: 42px; padding: 8px 9px; font-size: 11.5px; }
  .view-intro h2 { font-size: 25px; }
  .view-intro > p:not(.eyebrow) { margin-top: 5px; font-size: 12.5px; line-height: 1.4; }
  .view-panel[data-view-panel="about"] { gap: 8px; }
  .about-layout { gap: 12px; }
  .about-summary > p { font-size: 12.5px; line-height: 1.45; }
  .about-summary > p + p { margin-top: 8px; }
  .about-experience { padding: 8px 10px; }
  .about-experience .experience-item :is(h3, h4) { font-size: 13px; }
  .about-links { gap: 9px; }
  .about-links > a { min-height: 32px; font-size: 11.5px; }
  .about-facts { margin: 0; gap: 6px; }
  .fact { padding: 6px; border-radius: 9px; }
  .fact strong { margin-top: 3px; font-size: 13.5px; line-height: 1.2; }
  .fact span, .fact small { margin-top: 3px; font-size: 10px; line-height: 1.25; }
  .fact > span:first-child { font-size: 9px; }
  .about-actions { gap: 7px; }
  .about-actions button, .about-actions > a { min-height: 44px; padding: 8px 10px; font-size: 12px; }
}

/* Landscape phones: compact rows keep all four projects within the screen. */
@media (max-width: 980px) and (min-width: 600px) and (max-height: 480px) {
  .main-area { grid-template-rows: 34px 36px minmax(0, 1fr) 46px; gap: 5px; padding: 7px 12px; }
  .mobile-identity img { width: 34px; height: 34px; border-radius: 10px; }
  .topbar-actions button { min-width: 34px; min-height: 32px; padding: 5px 8px; }
  .mobile-nav { width: min(440px, 100%); }
  .mobile-nav button { min-height: 30px; padding: 4px 8px; }
  .view-panel[data-view-panel="work"] { grid-template-rows: auto minmax(0, 1fr) auto; gap: 5px; }
  .work-view > .section-heading { display: none; }
  .hero { display: block; }
  .hero-copy { display: block; }
  .hero .eyebrow { display: none; }
  .eyebrow { flex: 0 0 auto; font-size: 9px; letter-spacing: .05em; }
  .hero h1 { margin-top: 0; font-size: 22px; line-height: 1.1; text-wrap: initial; }
  .hero h1 br { display: none; }
  .hero h1 span { margin-left: .2em; }
  .section-heading h2 { font-size: 13px; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .project-card { grid-template-columns: 52px minmax(0, 1fr) 64px; grid-template-rows: minmax(0, 1fr); gap: 0 8px; padding: 6px 8px; }
  .project-image { grid-column: 1; grid-row: 1; }
  .project-copy { grid-column: 2; grid-row: 1; }
  .project-actions { grid-column: 3; grid-row: 1; flex-direction: column; justify-content: center; align-items: stretch; gap: 4px; align-self: stretch; }
  .project-copy h3 { font-size: 15px; }
  .project-scope { font-size: 12px; }
  .project-actions a { min-height: 26px; padding: 4px 6px; font-size: 10px; }
  .work-footer > :is(button, a) { min-height: 28px; padding: 4px 9px; }
  .contact-bar { padding: 1px 9px; }
  .availability-copy { font-size: 12px; }
  .contact-primary, .contact-secondary { min-height: 40px; padding: 8px 14px; font-size: 12px; }
  .view-panel[data-view-panel="services"] { gap: 7px; }
  .view-intro h2 { font-size: 24px; }
  .view-intro > p:not(.eyebrow) { display: none; }
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 9px; }
  .service-card { display: flex; justify-content: center; gap: 5px; padding: 10px 12px; }
  .service-card > svg, .service-icon { display: none; }
  .service-card h3 { font-size: 16px; }
  .service-card p { font-size: 12px; line-height: 1.4; }
  .service-card > a { min-height: 26px; font-size: 11px; }
  .service-note { font-size: 11px; }
  .service-actions { display: flex; }
  .service-actions button, .service-actions > a { min-height: 32px; padding: 5px 9px; }
  .about-layout { grid-template-columns: 1.2fr 1fr; gap: 20px; }
  .about-view .view-intro .eyebrow { display: none; }
  .about-view .view-intro h2 { margin-top: 0; }
  .about-summary > p { font-size: 12px; line-height: 1.4; }
  .about-experience { padding: 8px 10px; }
  .about-experience .experience-focus { display: none; }
  .about-experience .experience-item :is(h3, h4) { font-size: 12px; }
  .about-facts { margin: 0; }
  .fact { padding: 6px 8px; }
  .fact strong { font-size: 15px; }
  .about-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .about-actions button, .about-actions > a { min-height: 40px; padding: 6px 8px; font-size: 11px; }
  dialog { max-height: calc(100dvh - 14px); }
  .dialog-header { padding: 7px 13px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-close { min-height: 36px; }
  .document-dialog { height: calc(100dvh - 14px); }
}

@media (prefers-reduced-motion: no-preference) {
  button, .project-actions a, .contact-secondary, .social-links a { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; animation: none; transition: none; }
}


/* Availability sits with the introduction; the build credits take its old slot. */
.main-area { grid-template-rows: 52px minmax(0, 1fr) 66px; }
.intro-stack { display: grid; justify-items: start; gap: 0; flex: 0 0 auto; }
.intro-stack .intro-link { min-height: 30px; padding: 3px 0; }
.intro-availability { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.intro-availability .availability-dot { display: block; width: 6px; height: 6px; }
.build-tools { display: flex; align-items: center; gap: 10px; flex: 1 1 0; min-width: 0; }
.build-tools-label { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tools-window { flex: 1 1 0; min-width: 0; overflow: hidden; container-type: inline-size; mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.tools-track { display: flex; width: max-content; }
.tools-group { display: flex; align-items: center; justify-content: space-around; gap: 28px; flex: 0 0 auto; min-width: 100cqw; padding: 5px 28px 5px 0; }
.build-tool { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
.tool-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto; color: var(--accent); font-family: var(--font-body); font-size: 19px; line-height: 1; }
.tool-mark-codex { font-family: ui-monospace, monospace; font-size: 15px; font-weight: 700; }
.tool-mark img { width: 20px; height: 20px; object-fit: contain; }

@media (prefers-reduced-motion: no-preference) {
  .tools-track { animation: portfolio-tool-scroll 26s linear infinite; }
  @keyframes portfolio-tool-scroll { to { transform: translateX(-50%); } }
}

@media (max-width: 980px) {
  .main-area { grid-template-rows: 56px 44px minmax(0, 1fr) 60px; }
  .build-tools { gap: 7px; }
  .build-tools-label { display: none; }
  .tools-group { gap: 22px; padding-right: 22px; }
  .build-tool { font-size: 11px; gap: 6px; }
}

@media (max-width: 600px) {
  .main-area { grid-template-rows: 60px 44px minmax(0, 1fr) 84px; gap: 7px; }
  .topbar { gap: 7px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .theme-toggle { min-width: 34px; min-height: 38px; padding: 7px; }
  .intro-stack .intro-link { display: inline-flex; min-height: 30px; font-size: 10.5px; gap: 3px; white-space: nowrap; }
  .intro-availability { gap: 4px; font-size: 9.5px; }
  .intro-availability .availability-dot { width: 5px; height: 5px; }
  .mobile-identity { gap: 7px; font-size: 12px; }
  .mobile-identity img { width: 56px; height: 56px; border-radius: 14px; }
  .mobile-identity > span { min-width: 0; }
  .mobile-identity strong { display: block; }
  .mobile-identity small { font-size: 9px; line-height: 1.3; }
  .contact-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 26px 42px; gap: 5px 8px; padding: 4px 8px; }
  .build-tools { grid-column: 1 / -1; width: 100%; }
  .tools-group { gap: 22px; padding-top: 2px; padding-bottom: 2px; }
  .build-tool { font-size: 11px; }
  .tool-mark { width: 18px; height: 18px; font-size: 17px; }
  .tool-mark img { width: 17px; height: 17px; }
  .tool-mark-codex { font-size: 13px; }
  .contact-primary, .contact-secondary { min-height: 42px; padding: 8px; }
}

@media (max-width: 980px) and (max-height: 660px) {
  .main-area { grid-template-rows: 48px 40px minmax(0, 1fr) 76px; gap: 4px; }
  .contact-bar { grid-template-rows: 22px 42px; padding: 3px 6px; gap: 4px 8px; }
  .mobile-identity img { width: 48px; height: 48px; }
}

@media (max-width: 980px) and (min-width: 601px) and (max-height: 480px) {
  .main-area { grid-template-rows: 42px 36px minmax(0, 1fr) 46px; }
  .intro-stack .intro-link { min-height: 22px; padding: 0; font-size: 11px; }
  .intro-availability { font-size: 10px; line-height: 1.2; }
  .contact-bar { padding-top: 1px; padding-bottom: 1px; }
  .build-tools { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .tools-window { overflow-x: auto; mask-image: none; scrollbar-width: none; }
  .tools-track { animation: none; transform: none; }
  .tools-group { gap: 14px; padding-right: 0; }
  .tools-group + .tools-group { display: none; }
}

.tool-mark { background: #fff; border-radius: 50%; padding: 3px; }
.tool-mark img { width: 100%; height: 100%; }

/* Keep the two-row credit/contact footer within short phone screens. */
@media (max-width: 600px) and (max-height: 720px) {
  .about-layout { gap: 8px; }
  .about-actions { gap: 6px; }
  .about-actions button, .about-actions > a { min-height: 44px; padding: 4px 10px; font-size: 12px; }
}
@media (max-width: 600px) and (max-height: 600px) {
  .hero .eyebrow, .about-view > .view-intro > .eyebrow { display: none; }
  .hero h1 { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 600px) {
  .tools-group { gap: 8px; }
  .build-tool { gap: 4px; }
  .tool-mark { width: 16px; height: 16px; padding: 2px; }
}

/* Quiet ambient movement stays inside each existing image frame. */
@media (prefers-reduced-motion: no-preference) {
  .project-image img {
    transform-origin: 50% 50%;
    animation: portfolio-image-drift 14s ease-in-out infinite;
  }

  .project-card:nth-child(2) .project-image img { animation-delay: -3.5s; }
  .project-card:nth-child(3) .project-image img { animation-delay: -7s; }
  .project-card:nth-child(4) .project-image img { animation-delay: -10.5s; }

  .project-card:focus-within .project-image img,
  html[data-motion="paused"] .project-image img {
    animation-play-state: paused;
  }

  @keyframes portfolio-image-drift {
    0%, 100% { transform: translate3d(0, 1px, 0) rotate(-.35deg) scale(.975); }
    50% { transform: translate3d(0, -2px, 0) rotate(.35deg) scale(.995); }
  }
}

/* Desktop hover adds a small tilt; links and copy stay still at rest. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) and (min-width: 981px) {
  .project-card {
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  }

  html:not([data-motion="paused"]) .project-card:hover {
    transform: translateY(-2px) rotate(-.2deg);
    border-color: var(--accent);
    box-shadow: 0 15px 32px color-mix(in srgb, var(--ink) 12%, transparent);
  }

  html:not([data-motion="paused"]) .project-card:nth-child(even):hover {
    transform: translateY(-2px) rotate(.2deg);
  }

  .project-card:hover .project-image img { animation-play-state: paused; }
}

@media (prefers-reduced-motion: reduce) {
  .project-image img { animation: none; transform: none; }
  .project-card { transition: none; transform: none; }
}

/* Preserve the approved left-profile composition on tablet-sized previews.
   Only narrow phones retain the compact portrait/header arrangement. */
@media (min-width: 701px) and (max-width: 980px) and (min-height: 700px) {
  .portfolio-shell {
    display: grid;
    grid-template-columns: 194px minmax(0, 1fr);
  }
  .sidebar {
    display: flex;
    gap: 10px;
    padding: calc(15px - var(--profile-lift)) 13px 12px;
  }
  .sidebar .avatar {
    width: 134px;
    height: 134px;
    border-radius: 25px;
  }
  .sidebar .identity-role { font-size: 12px; }
  .sidebar .identity-location { font-size: 11px; }
  .side-nav { gap: 3px; }
  .side-nav :is(button, a) {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 12px;
  }
  .sidebar-experience-roles, .sidebar-experience > h2 { display: none; }
  .sidebar-experience-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .sidebar-bottom { gap: 5px; }
  .sidebar-bottom > a { min-height: 38px; }
  .social-links { gap: 2px; }
  .main-area {
    grid-template-rows: 52px minmax(0, 1fr) 60px;
    gap: 10px;
    padding: 15px 15px 14px;
  }
  .mobile-identity, .mobile-nav { display: none; }
  .project-grid { gap: 9px; }
  .project-card { gap: 4px; padding: 7px; }
  .project-copy h3 { font-size: 15px; }
  .project-actions { gap: 4px; }
  .project-actions a { padding: 5px 6px; font-size: 10.5px; }
}


/* Preview contact placement: desktop header, compact header row on narrow screens. */
.topbar-contact { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-contact :is(.contact-primary, .contact-secondary) { min-height: 38px; padding: 8px 12px; white-space: nowrap; }
.main-area:has(.topbar-contact) .build-tools-label { display: block; }
@media (max-width: 980px) {
  .main-area:has(.topbar-contact) .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) 38px; gap: 4px 8px; }
  .main-area:has(.topbar-contact) .topbar-actions { grid-column: 2; grid-row: 1; }
  .topbar-contact { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; gap: 6px; }
  .topbar-contact :is(.contact-primary, .contact-secondary) { min-height: 38px; padding: 6px 10px; font-size: 12px; }
  .main-area:has(.topbar-contact) { grid-template-rows: 98px 44px minmax(0, 1fr) 42px; }
  .main-area:has(.topbar-contact) .contact-bar { display: flex; padding: 3px 8px; }
  .main-area:has(.topbar-contact) .build-tools-label { font-size: 9px; letter-spacing: .03em; }
}
@media (min-width: 701px) and (max-width: 980px) and (min-height: 700px) {
  .main-area:has(.topbar-contact) { grid-template-rows: 94px minmax(0, 1fr) 42px; }
}
@media (max-width: 600px) {
  .main-area:has(.topbar-contact) { grid-template-rows: 102px 44px minmax(0, 1fr) 42px; }
  .topbar-contact { justify-content: stretch; }
  .topbar-contact :is(.contact-primary, .contact-secondary) { flex: 1 1 0; }
}
@media (max-width: 980px) and (max-height: 660px) {
  .main-area:has(.topbar-contact) { grid-template-rows: 90px 40px minmax(0, 1fr) 34px; }
}
@media (max-width: 980px) and (min-width: 601px) and (max-height: 480px) {
  .main-area:has(.topbar-contact) { grid-template-rows: 42px 36px minmax(0, 1fr) 46px; }
  .main-area:has(.topbar-contact) .topbar { display: flex; gap: 6px; }
  .topbar-contact :is(.contact-primary, .contact-secondary) { min-height: 32px; padding: 5px 7px; font-size: 10px; }
  .main-area:has(.topbar-contact) .mobile-identity img { width: 32px; height: 32px; }
}


/* Shared action row directly above the moving tools strip. Keep contact links
   available in every view and keep the existing sidebar and project grid. */
.main-area:has(.preview-bottom) { grid-template-rows: 40px minmax(0, 1fr) auto; }
.main-area:has(.preview-bottom) .view-panel[data-view-panel="work"] { grid-template-rows: auto auto minmax(0, 1fr); }
.preview-bottom { display: grid; grid-template-rows: auto 66px; gap: 8px; min-width: 0; }
.preview-bottom .work-footer { gap: 8px; }
.work-footer-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; min-width: 0; }
.work-footer-actions > :is(a, button) { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.3; text-decoration: none; text-align: center; white-space: nowrap; }
.work-footer-actions > .contact-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.work-footer-actions > :is(a, button):hover { border-color: var(--accent); }
.main-area:has(.preview-bottom) .build-tools-label { display: block; }
.main-area:has(.work-view[hidden]) .work-footer { justify-content: flex-end; }
.main-area:has(.work-view[hidden]) .work-footer > small,
.main-area:has(.work-view[hidden]) .work-samples-link { display: none; }
@media (min-width: 981px) and (max-height: 700px) {
  .main-area:has(.preview-bottom) { grid-template-rows: 34px minmax(0, 1fr) auto; }
  .preview-bottom { grid-template-rows: auto 52px; gap: 5px; }
}
@media (max-width: 1250px) {
  .preview-bottom .work-footer { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .preview-bottom .work-footer > small { flex: 1 1 100%; text-align: right; font-size: 10px; }
  .work-footer-actions { gap: 5px; }
  .work-footer-actions > :is(a, button) { padding-inline: 8px; font-size: 11px; }
}
@media (max-width: 980px) {
  .main-area:has(.preview-bottom) { grid-template-rows: 56px 44px minmax(0, 1fr) auto; }
  .preview-bottom { grid-template-rows: auto 40px; gap: 5px; }
  .preview-bottom .contact-bar { display: flex; padding: 3px 8px; }
  .main-area:has(.preview-bottom) .build-tools-label { font-size: 9px; letter-spacing: .03em; }
  .work-footer-actions { flex: 1 1 100%; }
  .work-footer-actions > :is(a, button) { flex: 1 1 0; min-width: 0; min-height: 34px; padding: 5px 6px; }
}
@media (min-width: 701px) and (max-width: 980px) and (min-height: 700px) {
  .main-area:has(.preview-bottom) { grid-template-rows: 40px minmax(0, 1fr) auto; }
}
@media (max-width: 600px) {
  .main-area:has(.preview-bottom) { grid-template-rows: 60px 44px minmax(0, 1fr) auto; }
  .work-footer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 4px; }
  .preview-bottom .work-footer > small { text-align: center; }
  .main-area:has(.work-view[hidden]) .work-footer-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main-area:has(.work-view[hidden]) .work-footer-actions > :is(a, button) { white-space: normal; }
}
@media (max-width: 980px) and (max-height: 660px) {
  .main-area:has(.preview-bottom) { grid-template-rows: 48px 40px minmax(0, 1fr) auto; }
  .preview-bottom { grid-template-rows: auto 32px; gap: 4px; }
  .work-footer-actions > :is(a, button) { min-height: 32px; padding: 4px 5px; font-size: 11px; }
  .preview-bottom .work-footer > small { font-size: 9px; }
}
@media (max-width: 980px) and (min-width: 600px) and (max-height: 480px) {
  .main-area:has(.preview-bottom) { grid-template-rows: 34px 36px minmax(0, 1fr) auto; }
  .main-area:has(.preview-bottom) .view-panel[data-view-panel="work"] { grid-template-rows: auto minmax(0, 1fr); }
  .preview-bottom { grid-template-rows: auto 30px; gap: 3px; }
  .preview-bottom .work-footer { flex-wrap: nowrap; }
  .preview-bottom .work-footer > small { flex: 1 1 0; text-align: left; }
  .work-footer-actions { display: flex; flex: 0 0 auto; }
  .work-footer-actions > :is(a, button) { min-height: 28px; font-size: 10px; padding: 4px 6px; }
}


/* Availability beside shared work actions; the desktop header is theme-only. */
.work-footer-meta { display: flex; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.work-footer-meta .intro-availability { flex: 0 0 auto; }
.work-footer-meta > small { min-width: 0; }
.main-area:has(.work-view[hidden]) .work-footer-meta > small { display: none; }
.main-area:has(.work-view[hidden]) .work-footer-meta { justify-content: flex-end; }
@media (max-width: 1250px) {
  .preview-bottom .work-footer-meta { flex: 1 1 100%; }
  .preview-bottom .work-footer-meta > small { font-size: 10px; }
}
@media (max-width: 980px) {
  .work-footer-meta .intro-availability { font-size: 10px; }
}
@media (max-width: 600px) {
  .preview-bottom .work-footer-meta { gap: 6px; }
  .preview-bottom .work-footer-meta > small { flex: 1 1 auto; text-align: left; }
  .work-footer-meta .intro-availability { font-size: 9.5px; }
}
@media (max-width: 980px) and (max-height: 660px) {
  .preview-bottom .work-footer-meta > small { font-size: 9px; line-height: 1.2; }
}
@media (max-width: 980px) and (min-width: 600px) and (max-height: 480px) {
  .preview-bottom .work-footer-meta { flex: 1 1 0; flex-wrap: wrap; gap: 1px 5px; }
  .preview-bottom .work-footer-meta > small { font-size: 9px; }
  .work-footer-meta .intro-availability { font-size: 9px; }
}


/* Original portfolio social links replace the redundant Selected work title. */
.portfolio-social-links { gap: 9px; }
.portfolio-social-links > a {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; min-height: 30px; padding: 4px 10px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); text-decoration: none; font-size: 12px;
  font-weight: 650; line-height: 1.25; white-space: nowrap;
}
.portfolio-social-links > a:hover { color: var(--accent); border-color: var(--accent); }
.portfolio-social-links .social-symbol { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-weight: 750; line-height: 1; }
.portfolio-social-links a svg { width: 15px; height: 15px; }
.portfolio-social-links .linkedin-symbol { color: #0a66c2; font-size: 15px; }
.portfolio-social-links .olj-symbol { font-size: 10px; letter-spacing: -.03em; color: var(--accent); }
@media (max-width: 600px) {
  .portfolio-social-links { gap: 4px; }
  .portfolio-social-links > a { padding: 4px 6px; font-size: 11px; min-height: 28px; }
  .portfolio-social-links a svg { width: 13px; height: 13px; }
  .portfolio-social-links .olj-symbol { display: none; }
}
@media (max-width: 980px) and (max-height: 660px) {
  .portfolio-social-links > a { min-height: 26px; padding-block: 3px; }
  .main-area:has(.work-view[hidden]) .preview-bottom .work-footer-meta { flex: 1 1 0; }
  .main-area:has(.work-view[hidden]) .work-footer-actions { flex: 0 1 auto; }
}
@media (max-width: 600px) and (max-height: 660px) {
  .main-area:has(.work-view[hidden]) .preview-bottom .work-footer-meta { flex: 1 1 100%; }
  .main-area:has(.work-view[hidden]) .work-footer-actions { flex: 1 1 100%; }
  .main-area:has(.work-view[hidden]) .preview-bottom { gap: 2px; }
  .main-area:has(.work-view[hidden]) .work-footer { gap: 2px; }
  .main-area:has(.work-view[hidden]) .work-footer-actions > :is(a, button) { min-height: 28px; padding: 3px; }
  .main-area:has(.preview-bottom) .about-layout { gap: 6px; }
  .main-area:has(.preview-bottom) .about-summary > p { font-size: 12px; line-height: 1.35; }
  .main-area:has(.preview-bottom) .about-experience { padding: 6px 8px; }
  .main-area:has(.preview-bottom) .about-actions { gap: 5px; }
  .main-area:has(.preview-bottom) .about-actions > button { min-height: 40px; padding: 4px 8px; }
}
@media (min-width: 981px) and (max-height: 700px) {
  .main-area:has(.preview-bottom) .view-panel[data-view-panel="services"] { gap: 9px; }
  .main-area:has(.preview-bottom) .service-card { gap: 8px; padding: 12px; }
  .main-area:has(.preview-bottom) .service-card h3 { font-size: 19px; }
  .main-area:has(.preview-bottom) .service-card p { font-size: 13px; line-height: 1.4; }
  .main-area:has(.preview-bottom) .service-card > a { min-height: 29px; }
  .main-area:has(.preview-bottom) .view-panel[data-view-panel="about"] { gap: 14px; }
  .main-area:has(.preview-bottom) .about-actions > button { min-height: 52px; padding: 9px; }
  .main-area:has(.work-view[hidden]) .preview-bottom .work-footer-meta { flex: 1 1 auto; }
}
@media (max-width: 980px) and (min-width: 600px) and (max-height: 480px) {
  .portfolio-social-links > a { padding: 3px 5px; min-height: 24px; }
  .portfolio-social-links .social-label { display: none; }
  .portfolio-social-links .olj-symbol { display: inline-flex; }
  .main-area:has(.preview-bottom) .service-card { gap: 3px; padding: 6px 8px; }
  .main-area:has(.preview-bottom) .service-card p { line-height: 1.3; }
}


/* Restore original brand assets; retain the original envelope for email. */
.portfolio-social-links .social-brand-logo { display: block; flex: 0 0 auto; width: 17px; height: 17px; object-fit: contain; }
.portfolio-social-links .social-olj-logo { width: 44px; height: 17px; }
.portfolio-social-links .social-olj-link .social-label { display: none; }
@media (max-width: 600px) {
  .portfolio-social-links .social-brand-logo { width: 15px; height: 15px; }
  .portfolio-social-links .social-olj-logo { width: 42px; height: 15px; }
}
@media (max-width: 600px) and (max-height: 700px) {
  .main-area:has(.preview-bottom) .view-panel[data-view-panel="work"] { gap: 6px; }
  .portfolio-social-links > a { min-height: 24px; padding-block: 3px; }
  .preview-bottom { gap: 3px; }
  .work-footer-actions > :is(a, button) { min-height: 31px; padding-block: 3px; }
  .main-area:has(.preview-bottom) .project-grid { gap: 6px; }
  .main-area:has(.preview-bottom) .project-card { padding: 6px; gap: 3px; grid-template-rows: minmax(24px, 1fr) auto auto; }
  .main-area:has(.preview-bottom) .project-actions { gap: 4px; }
}

/* Landscape footer: size each control to its actual label. */
@media (min-width: 600px) and (max-width: 980px) and (max-height: 480px) {
  .preview-bottom .work-footer-meta { flex: 1 1 0; min-width: 0; }
  .preview-bottom .work-footer-actions { flex: 0 0 auto; }
  .preview-bottom .work-footer-actions > :is(a, button) { flex: 0 0 auto; min-width: max-content; }
  .preview-bottom .work-footer-meta > small { white-space: normal; overflow-wrap: anywhere; }
}

/* Professional contacts belong to the profile, not the work heading. */
.profile-social-links {
  display: flex; align-items: center; justify-content: center; flex-wrap: nowrap;
  gap: 5px; min-width: 0;
}
.identity .profile-social-links { margin-top: 8px; }
.profile-social-links > a {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 36px; height: 34px; min-width: 36px; min-height: 34px;
  padding: 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.profile-social-links > a:hover { border-color: var(--accent); background: var(--accent-soft); }
.profile-social-links > a > :is(img, svg) {
  display: block; width: 19px; height: 19px; flex: 0 0 auto; object-fit: contain;
}
.profile-social-links img[src$="brand-linkedin.png"] {
  background: #0a66c2; border-radius: 3px;
}
.profile-social-links img[src$="brand-onlinejobs.png"] {
  background: #fff; border-radius: 3px;
}
.about-profile-social-links { display: none; }
@media (max-width: 980px) {
  .about-view > .view-intro:has(.about-profile-social-links) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 5px;
  }
  .about-view > .view-intro > .eyebrow { grid-column: 1 / -1; }
  .about-profile-social-links { display: flex; grid-column: 2; grid-row: auto; gap: 3px; }
  .about-view > .view-intro > h2 { grid-column: 1; }
  .about-profile-social-links > a { width: 29px; height: 29px; min-width: 29px; min-height: 29px; padding: 4px; }
  .about-profile-social-links > a > :is(img, svg) { width: 17px; height: 17px; }
}
@media (max-width: 360px) {
  .about-view > .view-intro > h2 { font-size: 22px; }
}
@media (min-width: 701px) and (max-width: 980px) and (min-height: 700px) {
  .about-profile-social-links { display: none; }
  .identity .profile-social-links { gap: 4px; }
  .identity .profile-social-links > a { width: 32px; min-width: 32px; padding: 5px; }
}

/* Portfolio build credits: the two identical tracks retain a seamless loop. */
.build-tool .tool-mark-text {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .tools-track { animation-duration: 55s; }
  .view-panel:not([hidden]) { animation: portfolio-view-enter .4s ease-out both; }
  .intro-availability .availability-dot { animation: portfolio-status-pulse 2.8s ease-in-out infinite; }
  .project-image img { animation-duration: 10s; }
  @keyframes portfolio-view-enter {
    from { opacity: .5; }
    to { opacity: 1; }
  }
  @keyframes portfolio-status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    45% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
    85% { box-shadow: 0 0 0 7px transparent; }
  }
  @keyframes portfolio-image-drift {
    0%, 100% { transform: translate3d(0, 1px, 0) rotate(-.8deg) scale(.965); }
    50% { transform: translate3d(0, -3px, 0) rotate(.8deg) scale(.99); }
  }
  html[data-motion="paused"] .view-panel:not([hidden]) { animation: none; }
  html[data-motion="paused"] .intro-availability .availability-dot { animation: none; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .profile-social-links > a, .side-nav :is(button, a), .work-footer-actions > :is(a, button) {
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
  }
  html:not([data-motion="paused"]) .profile-social-links > a:hover {
    box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 18%, transparent);
  }
}

/* Remove obsolete landscape grid positioning from the old center contact row. */
@media (min-width: 600px) and (max-width: 980px) and (max-height: 480px) {
  .main-area:has(.preview-bottom) .view-panel[data-view-panel="work"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .work-view > .hero { grid-column: 1; grid-row: 1; }
  .work-view > .project-grid { grid-column: 1; grid-row: 2; }
  .about-view .about-layout { align-content: start; gap: 12px; }
  .about-view .about-links > a { min-height: 26px; }
  .about-view .about-experience { padding-block: 5px; }
}

/* Compact, read-only Cloudflare traffic counter. Preserve dashboard geometry. */
.visit-counter { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto; min-width: 0; padding: 2px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 10.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.visit-counter > svg { color: var(--accent); flex: 0 0 auto; }
.visit-counter > strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.footer-disclaimer-compact { display: none; }
@media (max-width: 600px), (min-width: 600px) and (max-width: 980px) and (max-height: 480px) {
 .visit-counter { gap: 3px; padding: 1px 4px; font-size: 9px; }
 .visit-counter > strong { font-size: 10px; }
 .visit-counter > svg { width: 12px; height: 12px; }
 .footer-disclaimer-full { display: none; }
 .footer-disclaimer-compact { display: inline; }
}
@media (max-width: 360px) { .visit-counter > svg { display: none; } }

/* User-provided experience marks; preserve the original employment labels. */
.experience-row { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 7px; min-width: 0; }
.experience-row > div { min-width: 0; }
.experience-logo { display: block; width: 28px; height: 28px; object-fit: contain; border-radius: 4px; background: #fff; }
.about-experience .experience-row { grid-template-columns: 32px minmax(0,1fr); }
.about-experience .experience-logo { width: 32px; height: 32px; }
@media (max-width: 600px), (max-height: 660px) { .about-experience .experience-row { grid-template-columns: 24px minmax(0,1fr); gap: 6px; } .about-experience .experience-logo { width: 24px; height: 24px; } }

/* Tall portrait phones: reclaim the small amount of vertical space used by logo rows,
   without reducing type sizes or hiding the existing experience descriptions. */
@media (max-width: 600px) and (min-height: 821px) {
  .about-layout { gap: 10px; }
  .about-experience { padding-block: 6px; }
  .about-experience > h3 { margin-bottom: 6px; }
  .about-experience .experience-item + .experience-item { margin-top: 7px; padding-top: 7px; }
}


/*
 * Theme-specific official brand logos and intuitive portfolio navigation.
 * Reference behavior: light theme shows the moon (action: switch to dark);
 * dark theme shows the sun (action: switch to light).
 * Back arrow stays in the content top bar, never over the profile photo.
 */
.brand-logo-pair{display:block;position:relative;flex:0 0 auto;width:108px;height:36px}
.brand-logo-pair .brand-logo{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.brand-logo-pair .brand-logo-dark{display:none}
html[data-theme="dark"] .brand-logo-pair .brand-logo-light{display:none}
html[data-theme="dark"] .brand-logo-pair .brand-logo-dark{display:block}
.brand-home-link{display:inline-flex;align-items:center;justify-content:center;min-width:108px;min-height:36px;border-radius:9px}
.brand-home-link:hover,.mobile-brand-home:hover{background:var(--surface-soft)}
.brand-home-link:focus-visible,.mobile-brand-home:focus-visible,.portfolio-back-home:focus-visible,.theme-toggle:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.sidebar-signature{gap:6px}

/* Replaces the awkward over-portrait Home button with one compact arrow
   at the left edge of the main header, in the location indicated by user. */
.portfolio-back-home{
 display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
 width:42px;height:42px;min-width:42px;min-height:42px;
 padding:9px;border:1px solid var(--line);border-radius:50%;
 background:var(--surface);color:var(--ink);box-shadow:0 3px 10px #00000012;
 transition:background .15s ease,color .15s ease,transform .15s ease;
}
.portfolio-back-home svg{width:21px;height:21px;flex:0 0 auto}
.portfolio-back-home:hover{background:var(--accent-soft);color:var(--accent);transform:translateX(-2px)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:0;width:42px;height:42px;min-width:42px;min-height:42px;padding:9px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.theme-toggle:hover{background:var(--accent-soft);color:var(--accent)}
.theme-toggle .mode-symbol-light{display:block}
.theme-toggle .mode-symbol-dark{display:none}
html[data-theme="dark"] .theme-toggle .mode-symbol-light{display:none}
html[data-theme="dark"] .theme-toggle .mode-symbol-dark{display:block}
.mobile-brand-home{display:none}
@media(max-width:880px){
 .portfolio-back-home{width:40px;height:40px;min-width:40px;min-height:40px;padding:8px}
 .mobile-brand-home{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;flex:0 0 auto}
 .mobile-brand-home .brand-logo-pair{width:75px;height:36px}
 .mobile-identity{min-width:0;flex:1 1 auto}
 .mobile-identity>span{min-width:0}
 .mobile-identity strong{display:block}
 .topbar{gap:8px}
 .topbar-actions{gap:7px}
 .theme-toggle{width:40px;height:40px;min-width:40px;min-height:40px;padding:8px}
}
@media(max-width:375px){
 .mobile-brand-home .brand-logo-pair{width:58px;height:32px}
 .mobile-identity{gap:6px}
 .mobile-identity strong{font-size:12px}
 .portfolio-back-home,.theme-toggle{width:36px;height:36px;min-width:36px;min-height:36px;padding:7px}
}
@media(max-width:330px){.mobile-brand-home{display:none}}
@media(max-height:650px) and (min-width:881px){
 .sidebar-signature .brand-logo-pair{width:91px;height:27px}
 .brand-home-link{min-height:27px;min-width:91px}
}
@media(prefers-reduced-motion:reduce){.portfolio-back-home{transition:none;transform:none!important}}

/* Keep the admin evidence readable in both card sizes. */
.samples-heading-link { color: var(--ink); text-decoration: none; }
.samples-heading-link span { color: var(--accent); }
.samples-heading-link:hover { text-decoration: underline; }
.project-card[data-project="electronics"] {
  border-color: var(--accent);
}
.project-card[data-project="electronics"] .project-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.project-card .project-link { font-weight: 700; }
.about-summary .visit-counter { margin-block: 4px; }
@media (min-height: 720px) and (max-width: 600px) {
  .main-area .project-actions a { min-height: 40px; }
  .work-footer-actions > :is(a, button) { min-height: 40px; }
}
@media (max-width: 600px) {
  .project-actions a { padding-inline: 6px; }
  .project-actions a > span:last-child { display: none; }
}
