/* ==========================================================================
   Shawn Agarwal — portfolio
   White ground, OU crimson as the only accent, one typeface.
   ========================================================================== */

:root {
  --ground: #ffffff;
  --surface: #ffffff;
  --panel: #1c1c1c;
  --panel-line: #333333;
  --ink: #1a1a1a;
  --muted: #555555;
  --muted-dim: #767676;
  --line: #e2e2e2;
  --line-soft: #ededed;
  --accent: #841617;
  --accent-tint: rgba(132, 22, 23, 0.07);
  --on-panel: #f2f2f2;
  --on-panel-muted: #a3a3a3;

  --sans:
    "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-lg: 10px;
  --r-md: 6px;
  --r-sm: 4px;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --bay: clamp(2.5rem, 5vw, 4rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell {
  width: min(1140px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--panel);
  color: var(--on-panel);
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* --- shared type ---------------------------------------------------------- */

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

.label-dim {
  color: var(--muted-dim);
}

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

.statement {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 60ch;
}

.hdr {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* --- nav ------------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--ground);
  border-bottom: 1px solid var(--line-soft);
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}

.nav-brand {
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--panel);
  color: var(--on-panel);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.95rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.72rem 1.3rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.btn-solid {
  background: var(--panel);
  color: var(--on-panel);
}

.btn-solid:hover {
  background: #333333;
}

.btn-quiet {
  background: #f0f0f0;
  color: var(--ink);
}

.btn-quiet:hover {
  background: #e6e6e6;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.btn-on-panel {
  background: var(--on-panel);
  color: var(--panel);
}

.btn-on-panel:hover {
  background: #fff;
}

/* --- hero ----------------------------------------------------------------- */

.hero {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
}

.hero-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  margin-top: 1.6rem;
}

.hero-body .lede {
  font-size: 1.08rem;
  max-width: 48ch;
}

/* No hero figure yet — don't leave a column-wide hole where it would go. */
.hero-body.is-textonly {
  grid-template-columns: 1fr;
}

.hero-body.is-textonly .lede {
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.hero-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-vitals span::after {
  content: " ·";
  color: var(--line);
}

.hero-vitals span:last-child::after {
  content: "";
}

/* --- figure (research images; removed by JS if the file is absent) -------- */

.figure {
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f2f2f2;
}

.figure figcaption {
  padding: 0.7rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

/* Diagrams must show whole, never centre-cropped like a photo. */
.figure img[src$=".svg"] {
  object-fit: contain;
  background: #fff;
}

.figure-tall img {
  aspect-ratio: 1 / 1;
}

/* Portrait sources (phone photos) — don't centre-crop them to a landscape box. */
.figure-portrait img {
  aspect-ratio: 3 / 4;
}

/* --- now strip ------------------------------------------------------------ */

.now {
  padding-block: 1rem clamp(1rem, 3vw, 2rem);
}

.now-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.now-item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0.5rem 0 0.25rem;
  letter-spacing: -0.01em;
}

.now-item p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* --- section scaffolding -------------------------------------------------- */

.bay {
  padding-block: var(--bay);
}

.bay-tight {
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
}

.bay-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

/* --- research ------------------------------------------------------------- */

.research-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
  margin-top: 1.75rem;
}

.prose p + p {
  margin-top: 1rem;
}

.prose p {
  color: var(--muted);
  max-width: 56ch;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

/* --- dark panel ----------------------------------------------------------- */

.panel {
  background: var(--panel);
  color: var(--on-panel);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
}

.panel h3 {
  font-size: 1rem;
  color: var(--on-panel);
  font-weight: 600;
  margin-bottom: 1.15rem;
}

.stack-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0.85rem 0;
  border-top: 1px solid var(--panel-line);
}

.stack-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.stack-row:last-child {
  padding-bottom: 0;
}

.stack-row .n {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--accent);
  padding-top: 0.15rem;
}

.stack-row b {
  display: block;
  font-weight: 500;
  font-size: 0.98rem;
}

.stack-row span {
  color: var(--on-panel-muted);
  font-size: 0.87rem;
}

/* --- work cards (image + caption bar) ------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* Cards size to their own content. Stretching them means a card whose
     image slot is still empty becomes a tall box of white. */
  align-items: start;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: #bdbdbd;
}

.card-art {
  aspect-ratio: 16 / 10;
  background: #f2f2f2;
  object-fit: cover;
  width: 100%;
  border-bottom: 1px solid var(--line-soft);
}

.card-body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.card-body h3 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-body p {
  color: var(--muted);
  font-size: 0.93rem;
}

.card-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted-dim);
  padding-top: 0.5rem;
}

.card-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: underline;
}

/* --- numbered work rows --------------------------------------------------- */

.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  gap: 0;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.18s ease;
}

.row:hover h3 {
  color: var(--accent);
}

.row-n {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--accent);
  padding-top: 0.3rem;
}

.row-main h3 {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.row-role {
  font-size: 0.88rem;
  color: var(--muted-dim);
  margin-top: 0.1rem;
}

.row-main p {
  color: var(--muted);
  max-width: 62ch;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.row-stack {
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
}

.row-go {
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--accent);
  white-space: nowrap;
}

/* --- also built ----------------------------------------------------------- */

.also {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.5rem;
  border-top: 1px solid var(--line);
  margin-top: 2.75rem;
}

.also-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}

.also-item:hover h4 {
  color: var(--accent);
}

.also-item h4 {
  font-size: 0.98rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.also-item p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: -0.25rem;
}

.also-item span {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
  white-space: nowrap;
}

/* --- experience ----------------------------------------------------------- */

.xp {
  border-top: 1px solid var(--line);
}

.xp-item {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.xp-when {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
  padding-top: 0.3rem;
}

.xp-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.xp-org {
  font-size: 0.92rem;
  color: var(--muted-dim);
  margin-bottom: 0.4rem;
}

.xp-item ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.xp-item li {
  position: relative;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 68ch;
}

.xp-item li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 1px;
  background: var(--accent);
}

/* --- skills --------------------------------------------------------------- */

.skills {
  border-top: 1px solid var(--line);
}

.skill-row {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}

.skill-row dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.skill-row dd {
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- education ------------------------------------------------------------ */

.edu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--panel-line);
  margin-bottom: 1.5rem;
}

.edu-head h3 {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--on-panel);
  letter-spacing: -0.015em;
  text-transform: none;
  margin: 0;
}

.edu-head > div p {
  color: var(--on-panel-muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.edu-gpa {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1;
  color: var(--on-panel);
  white-space: nowrap;
}

.edu-gpa small {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--on-panel-muted);
  display: block;
  margin-top: 0.45rem;
}

.course-row {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--panel-line);
}

.course-row > dt {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--on-panel-muted);
  padding-top: 0.15rem;
}

.course-row > dd {
  color: var(--on-panel);
  font-size: 0.93rem;
  line-height: 1.6;
}

.course-row .later {
  display: block;
  color: var(--on-panel-muted);
  margin-top: 0.3rem;
}

.course-row .later b {
  font-size: 0.9rem;
  color: var(--on-panel);
  font-weight: 600;
  margin-right: 0.4rem;
}

.course-row em {
  font-style: normal;
}

/* --- awards --------------------------------------------------------------- */

.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3.5rem);
}

.listing {
  list-style: none;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}

.listing li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.94rem;
}

.listing li b {
  color: var(--ink);
  font-weight: 600;
}

/* --- contact -------------------------------------------------------------- */

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.contact-panel .statement {
  color: var(--on-panel);
}

.contact-panel .label {
  color: var(--on-panel-muted);
}

.contact-list {
  display: grid;
}

.contact-list a,
.contact-list div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--panel-line);
  text-decoration: none;
  color: var(--on-panel);
}

.contact-list a:first-child,
.contact-list div:first-child {
  border-top: 1px solid var(--panel-line);
}

.contact-list a:hover .cv {
  color: var(--accent);
}

.contact-list .ck {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--on-panel-muted);
}

.contact-list .cv {
  word-break: break-word;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

/* --- footer --------------------------------------------------------------- */

.footer {
  padding-block: 2rem 2.75rem;
  border-top: 1px solid var(--line);
}

.footer-in {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted-dim);
}

.footer-in a {
  color: inherit;
  text-decoration: none;
}

.footer-in a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Case-study pages
   ========================================================================== */

.case {
  padding-block: 2.5rem clamp(3.5rem, 8vw, 6rem);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
}

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

.case-shell {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.case-head {
  display: grid;
  gap: 1rem;
  max-width: 70ch;
}

.case-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  align-items: baseline;
}

.case-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.case-intro {
  color: var(--muted);
  font-size: 1.08rem;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.case-note {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 1.3rem;
  border-radius: 6px;
  background: #f0f0f0;
  color: var(--muted);
  font-size: 0.88rem;
}

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.case-main {
  display: grid;
  gap: 2.5rem;
  min-width: 0;
}

.block {
  display: grid;
  gap: 0.85rem;
}

.block > h2 {
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 600;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.block p {
  color: var(--muted);
  max-width: 68ch;
}

.block p + p {
  margin-top: -0.2rem;
}

.block ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.block li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--muted);
  max-width: 68ch;
}

.block li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}

.block li b,
.block p b {
  color: var(--ink);
  font-weight: 600;
}

.block code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--accent-tint);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.caveat {
  border-left: 2px solid var(--line);
  padding: 0.15rem 0 0.15rem 1rem;
  color: var(--muted-dim);
  font-size: 0.92rem;
  max-width: 66ch;
}

.case-side {
  display: grid;
  gap: 1.5rem;
  position: sticky;
  top: 5rem;
}

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

.spec h3 {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 1rem;
}

.spec-row {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

.spec-row:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.spec-k {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted-dim);
}

.spec-v {
  font-size: 0.94rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.24rem 0.6rem;
  background: var(--surface);
}

.case-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  align-items: start;
  gap: 1.25rem;
}

.case-media .figure img {
  aspect-ratio: 4 / 3;
}

.case-media .figure-portrait {
  /* A tall photo alone in the grid would otherwise fill the whole column. */
  max-width: 420px;
}

.case-media .figure-portrait img {
  aspect-ratio: 3 / 4;
}

.case-missing {
  display: grid;
  gap: 0.75rem;
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  text-align: center;
}

/* --- Altium / KiCad viewer ------------------------------------------------ */

.viewer-section {
  display: grid;
  gap: 1rem;
}

.viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.viewer-head h2 {
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 600;
}

.viewer-head p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.45rem;
  max-width: 58ch;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.viewer-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.viewer-embed-shell {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #eeeeee;
}

.viewer-live-surface {
  position: relative;
  z-index: 1;
}

.viewer-embed-target,
.viewer-live-surface iframe,
.viewer-frame {
  display: block;
  width: 100%;
  border: 0;
  background: #eeeeee;
}

.viewer-embed-target {
  position: relative;
  min-height: 360px;
}

.viewer-embed-target > a {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.viewer-frame {
  min-height: 420px;
}

.viewer-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  background: rgba(255, 255, 255, 0.96);
}

.viewer-embed-shell.show-fallback .viewer-fallback,
.viewer-embed-shell.fallback-only .viewer-fallback {
  opacity: 1;
  pointer-events: auto;
}

.viewer-embed-shell.is-loaded .viewer-fallback {
  opacity: 0;
  pointer-events: none;
}

.viewer-fallback-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f2f2f2;
  border-right: 1px solid var(--line);
}

.viewer-fallback-copy {
  display: grid;
  align-content: center;
  gap: 0.5rem;
  padding: 1.25rem;
}

.viewer-fallback-copy strong {
  font-size: 1.02rem;
}

.viewer-note {
  color: var(--muted-dim);
  font-size: 0.85rem;
}

.viewer-note code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .hero-body,
  .research-split,
  .case-grid,
  .contact-panel,
  .two-up {
    grid-template-columns: 1fr;
  }

  .hero-body {
    align-items: start;
  }

  .now-grid,
  .cards,
  .also {
    grid-template-columns: 1fr;
  }

  .case-side {
    position: static;
  }

  .edu-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1rem;
  }

  .viewer-fallback {
    grid-template-columns: 1fr;
  }

  .viewer-fallback-image {
    min-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .nav-in {
    height: 56px;
    gap: 0.75rem;
  }

  .nav-links {
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-right: 0.25rem;
  }

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

  .nav-links a {
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .nav-brand {
    font-size: 0.95rem;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .xp-item,
  .skill-row,
  .course-row,
  .contact-list a,
  .contact-list div {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .xp-when {
    padding-top: 0;
  }

  .also-item {
    grid-template-columns: 1fr;
  }

  .also-item span {
    grid-row: 3;
  }
}

@media (max-width: 420px) {
  .nav-cta {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

}

@media print {
  .nav,
  .footer,
  .viewer-section {
    display: none;
  }

  body {
    background: #fff;
  }

  .panel {
    background: #fff;
    color: #000;
    border: 1px solid #ccc;
  }
}
