/* ===================================================
   Dominic Oddo — Personal Academic Site
   Accent: teal-indigo (#2a7d8c / #1e5f6b dark)
   Surface: warm off-white / deep navy-black
   =================================================== */

:root {
  --bg:          #f4f7f6;
  --surface:     #ffffff;
  --surface-alt: #eaf0ef;
  --text:        #111b1a;
  --text-subtle: #546260;
  --muted:       #d4e0de;
  --border:      rgba(17, 27, 26, 0.08);
  --accent:      #2a7d8c;
  --accent-rgb:  42, 125, 140;
  --accent-soft: rgba(42, 125, 140, 0.15);
  --shadow:      0 20px 44px rgba(17, 27, 26, 0.07);
  --radius-lg:   28px;
  --radius-md:   18px;
  --container:   1100px;
}
:root.dark {
  --bg:          #060d0c;
  --surface:     #0e1a18;
  --surface-alt: #172422;
  --text:        #e4eeed;
  --text-subtle: #8aa8a5;
  --muted:       rgba(255, 255, 255, 0.07);
  --border:      rgba(255, 255, 255, 0.05);
  --accent:      #5bbece;
  --accent-rgb:  91, 190, 206;
  --accent-soft: rgba(91, 190, 206, 0.14);
  --shadow:      0 24px 48px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px / 1.65 "Inter", ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.35s ease, color 0.35s ease;
  padding-top: 118px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .8; }
p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; display: block; }
.muted { color: var(--text-subtle); font-size: .9rem; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem 0;
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(var(--container), calc(100% - 1rem));
  padding: .65rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface) 78%, transparent) 0%,
    color-mix(in srgb, var(--surface-alt) 72%, transparent) 100%
  );
  box-shadow: 0 16px 36px rgba(17, 27, 26, 0.09);
  backdrop-filter: saturate(1.4) blur(18px);
  transition: background .3s, border-color .3s;
}

/* Monogram brand */
.brand { text-decoration: none; }
.monogram {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #1b2e2c));
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .06em;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.brand:hover .monogram {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(var(--accent-rgb), 0.38);
  opacity: 1;
}

.nav { display: flex; align-items: center; gap: .65rem; flex: 1; flex-wrap: wrap; }
.nav a {
  position: relative;
  padding: .4rem .85rem;
  border-radius: 999px;
  color: var(--text-subtle);
  font-weight: 500;
  font-size: .95rem;
  transition: color .2s, background .2s, box-shadow .2s;
}
.nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
  opacity: 1;
}
.nav a.active {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.11);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  font-size: 1.15rem;
  cursor: pointer;
  padding: .4rem;
  transition: color .2s;
}
.theme-toggle:hover { color: var(--accent); }

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 2.4rem;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto 4rem;
  padding: 3.8rem 1.5rem 3.2rem;
  background:
    radial-gradient(circle at top left,  rgba(var(--accent-rgb), 0.14), transparent 52%),
    radial-gradient(circle at bottom right, rgba(64, 190, 160, 0.14), transparent 44%),
    var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.hero-media { display: flex; justify-content: center; }
.avatar {
  width: 210px; height: 210px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 52px rgba(17, 27, 26, 0.13);
}
.eyebrow {
  display: inline-block;
  font-size: .82rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
}
.hero-content h1 {
  font-size: 3.2rem;
  margin: .35rem 0 .55rem;
  line-height: 1.05;
}
.hero-name {
  display: block;
  font-weight: 800;
  color: var(--text);
}
.hero-content > p {
  margin: 0 0 1.6rem;
  font-size: 1.06rem;
  color: var(--text-subtle);
  max-width: 42rem;
}
.hero-meta {
  margin: 0 0 1.7rem;
  display: flex;
  gap: .7rem 1.3rem;
  flex-wrap: wrap;
  align-items: center;
}
.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  color: var(--text-subtle);
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.2;
}
.hero-meta-item svg {
  width: 1rem; height: 1rem;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
a.hero-meta-item { color: var(--text-subtle); }
a.hero-meta-item:hover { color: var(--accent); opacity: 1; }

.profile-links {
  display: flex;
  gap: .85rem;
  margin-bottom: 1.7rem;
  font-size: 1.2rem;
}
.profile-links a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: 0 8px 16px rgba(17, 27, 26, 0.07);
  color: var(--text-subtle);
  transition: transform .2s, box-shadow .2s, color .2s;
}
.profile-links a:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  opacity: 1;
}
.cta-group {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(var(--accent-rgb), 0.3);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(var(--accent-rgb), 0.36);
  opacity: 1;
}
.btn.ghost {
  background: transparent;
  border-color: var(--accent-soft);
  color: var(--text);
}
.btn.ghost:hover { background: var(--accent-soft); opacity: 1; }

/* ===== Sections ===== */
.section {
  max-width: var(--container);
  margin: 2.2rem auto 1.5rem;
  padding: 0 1.5rem;
  scroll-margin-top: 136px;
}

/* About section gradient backing */
.about-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: 1.8rem;
  padding-bottom: 2rem;
  border-radius: var(--radius-lg);
}
.about-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 20%, rgba(var(--accent-rgb), 0.12), transparent 36%),
    radial-gradient(circle at 90% 80%, rgba(64, 190, 160, 0.1), transparent 30%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 94%, transparent),
      color-mix(in srgb, var(--surface-alt) 84%, transparent));
  z-index: 0;
}
.about-section > * { position: relative; z-index: 1; }

.section-heading { margin-bottom: .9rem; }
.label {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  background: var(--surface-alt);
  color: var(--text-subtle);
  padding: .18rem .7rem;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: .18rem;
}
.section-heading h2 {
  font-size: 2.3rem;
  margin: .3rem 0 .2rem;
}
.section-heading p { color: var(--text-subtle); margin: 0; }

.inline-highlight {
  padding: .04rem .42rem;
  border-radius: .45rem;
  background: rgba(var(--accent-rgb), 0.1);
  color: color-mix(in srgb, var(--accent) 70%, var(--text) 30%);
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.section-grid {
  display: grid;
  gap: 1.7rem;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1.2rem;
}
@media (min-width: 900px) {
  .section-grid { grid-template-columns: 1.15fr .9fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.panel.accent {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.07), transparent);
}
.panel h3 {
  margin: 0 0 .85rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.panel-icon { color: var(--accent); font-size: 1rem; }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.3rem;
  color: var(--text-subtle);
}
.checklist li {
  position: relative;
  padding-left: 1.55rem;
  margin-bottom: .55rem;
}
.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0; top: 0;
  color: var(--accent);
  font-weight: 700;
}
.checklist-highlight li::before {
  content: "\2605";   /* star for awards */
  color: #d97706;
}

/* ===== Feature grid (Research) ===== */
.feature-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  margin-top: 1.4rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 40px rgba(17, 27, 26, 0.12);
  border-color: rgba(var(--accent-rgb), 0.2);
}
.feature-media {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.feature-media-frame { overflow: hidden; }
.feature-media img {
  display: block;
  width: 100%; height: auto;
  transition: transform .35s;
}
.feature-card:hover .feature-media img { transform: scale(1.04); }
.feature-body {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: 1.8rem 1.9rem 1.9rem;
  flex: 1;
}
.feature-body h3 { margin: 0; font-size: 1.08rem; }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0; margin: 0;
  color: var(--text-subtle);
}
.tag-list li {
  padding: .3rem .72rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.tag-list li:nth-child(3n+1) { background: #d1faf5; color: #0d5e55; border-color: #a7f3e8; }
.tag-list li:nth-child(3n+2) { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.tag-list li:nth-child(3n)   { background: #fef3c7; color: #92400e; border-color: #fde68a; }

.feature-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: auto; }
.feature-links a {
  font-weight: 600;
  color: var(--text);
  position: relative;
}
.feature-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .2s;
}
.feature-links a:hover::after { transform: scaleX(1); }
.feature-links a:hover { opacity: 1; }

/* ===== Community section ===== */
.community-section .section-grid { margin-top: 1.2rem; }
.community-section .panel p { color: var(--text-subtle); }

/* ===== CV — Timeline ===== */
.timeline {
  margin: 2.4rem 0 2.8rem;
  padding: 2rem clamp(1.2rem, 4vw, 2.8rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg,
    rgba(var(--accent-rgb), 0.09),
    rgba(var(--accent-rgb), 0.02));
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  box-shadow: 0 18px 44px rgba(15, 18, 21, 0.07);
}
.resume-timeline {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3rem minmax(0, 1fr);
  gap: .85rem 0;
  align-items: start;
}
.resume-timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(var(--accent-rgb), 0.18);
}
.resume-item {
  position: relative;
  grid-row: var(--resume-row, auto);
  padding: .95rem 1.05rem 1rem;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  box-shadow: 0 12px 26px rgba(15, 18, 21, 0.08);
}
.resume-item::before {
  content: "";
  position: absolute;
  top: 1rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.1);
}
.resume-item.education,
.resume-item.main {
  grid-column: 1;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.03));
}
.resume-item.education::before,
.resume-item.main::before {
  left: auto;
  right: calc(-1.5rem - 6px);
}
.resume-item.role {
  grid-column: 3;
}
.resume-item.role::before {
  left: calc(-1.5rem - 6px);
  border-color: color-mix(in srgb, var(--accent) 55%, #d97706 45%);
}

.resume-date,
.resume-kind {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  border-radius: 999px;
  padding: .1rem .65rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.resume-date {
  margin-right: .45rem;
  background: rgba(17, 27, 26, 0.06);
  color: var(--text-subtle);
}
.resume-kind {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}
.resume-item.role .resume-kind {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}
.resume-item h4 { margin: .45rem 0 .35rem; font-size: 1rem; }
.resume-item p {
  margin: .15rem 0 0;
  color: var(--text-subtle);
  font-size: .92rem;
  line-height: 1.5;
}
.resume-item .muted { display: block; font-size: .82rem; margin-top: .25rem; }

/* ===== CV expandable panels ===== */
.cv-panels { display: grid; gap: .9rem; }
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.35rem;
  box-shadow: var(--shadow);
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
}
details[open] summary { margin-bottom: .75rem; }
details ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-subtle);
}
details ul li { margin: .42rem 0; }
.pub-list { padding-left: 1rem; }

/* ===== Contact ===== */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}
.contact-card p { margin: 0; color: var(--text-subtle); }
.contact-card strong { color: var(--text); }

/* ===== Footer ===== */
.site-footer {
  padding: 2rem 1.5rem 2.6rem;
  text-align: center;
  color: var(--text-subtle);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 92%, transparent),
    color-mix(in srgb, var(--surface-alt) 84%, transparent));
  font-size: .9rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .55rem;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-media { order: -1; }
  .hero-content h1 { font-size: 2.8rem; justify-content: center; }
  .hero-meta  { justify-content: center; }
  .profile-links { justify-content: center; }
  .cta-group  { justify-content: center; }
}
@media (max-width: 900px) {
  .timeline { padding: 1.4rem 1.1rem; }
  .resume-timeline {
    grid-template-columns: minmax(0, 1fr);
    gap: .9rem;
    padding-left: 1.3rem;
  }
  .resume-timeline::before { left: 0; transform: none; }
  .resume-item.education,
  .resume-item.role,
  .resume-item.main { grid-column: 1; grid-row: auto; }
  .resume-item.education::before,
  .resume-item.role::before,
  .resume-item.main::before {
    left: calc(-1.3rem - 7px);
    right: auto;
  }
}
@media (max-width: 540px) {
  body { padding-top: 104px; }
  .site-header { padding: .55rem .75rem 0; }
  .site-header-inner {
    width: 100%;
    justify-content: space-between;
    padding: .55rem .75rem;
    gap: .5rem;
  }
  .nav { display: none; }
  .hero { margin: 0 auto 2rem; padding: 2.6rem 1.1rem; }
  .section { margin: 2rem auto 1.4rem; padding: 0 1.1rem; }
  .section-heading h2 { font-size: 1.9rem; }
}
@media (min-width: 541px) and (max-width: 700px) {
  body { padding-top: 148px; }
  .site-header { padding: .7rem .9rem 0; }
  .site-header-inner {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: .6rem .85rem;
  }
  .nav {
    order: 3;
    flex: 0 0 100%;
    justify-content: center;
    gap: .4rem;
  }
  .nav a { padding: .38rem .75rem; font-size: .92rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
