:root { --hn-radius: 12px; }

/* Custom palette: graphite/steel primary + oxidized-copper accent
   (in place of the generic Material "blue grey / deep orange" default) */
:root, [data-md-color-scheme="default"] {
  --md-primary-fg-color: #2F3B42;
  --md-primary-fg-color--light: #46565F;
  --md-primary-fg-color--dark: #1C2428;
  --md-primary-bg-color: #FFFFFF;
  --md-accent-fg-color: #B5651D;
  --md-accent-fg-color--transparent: rgba(181, 101, 29, .12);
  --md-typeset-a-color: #2F3B42;
}
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #12181B;
  --md-primary-fg-color--light: #1E262A;
  --md-primary-fg-color--dark: #090C0E;
  --md-accent-fg-color: #D98A4A;
  --md-accent-fg-color--transparent: rgba(217, 138, 74, .18);
  --md-typeset-a-color: #D98A4A;
}

/* Header / layout */
.md-header { box-shadow: 0 1px 10px rgba(0,0,0,.08); }
.md-tabs { border-bottom: 1px solid rgba(127,127,127,.15); }
.md-main__inner { max-width: 1280px; }
.md-content h1 { font-weight: 750; letter-spacing: -.025em; }
.md-content h2 { font-weight: 700; margin-top: 2em; }
.md-button { border-radius: 8px; font-weight: 650; margin: .25rem .25rem .25rem 0; }
.md-typeset .admonition, .md-typeset details { border-radius: var(--hn-radius); }
/* Targets standard paragraphs in the main content container */
.md-content p {
    text-align: justify;
}

/* Homepage hero (with portrait) — background is a faded still from the
   research archive rather than a generic decorative gradient */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 3rem;
  align-items: center;
  padding: 3.2rem 2.5rem 3rem;
  margin: -1rem 0 2.5rem;
  border-radius: 0 0 18px 18px;
  border-bottom: 1px solid rgba(127,127,127,.18);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../research/Gallery/images/image2_orig.gif");
  background-size: cover;
  background-position: center 35%;
  filter: grayscale(1) contrast(1.35);
  opacity: .4;
}
[data-md-color-scheme="slate"] .hero::before { opacity: .16; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(175deg, rgba(255,255,255,.6), rgba(255,255,255,.9));
}
[data-md-color-scheme="slate"] .hero::after {
  background: linear-gradient(175deg, rgba(9,12,14,.55), rgba(9,12,14,.85));
}
.hero-content, .hero-photo { position: relative; z-index: 1; min-width: 0; }
.hero-kicker { font-size: .95rem; font-weight: 650; opacity: .7; }
.hero h1 {
  font-size: clamp(2.55rem, 3.4vw, 3.15rem);
  line-height: 1.06;
  margin: .35rem 0 .8rem;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.hero h2 { font-size: clamp(1.05rem, 2vw, 1.45rem); font-weight: 500; opacity: .82; margin: 0 0 1.25rem; }
.hero p { max-width: 760px; font-size: 1.08rem; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.5rem; }
.hero-actions .md-button { margin: 0; }

.hero-photo {
  width: 310px;
  justify-self: end;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(127,127,127,.22);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  background: #fff;
}
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }

@media screen and (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; }
  .hero-photo { width: 270px; }
}
@media screen and (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { white-space: normal; font-size: clamp(2.2rem, 9vw, 2.9rem); }
  .hero-photo { width: min(260px, 70vw); justify-self: start; order: -1; }
}




/* ============================================================
   Hero buttons — dark mode contrast fix
   ============================================================ */

.hero-actions .md-button:not(.md-button--primary) {
  color: var(--md-accent-fg-color) !important;
  border-color: var(--md-accent-fg-color);
  background: rgba(9, 12, 14, .18);
}

.hero-actions .md-button:not(.md-button--primary):hover {
  color: #fff !important;
  background: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

.hero-actions .md-button--primary {
  color: #fff !important;
}


/* "The intersection" card grid on homepage */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.25rem 0 2rem; }
.hn-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid rgba(127,127,127,.2);
  border-radius: var(--hn-radius);
  background: rgba(127,127,127,.035);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none !important;
  color: inherit !important;
}
.hn-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.09); border-color: var(--md-accent-fg-color); }
.hn-card strong { display: block; font-size: 1.05rem; margin: .35rem 0 .3rem; }
.hn-card > span:last-child { opacity: .78; font-size: .92rem; line-height: 1.55; }
.card-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--md-accent-fg-color); }
.card-icon svg { width: 1.6em; height: 1.6em; fill: currentColor; }

/* Research card is the strongest identity — give it the top full-width slot */
.hn-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 1.5rem;
  padding: 1.75rem 2rem;
}
.hn-card--featured .card-icon { grid-row: 1 / 3; }
.hn-card--featured .card-icon svg { width: 2.2em; height: 2.2em; }
.hn-card--featured strong { grid-column: 2; grid-row: 1; font-size: 1.2rem; margin: 0 0 .3rem; }
.hn-card--featured > span:last-child { grid-column: 2; grid-row: 2; }
@media screen and (max-width: 560px) {
  .hn-card--featured { grid-template-columns: 1fr; row-gap: .5rem; }
  .hn-card--featured .card-icon { grid-row: 1; grid-column: 1; }
  .hn-card--featured strong, .hn-card--featured > span:last-child { grid-column: 1; }
}

/* Tech chip strip */
.tech-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 2rem; }
.tech { padding: .28rem .62rem; border: 1px solid rgba(127,127,127,.22); border-radius: 999px; font-size: .78rem; font-weight: 650; }

/* Featured research image on homepage */
.research-feature { border-radius: var(--hn-radius); overflow: hidden; border: 1px solid rgba(127,127,127,.2); margin: 1rem 0 2rem; }
.research-feature img { width: 100%; max-height: 470px; object-fit: contain; display: block; background: rgba(127,127,127,.04); }
.research-feature figcaption { padding: .8rem 1rem; font-size: .84rem; opacity: .75; }

/* CV page PDF embed */
.cv-embed {
  width: 100%;
  height: min(1100px, 82vh);
  min-height: 760px;
  border: 1px solid rgba(127,127,127,.22);
  border-radius: 12px;
  background: #fff;
  display: block;
}
