/* =========================================
   SAMUEL OSTROFF — Personal Website
   Minimalist edition
   Palette: Deep forest · Slate · Warm ivory · Amber
   ========================================= */

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --forest:       #2c3e35;
  --forest-deep:  #1a2620;
  --forest-mid:   #3a5048;
  --slate-light:  #8fa3b8;
  --stone:        #8a8a7e;
  --ivory:        #f4f0e8;
  --ivory-deep:   #e8e2d6;
  --ink:          #1c1c1a;
  --ink-soft:     #3a3835;
  --gold:         #c4a558;
  --gold-light:   #d4b878;

  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'Inter', system-ui, sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;

  --container:    1060px;
  --section-v:    120px;
  --radius:       3px;
  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.15rem; font-weight: 500; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.btn-primary {
  background: var(--gold);
  color: var(--forest-deep);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(244,240,232,0.4);
}
.btn-ghost:hover {
  border-color: var(--ivory);
  transform: translateY(-1px);
}

/* ---- SECTION LABEL ---- */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.section-header { margin-bottom: 72px; }
.section-header h2 { max-width: 560px; }
.section-header.light .section-label { color: var(--gold-light); }
.section-header.light h2 { color: var(--ivory); }

/* ========================================
   NAVIGATION
   ======================================== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background 0.3s var(--ease);
}
#navbar.scrolled {
  background: rgba(26, 38, 32, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ivory);
  letter-spacing: 0.02em;
}
.nav-logo:hover { color: var(--gold-light); }

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244,240,232,0.7);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ivory); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ivory);
  transition: all 0.25s;
}

/* ========================================
   HERO
   ======================================== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--forest-deep);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(74,90,107,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(42,80,72,0.3) 0%, transparent 50%),
    linear-gradient(160deg, #1a2620 0%, #2c3e35 40%, #1e3028 100%);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244,240,232,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,240,232,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: 100px 40px 80px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 64px;
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-block;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(196, 165, 88, 0.25);
  margin-bottom: 28px;
}

.hero-content h1 {
  color: var(--ivory);
  margin-bottom: 20px;
  font-weight: 300;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 28px;
}

.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(244,240,232,0.65);
  max-width: 480px;
  margin-bottom: 44px;
  line-height: 1.65;
}

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-portrait { display: flex; justify-content: center; align-items: center; }

.portrait-frame {
  position: relative;
  width: 340px;
}

.portrait-svg,
.portrait-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(196,165,88,0.2),
    0 20px 60px rgba(0,0,0,0.4);
}

.portrait-photo {
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.portrait-frame::before,
.portrait-frame::after {
  display: none;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.hero-scroll-indicator span {
  display: block;
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, rgba(196,165,88,0.55));
  margin: 0 auto;
  animation: scrollDrop 1.8s ease-in-out infinite;
}

@keyframes scrollDrop {
  0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50%  { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* ========================================
   ABOUT
   ======================================== */
#about {
  padding: var(--section-v) 0;
}

.about-minimal {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.about-bio .lead {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 20px;
}

.about-bio p {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.85;
  max-width: 680px;
}

/* Stats row */
.about-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--ivory-deep);
  border-bottom: 1px solid var(--ivory-deep);
  padding: 40px 0;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 40px;
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child { padding-right: 0; }

.stat-num {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 300;
  color: var(--forest);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--ivory-deep);
  flex-shrink: 0;
}

/* ========================================
   EXPERIENCE
   ======================================== */
#experience {
  padding: var(--section-v) 0;
  background: var(--forest-deep);
}

.timeline {
  position: relative;
  padding-left: 48px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--gold), rgba(196,165,88,0.08));
}

.timeline-item {
  position: relative;
  margin-bottom: 60px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -45px; top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--forest-deep);
  transition: background 0.2s;
}
.timeline-item:hover .timeline-marker { background: var(--gold); }

.timeline-date {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.timeline-content h3 {
  color: var(--ivory);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.timeline-org {
  font-size: 0.78rem;
  color: var(--slate-light);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.timeline-content ul li {
  position: relative;
  padding-left: 16px;
  font-size: 0.88rem;
  color: rgba(244,240,232,0.68);
  margin-bottom: 10px;
  line-height: 1.7;
}
.timeline-content ul li:last-child { margin-bottom: 0; }
.timeline-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  opacity: 0.5;
}
.timeline-content em { color: rgba(244,240,232,0.88); }

/* ========================================
   EDUCATION
   ======================================== */
#education {
  padding: var(--section-v) 0;
  background: var(--ivory);
}

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.edu-row {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  align-items: baseline;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--ivory-deep);
  transition: padding-left 0.2s var(--ease);
}
.edu-row:first-child { border-top: 1px solid var(--ivory-deep); }
.edu-row:hover { padding-left: 12px; }

.edu-year {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--stone);
  letter-spacing: 0.01em;
}

.edu-degree {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.edu-school {
  font-size: 0.8rem;
  color: var(--stone);
  letter-spacing: 0.02em;
}

/* ========================================
   PUBLICATIONS
   ======================================== */
#publications {
  padding: var(--section-v) 0;
  background: var(--ivory);
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-bottom: 56px;
  border: 1px solid var(--ivory-deep);
}

.pub-card {
  padding: 40px 36px;
  border: 1px solid var(--ivory-deep);
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
  position: relative;
}

.pub-card:hover {
  background: #fff;
  z-index: 1;
  box-shadow: 0 8px 40px rgba(44, 62, 53, 0.08);
}

.pub-genre {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-block;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  flex-grow: 1;
}

.pub-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--stone);
  line-height: 1.6;
  margin-bottom: 0;
}

.pub-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 0;
}

.pub-link {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--ivory-deep);
  transition: color 0.2s, border-color 0.2s;
}

.pub-link:hover {
  color: var(--gold);
  border-color: var(--gold-light);
}

.pub-footnote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--stone);
  text-align: center;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

/* Responsive publications */
@media (max-width: 960px) {
  .pub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .pub-grid {
    grid-template-columns: 1fr;
  }
  .pub-card {
    padding: 32px 24px;
  }
}

/* ========================================
   CONTACT
   ======================================== */
#contact {
  padding: var(--section-v) 0;
  background: var(--forest-deep);
}

.contact-minimal {
  max-width: 560px;
}

.contact-minimal .section-label {
  color: var(--gold-light);
}

.contact-minimal h2 {
  color: var(--ivory);
  margin-bottom: 20px;
}

.contact-minimal p {
  font-size: 0.95rem;
  color: rgba(244,240,232,0.6);
  line-height: 1.8;
  margin-bottom: 44px;
}

.contact-links-minimal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: rgba(244,240,232,0.75);
  transition: color 0.2s;
}
.contact-link:hover { color: var(--gold-light); }
.contact-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.contact-link:hover svg { opacity: 0.9; }

/* ========================================
   FOOTER
   ======================================== */
#footer {
  background: var(--forest-deep);
  padding: 56px 0 28px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ivory);
  margin-bottom: 5px;
}

.footer-tagline {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(244,240,232,0.35);
  margin-bottom: 3px;
}

.footer-location {
  font-size: 0.7rem;
  color: rgba(244,240,232,0.25);
}

.footer-nav {
  display: flex;
  gap: 28px;
}

.footer-nav a {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244,240,232,0.4);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--gold-light); }

.footer-bottom p {
  font-size: 0.68rem;
  color: rgba(244,240,232,0.18);
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: left;
  }
  .hero-portrait {
    order: -1;
    justify-content: flex-start;
  }
  .portrait-frame { width: 260px; }

  .edu-row {
    grid-template-columns: 56px 1fr;
    gap: 20px;
  }
  .edu-school {
    grid-column: 2;
    margin-top: -8px;
  }
}

@media (max-width: 768px) {
  :root { --section-v: 80px; }

  .container { padding: 0 24px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: rgba(26,38,32,0.98);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .hero-content { padding: 100px 24px 60px; }

  .about-stats-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    padding: 32px 0;
  }
  .stat-item { padding: 0; }
  .stat-divider {
    width: 40px; height: 1px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 28px;
  }
  .footer-nav { flex-wrap: wrap; gap: 16px; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .edu-row { grid-template-columns: 1fr; gap: 6px; }
  .edu-year { font-size: 1rem; }
}
