/* ─────────────────────────────────────────
   micahberman.com — stylesheet
   ───────────────────────────────────────── */

:root {
  --bg:          #ffffff;
  --bg-card:     #f7f5f2;
  --text:        #1c1814;
  --text-muted:  #7c766e;
  --accent:      #4a7459;
  --border:      #d6cfc5;

  --nav-width:   19rem;
  --content-max: 680px;
  --pad-x:       clamp(1.5rem, 5vw, 3.5rem);

  --display:     'Fraunces', Georgia, serif;
  --sans:        'DM Sans', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.75;
}
a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--text); opacity: 1; }
ul { list-style: none; }
em { font-style: italic; }

/* ─────────────────────────────────────────
   TOP FADE BAR
   ───────────────────────────────────────── */
.top-fade-bar {
  position: fixed;
  top: 0;
  left: var(--nav-width);
  right: 0;
  height: 4rem;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent);
  pointer-events: none;
  z-index: 50;
}

@media (max-width: 760px) {
  .top-fade-bar { left: 0; }
}

/* ─────────────────────────────────────────
   SIDEBAR NAV
   ───────────────────────────────────────── */
.sidenav {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--nav-width);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 25vh 2rem 2.5rem 2.5rem;
  border-right: 1px solid var(--border);
  z-index: 100;
}

.nav-brand {
  position: absolute;
  top: 2rem;
  left: 2.5rem;
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: 'opsz' 36;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-brand.visible       { opacity: 1; pointer-events: auto; }
.nav-brand.visible:hover { opacity: 0.6; }

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}
.nav-links a {
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
  transition: width 0.25s ease, background 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); opacity: 1; }
.nav-links a.active::before { width: 28px; background: var(--accent); }

.panel-footer {
  margin-top: 3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .sidenav { display: none; }
  .page-content { margin-left: 0 !important; }
}

/* ─────────────────────────────────────────
   CONTENT AREA & PANELS
   ───────────────────────────────────────── */
.page-content {
  margin-left: var(--nav-width);
  min-height: 100vh;
}

.panel {
  display: none;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 4.5rem var(--pad-x) 6rem;
}
.panel.active {
  display: block;
  animation: panelInUp 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
.panel.active.from-above {
  animation: panelInDown 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes panelInDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section headings ── */
h2::before {
  content: '↬ ';
}
.about-name::before { content: none; }

h2 {
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: 'opsz' 36;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ─────────────────────────────────────────
   ABOUT PANEL
   ───────────────────────────────────────── */
#about { padding-top: clamp(4rem, 18vh, 10rem); }

.about-name {
  font-family: var(--display);
  font-style: normal;
  font-weight: 300;
  font-variation-settings: 'opsz' 36;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 2.25rem;
}

.about-bio { margin-bottom: 2.25rem; }
.about-bio p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.85rem;
}
.about-bio p:last-child { margin-bottom: 0; }

/* photo */
.about-photo img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

/* ─────────────────────────────────────────
   PUBLICATIONS PANEL
   ───────────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.pub-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pub-title        { font-size: 1rem; font-weight: 500; }
.pub-title a      { color: var(--text); }
.pub-outlet       { font-size: 0.78rem; color: var(--text-muted); }

/* ─────────────────────────────────────────
   CERTIFICATIONS
   ───────────────────────────────────────── */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cert-list li  { display: flex; align-items: center; gap: 0.75rem; font-size: 1rem; }
.cert-icon     { line-height: 1; }
.cert-name     { flex: 1; color: var(--text); }
.cert-year     { font-size: 0.75rem; color: var(--text-muted); }

/* ─────────────────────────────────────────
   PROJECTS PANEL
   ───────────────────────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.25rem;
  padding: 0.85rem 0;
  align-items: baseline;
}

.project-year {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.1rem;
  white-space: nowrap;
}

.project-name {
  display: block;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.project-name a         { color: var(--text); }

.project-item p  { font-size: 0.95rem; color: var(--text-muted); line-height: 1.65; margin: 0; }
.project-link    { font-size: 0.8rem; margin-left: 0.3rem; }

/* ─────────────────────────────────────────
   WRITING PANEL
   ───────────────────────────────────────── */
.writing-placeholder-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 32rem;
  line-height: 1.75;
  font-style: italic;
  padding: 1.75rem 2rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-bottom: 2.5rem;
}

.writing-topics {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.writing-topics p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

.topic-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.tag {
  font-size: 0.74rem;
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.writing-item + .writing-item {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.writing-item h3              { font-family: var(--sans); font-weight: 500; font-size: 1rem; margin-bottom: 0.3rem; }
.writing-item h3 a            { color: var(--text); }
.writing-item-meta            { font-size: 0.77rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.writing-item p               { font-size: 1rem; color: var(--text-muted); line-height: 1.75; }

/* ─────────────────────────────────────────
   GET IN TOUCH PANEL
   ───────────────────────────────────────── */
.contact-section p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 1.75rem;
  line-height: 1.75;
}

.contact-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.contact-line {
  font-size: 1rem;
  line-height: 1.5;
}

.contact-life {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.contact-social {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.contact-social a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  display: flex;
}
.contact-social a:hover { color: var(--text); }

/* ─────────────────────────────────────────
   MOBILE NAV
   ───────────────────────────────────────── */
.mobile-topnav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 200;
}

.mobile-brand {
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: 'opsz' 36;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 28px;
}
.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.mobile-menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 3rem; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  z-index: 199;
}
.mobile-menu-overlay.open { display: flex; }
.mobile-menu-overlay a {
  padding: 0.9rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-overlay a:last-child { border-bottom: none; }
.mobile-menu-overlay a.active,
.mobile-menu-overlay a:hover { color: var(--text); opacity: 1; }

/* ─────────────────────────────────────────
   RESPONSIVE — mobile
   ───────────────────────────────────────── */
@media (max-width: 760px) {
  .sidenav          { display: none; }
  .mobile-topnav    { display: flex; }
  .top-fade-bar     { left: 0; top: 3rem; }

  .page-content     { margin-left: 0; padding-top: 3rem; }

  .panel            { padding: 2.5rem 1.25rem 4rem; }
  #about            { padding-top: 2.5rem; }

  .project-item     { grid-template-columns: 4rem 1fr; gap: 0.75rem; }
  .contact-methods  { max-width: 100%; }
  .about-photo img  { width: 160px; height: 160px; }
}
