/* ============================================
   Daniel Goldman — Personal Site
   Palette: warm stone, indigo, teal, amber
   Fonts: Playfair Display (headings), Inter (body)
   ============================================ */

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

:root {
  --bg:             #fafaf9;
  --bg-alt:         #f5f5f4;
  --bg-card:        #ffffff;
  --text:           #1c1917;
  --text-secondary: #44403c;
  --text-muted:     #78716c;
  --primary:        #4338ca;
  --primary-hover:  #3730a3;
  --primary-light:  #e0e7ff;
  --accent:         #0d9488;
  --accent-hover:   #0f766e;
  --accent-light:   #ccfbf1;
  --amber:          #d97706;
  --amber-light:    #fef3c7;
  --border:         #e7e5e4;
  --dark:           #1c1917;
  --dark-mid:       #292524;
  --white:          #ffffff;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --max-width:    1100px;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:    0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
}

html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text); line-height: 1.3; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--primary); color: var(--white);
  padding: .5rem 1rem; border-radius: var(--radius);
  z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: 1rem; color: var(--white); }

/* ---- Navigation ---- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
}

.nav__inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.nav__brand {
  font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700;
  color: var(--text);
}
.nav__brand:hover { color: var(--primary); }

.nav__toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: .5rem; color: var(--text);
}
.nav__toggle-icon {
  display: block; width: 22px; height: 2px; background: currentColor;
  position: relative;
}
.nav__toggle-icon::before,
.nav__toggle-icon::after {
  content: ''; display: block; width: 22px; height: 2px;
  background: currentColor; position: absolute; left: 0;
  transition: transform .2s;
}
.nav__toggle-icon::before { top: -7px; }
.nav__toggle-icon::after  { top:  7px; }

.nav__links { list-style: none; display: flex; gap: 1.75rem; }
.nav__links a {
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  letter-spacing: .01em; transition: color .2s;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--primary); }

/* ---- Hero (home only) ---- */
.hero {
  padding: 6rem 1.5rem 5rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(67,56,202,.10) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(13,148,136,.08) 0%, transparent 50%),
    var(--dark);
  color: var(--white);
  text-align: center;
}
.hero__inner { max-width: 740px; margin: 0 auto; }
.hero__label {
  font-size: .8rem; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: rgba(255,255,255,.45);
  margin-bottom: 1.25rem;
}
.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700; color: var(--white);
  margin-bottom: 1rem;
}
.hero__tagline {
  font-size: 1.15rem; color: rgba(255,255,255,.6);
  line-height: 1.7; margin-bottom: 2.5rem;
  max-width: 620px; margin-left: auto; margin-right: auto;
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---- Page Header (subpages) ---- */
.page-header {
  padding: 4.5rem 1.5rem 3rem;
  background: var(--dark);
  color: var(--white);
}
.page-header__inner { max-width: var(--max-width); margin: 0 auto; }
.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem); color: var(--white);
  margin-bottom: .75rem;
}
.page-header p {
  font-size: 1.05rem; color: rgba(255,255,255,.55);
  max-width: 600px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: .75rem 1.75rem;
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  border-radius: var(--radius); transition: all .2s;
  cursor: pointer; border: 2px solid transparent;
}
.btn--primary {
  background: var(--primary); color: var(--white); border-color: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-hover); border-color: var(--primary-hover);
  color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn--outline {
  background: transparent; color: var(--white);
  border-color: rgba(255,255,255,.3);
}
.btn--outline:hover {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.6);
  color: var(--white); transform: translateY(-1px);
}
.btn--outline-dark {
  background: transparent; color: var(--text); border-color: var(--border);
}
.btn--outline-dark:hover {
  border-color: var(--primary); color: var(--primary); transform: translateY(-1px);
}
.btn--accent {
  background: var(--accent); color: var(--white); border-color: var(--accent);
}
.btn--accent:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  color: var(--white); transform: translateY(-1px);
}

/* ---- Section System ---- */
.section { padding: 5rem 0; }
.section--light { background: var(--bg); }
.section--white { background: var(--white); }
.section--alt   { background: var(--bg-alt); }
.section--dark  { background: var(--dark); color: var(--white); }

.section__label {
  display: block; font-size: .8rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary); margin-bottom: .75rem;
}
.section--dark .section__label { color: var(--accent); }

.section h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-bottom: 1.5rem; }
.section--dark h2 { color: var(--white); }

.section__intro {
  font-size: 1.05rem; color: var(--text-secondary);
  max-width: 700px; margin-bottom: 2rem;
}

/* ---- Card Grid ---- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  transition: box-shadow .2s, transform .2s;
}
.section--alt .card,
.section--light .card { background: var(--white); }

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card__tag {
  display: inline-block; font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 4px; margin-bottom: .75rem;
}
.card__tag--teal   { background: var(--accent-light); color: var(--accent-hover); }
.card__tag--indigo { background: var(--primary-light); color: var(--primary); }
.card__tag--amber  { background: var(--amber-light);  color: var(--amber); }

.card h3 {
  font-family: var(--font-body); font-size: 1.05rem; font-weight: 700;
  margin-bottom: .5rem; color: var(--text);
}

.card p {
  font-size: .9rem; color: var(--text-secondary); line-height: 1.65;
}

.card__link {
  display: inline-block; margin-top: .75rem;
  font-size: .85rem; font-weight: 600; color: var(--primary);
}
.card__link:hover { color: var(--primary-hover); }
.card__link::after { content: ' →'; }

/* ---- Featured Card (large project) ---- */
.featured-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  margin-bottom: 2rem;
  transition: box-shadow .2s;
}
.featured-card:hover { box-shadow: var(--shadow-md); }
.featured-card h3 {
  font-family: var(--font-heading); font-size: 1.4rem;
  margin-bottom: .75rem;
}
.featured-card p { font-size: .95rem; color: var(--text-secondary); line-height: 1.7; }
.featured-card__meta {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem;
}
.featured-card__meta span {
  font-size: .75rem; font-weight: 600; padding: .3rem .7rem;
  border-radius: 4px; background: var(--bg-alt); color: var(--text-muted);
}

/* ---- Highlight Grid (home) ---- */
.highlight-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
}
.highlight {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  text-align: center; transition: box-shadow .2s, transform .2s;
}
.highlight:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.highlight__icon { font-size: 2rem; margin-bottom: .75rem; }
.highlight h3 {
  font-family: var(--font-body); font-size: .95rem; font-weight: 700;
  margin-bottom: .35rem;
}
.highlight p {
  font-size: .8rem; color: var(--text-muted); line-height: 1.5;
}

/* ---- Credentials ---- */
.credentials__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.credentials__col h3 {
  font-size: 1.1rem; margin-bottom: 1.25rem;
  padding-bottom: .75rem; border-bottom: 2px solid var(--primary-light);
}
.credentials__subheading { margin-top: 2rem; }
.credentials__list { list-style: none; }
.credentials__list li {
  padding: .75rem 0; border-bottom: 1px solid var(--border);
  font-size: .95rem; line-height: 1.5;
}
.credentials__list li:last-child { border-bottom: none; }
.credentials__list strong { display: block; color: var(--text); }
.credentials__institution {
  display: block; font-size: .85rem; color: var(--text-muted); margin-top: .15rem;
}

/* ---- Links Grid (contact) ---- */
.links-section { margin-bottom: 3rem; }
.links-section:last-child { margin-bottom: 0; }
.links-section h3 {
  font-size: 1.1rem; margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--border);
}
.links-grid { display: flex; flex-wrap: wrap; gap: .75rem; }
.link-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; font-weight: 500;
  color: var(--text); transition: all .2s;
}
.link-chip:hover {
  border-color: var(--primary); color: var(--primary);
  box-shadow: var(--shadow); transform: translateY(-1px);
}
.link-chip__handle { color: var(--text-muted); font-size: .85rem; }

/* ---- Research Profile Blocks ---- */
.research-profiles { display: flex; flex-wrap: wrap; gap: 1rem; }
.research-link {
  display: inline-block; padding: .875rem 1.5rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; font-weight: 600;
  color: var(--text); transition: all .2s;
}
.research-link:hover {
  border-color: var(--primary); color: var(--primary);
  box-shadow: var(--shadow); transform: translateY(-1px);
}

/* ---- Prose (about page) ---- */
.prose { max-width: 760px; }
.prose p { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 1.25rem; }
.prose strong { color: var(--text); }
.prose h3 { margin-top: 2.5rem; margin-bottom: 1rem; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: .5rem; }

/* ---- Stats Bar ---- */
.stats-bar { background: var(--dark-mid); padding: 3rem 0; }
.stats-bar__inner {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2rem; text-align: center;
}
.stat__number {
  display: block; font-family: var(--font-heading);
  font-size: 2.5rem; font-weight: 700; color: var(--white); line-height: 1.2;
}
.stat__label {
  display: block; font-size: .8rem; font-weight: 500;
  color: rgba(255,255,255,.4); text-transform: uppercase;
  letter-spacing: .1em; margin-top: .5rem;
}

/* ---- Publication List ---- */
.pub-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.pub-category h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: .75rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--accent-light);
  color: var(--accent-hover);
}
.pub-category ul { list-style: none; }
.pub-category li {
  padding: .5rem 0; font-size: .9rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.pub-category li:last-child { border-bottom: none; }

/* ---- Footer ---- */
.footer {
  background: var(--dark); color: rgba(255,255,255,.35);
  padding: 2rem 0; font-size: .85rem; text-align: center;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer a { color: rgba(255,255,255,.5); }
.footer a:hover { color: var(--white); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--white);
    padding: .5rem 1.5rem; box-shadow: var(--shadow-lg); gap: 0;
  }
  .nav__links--open { display: flex; }
  .nav__links a {
    color: var(--text) !important; padding: .75rem 0; display: block;
    border-bottom: 1px solid var(--border);
  }
  .nav__links li:last-child a { border-bottom: none; }

  .hero { padding: 5rem 1.5rem 4rem; }
  .page-header { padding: 3.5rem 1.5rem 2.5rem; }
  .section { padding: 3.5rem 0; }
  .stats-bar { padding: 2rem 0; }
  .stats-bar__inner { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .stat__number { font-size: 2rem; }
  .highlight-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid, .card-grid--2 { grid-template-columns: 1fr; }
  .credentials__grid { grid-template-columns: 1fr; gap: 2rem; }
  .featured-card { grid-template-columns: 1fr; gap: 1.5rem; }
  .pub-categories { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 260px; text-align: center; }
}

@media (max-width: 480px) {
  .stats-bar__inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .highlight-grid { grid-template-columns: 1fr; }
  .hero__name { font-size: 2.25rem; }
}
