/* -----------------------------
   Fonts
------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Newsreader:opsz,wght@6..72,400;6..72,600&family=Caveat:wght@500;600&display=swap');

/* -----------------------------
   Design System
------------------------------ */
:root{
  --bg:  #0e0c14;
  --bg-soft: #181720;
  --card: #1d1b26;
  --text: #f2edf7;
  --muted: #ccc5d5e3;
  --accent: #a484c2;
  --accent-soft: #b5e6b0;
  --border: #353142;
  --radius: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);

  --note: #dcc796;
  --note-bg: rgba(220, 199, 150, 0.06);
  --note-border: rgba(220, 199, 150, 0.28);
}


/* -----------------------------
   Base
------------------------------ */
*{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

body{
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.14;
  pointer-events: none;
  z-index: -2;
}

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

a{
  color: inherit;
}

h1, h2, h3, .logo{
  font-family: 'Newsreader', serif;
  letter-spacing: -0.02em;
}

h1, h2, h3, p{
  margin-top: 0;
}

.container{
  width: min(1100px, calc(100% - 40px));
  margin-inline: auto;
}

/* -----------------------------
   Reusable editorial details
------------------------------ */
.section-label{
  margin: 0 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.section-aside,
.hero-note,
.scribble-note{
  font-family: 'Caveat', cursive;
  color: var(--note);
}

.section-aside{
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.scribble-note{
  position: absolute;
  left: 240px;
  top: -24px;
  font-size: 1.15rem;
  transform: rotate(-3deg);
  opacity: 0.95;
}

.with-margin-note{
  position: relative;
}

.prose{
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.85;
  font-size: 1.02rem;
}

.prose + .prose{
  margin-top: 18px;
}

/* -----------------------------
   Header
------------------------------ */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(18, 17, 22, 0.78);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.logo{
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
}

.nav{
  display: flex;
  gap: 20px;
}

.nav a{
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav a:hover{
  color: var(--text);
}

/* -----------------------------
   Hero
------------------------------ */
.hero{
  position: relative;
  padding: 96px 0 76px;
}

.hero::after{
  content: "";
  position: absolute;
  inset: -80px -120px auto -120px;
  height: 360px;
  background:
    radial-gradient(circle at 28% 22%, rgba(183, 154, 214, 0.10), transparent 55%),
    radial-gradient(circle at 72% 30%, rgba(142, 166, 140, 0.08), transparent 60%);
  z-index: -1;
  pointer-events: none;
  filter: blur(10px);
}

.hero-shell{
  position: relative;
}

.hero-topline{
  margin: 0 0 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.hero-editorial{
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  gap: 34px;
  align-items: start;
  padding: 42px 38px;
  background: rgba(29, 27, 38, 0.60);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-photo-wrap{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-portrait{
  width: 100%;
  max-width: 220px;
  height: 280px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.photo-caption{
  max-width: 18ch;
  margin: 0;
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--note);
  transform: rotate(-2deg);
}

.hero-main h1{
  margin: 0 0 12px;
  font-size: clamp(3.2rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.96;
  color: var(--text);
}

.lead{
  max-width: 60ch;
  font-size: 1.03rem;
  line-height: 1.9;
  color: var(--muted);
}

.lead a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(183, 154, 214, 0.25);
  transition: 0.2s ease;
}

.lead a:hover{
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero-links{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.text-link{
  position: relative;
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
}

.text-link::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

.text-link:hover{
  color: var(--text);
}

.hero-margin{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8px;
}

.hero-facts{
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}

.hero-facts-single{
  padding: 18px 18px 16px;
  border-radius: 18px;
}

.hero-facts p{
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.88rem;
}

.hero-facts p + p{
  margin-top: 10px;
}

.hero-facts span{
  display: block;
  margin-bottom: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.hero-facts a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(183, 154, 214, 0.25);
}

.hero-facts a:hover{
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* -----------------------------
   Buttons
------------------------------ */
.btn{
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #17141d;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.btn-ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

/* -----------------------------
   Sections
------------------------------ */
.section{
  padding: 82px 0;
}

.section.alt{
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2{
  margin-bottom: 10px;
  font-size: 2rem;
  border-bottom: none;
}

.section-head{
  margin-bottom: 32px;
}

.notebook-page .section-head{
  max-width: 720px;
  margin-bottom: 28px;
}

/* -----------------------------
   Academic
------------------------------ */
.academic-layout{
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.minihead{
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.academics,
.outputs{
  list-style: none;
  margin: 0;
  padding: 0;
}

.academics{
  display: grid;
  gap: 16px;
}

.entry{
  padding: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.entry-featured{
  padding: 22px 20px;
}

.entry-compact{
  padding: 16px 20px;
}

.outputs li{
  padding: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.outputs li + li{
  margin-top: 14px;
}

.entry-top{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.entry-top strong{
  display: block;
  margin-bottom: 2px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.entry-meta{
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.pill{
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
}

.thesis-block{
  margin-top: 14px;
}

.thesis-label{
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent-soft);
  text-transform: lowercase;
}

.paper-tagline{
  margin: 0 0 8px;
  font-family: 'Newsreader', serif;
  font-size: 1.08rem;
  color: var(--text);
}

.thesis-rest{
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  max-width: 54ch;
}

.entry .muted{
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.entry-compact p{
  margin: 10px 0 0;
  color: var(--text);
}

/* -----------------------------
   About / Field Notes
------------------------------ */
.journal-layout{
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.journal-margin{
  position: relative;
}

.margin-card{
  position: sticky;
  top: 110px;
  padding: 14px 14px 16px;
  border: 1px dashed var(--note-border);
  border-radius: 14px;
  background: var(--note-bg);
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.margin-card p{
  margin: 0;
  font-family: 'Caveat', cursive;
  font-size: 1.18rem;
  line-height: 1.28;
  color: var(--note);
}

.margin-card::before{
  content: "✎";
  display: inline-block;
  margin-bottom: 8px;
  color: var(--note);
  font-size: 1rem;
}

.journal{
  max-width: 62ch;
  padding-left: 22px;
  border-left: 1px solid rgba(183, 154, 214, 0.28);
  font-size: 1.05rem;
  line-height: 1.95;
  position: relative;
}

.journal::before{
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(183, 154, 214, 0.08);
}

.entry-date{
  margin-bottom: 1.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.chip{
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

/* -----------------------------
   Projects
------------------------------ */
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card{
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover{
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card-note{
  margin: 0 0 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.card h3{
  margin-bottom: 10px;
}

.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tags span{
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.card-links{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.card-links a{
  color: var(--accent);
  text-decoration: none;
}

.card-links a:hover{
  text-decoration: underline;
}

.outputs strong a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(183, 154, 214, 0.25);
  transition: 0.2s ease;
}

.outputs strong a:hover{
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.output-links{
  display: flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.output-links a{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-soft);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.output-links a:hover{
  color: var(--accent);
}

/* -----------------------------
   Writing
------------------------------ */
.writing-list{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 20px;
  margin-top: 24px;
}

.writing-item{
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.writing-thumb{
  display: block;
  width: calc(100% + 40px);
  aspect-ratio: 16 / 9;
  margin: -20px -20px 18px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.writing-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.writing-thumb:hover img{
  transform: scale(1.03);
  opacity: 0.92;
}

.writing-item h3{
  margin-bottom: 8px;
  line-height: 1.2;
}

.writing-item p{
  margin-bottom: 18px;
  color: var(--muted);
}

.writing-item .btn{
  margin-top: auto;
}

.notebook-page .writing-list{
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 18px;
  margin-top: 20px;
}

/* -----------------------------
   Experience
------------------------------ */
.timeline{
  display: grid;
  gap: 18px;
}

.timeline-item{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}

.timeline-meta{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-soft);
}

/* -----------------------------
   Contact / Correspondence
------------------------------ */
.contact-note .scribble-note{
  left: 260px;
  top: -10px;
}

.correspondence-card{
  max-width: 680px;
  padding: 24px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
}

.letter-kicker{
  margin: 0 0 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.letter-line{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.letter-label{
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  color: var(--note);
}

.email-link{
  font-family: 'Newsreader', serif;
  font-size: 1.42rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(183, 154, 214, 0.30);
}

.email-link:hover{
  color: var(--accent);
}

.letter-copy{
  max-width: 52ch;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.75;
}

.signoff-block{
  margin-bottom: 22px;
  padding-left: 14px;
  border-left: 1px dashed var(--note-border);
}

.signoff-label{
  margin: 0 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--accent-soft);
}

.signoff-note{
  margin: 0;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--note);
  transform: rotate(-1deg);
}

.contact-links-text{
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 6px;
}

/* -----------------------------
   Footer
------------------------------ */
.site-footer{
  padding: 30px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.linklike{
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

/* -----------------------------
   Responsive
------------------------------ */
@media (max-width: 900px){
  .hero-editorial,
  .academic-layout,
  .journal-layout,
  .timeline-item{
    grid-template-columns: 1fr;
  }

  .hero-editorial{
    padding: 28px 24px;
  }

  .hero-portrait{
    max-width: 180px;
    height: 220px;
  }

  .hero-margin{
    padding-top: 0;
  }

  .scribble-note{
    position: static;
    display: block;
    margin-bottom: 8px;
    transform: rotate(-2deg);
  }

  .margin-card{
    position: relative;
    top: 0;
  }

  .footer-inner,
  .header-inner{
    flex-direction: column;
    align-items: flex-start;
  }

  .nav{
    flex-wrap: wrap;
  }
}

@media (max-width: 640px){
  .container{
    width: min(100% - 28px, 1100px);
  }

  .section{
    padding: 58px 0;
  }

  .section-head{
    margin-bottom: 24px;
  }

  .writing-list,
  .notebook-page .writing-list{
    gap: 14px;
    margin-top: 18px;
  }

  .writing-item{
    padding: 16px;
  }

  .writing-thumb{
    width: calc(100% + 32px);
    margin: -16px -16px 16px;
  }
}
