/* ─── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --text: #0f1a20;
  --muted: #566370;
  --line: rgba(15, 26, 32, 0.11);
  --accent: #1d4d46;
  --accent-pale: #e3efec;
  --badge-live-bg: #d2f0e4;
  --badge-live-text: #0d3d2f;
  --badge-dev-bg: #f0e8d4;
  --badge-dev-text: #4a3010;
}

/* ─── Reset & base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
}
a { color: var(--accent); }
p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

/* ─── Skip link ──────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: .5rem .75rem;
  z-index: 1000;
}
.skip-link:focus { left: .75rem; top: .75rem; }

/* ─── Typography ─────────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.08;
  font-weight: 700;
  margin: 0;
}

h1 {
  font-size: clamp(3.8rem, 9vw, 6.5rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.2rem;
}

/* ─── Wrap ───────────────────────────────────────────────────────────── */
.wrap {
  width: min(960px, calc(100% - 2.5rem));
  margin: 0 auto;
}

/* ─── Nav ────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: .85rem 0;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-name:hover { color: var(--accent); }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--text); }

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 230px;
  grid-template-rows: auto auto;
  grid-template-areas:
    "name portrait"
    "tagline portrait";
  gap: .6rem 2.5rem;
  align-items: start;
}

.hero-name { grid-area: name; }
.tagline    { grid-area: tagline; }

.hero-portrait-wrap {
  grid-area: portrait;
  align-self: start;
}

.tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
  font-weight: 300;
  font-style: italic;
  max-width: 28ch;
  padding-top: .5rem;
}

.hero-portrait {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(15, 26, 32, 0.08);
}

.scroll-hint {
  margin-top: 3.5rem;
  color: var(--muted);
  opacity: 0.35;
  animation: nudge 2.5s ease-in-out infinite;
  width: 20px;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  55%       { transform: translateY(7px); }
}

/* ─── Intro ──────────────────────────────────────────────────────────── */
.intro {
  padding: 5.5rem 0 5rem;
}

.intro-text {
  max-width: 42rem;
}

.intro-text p {
  font-size: 1.08rem;
  line-height: 1.82;
}

.intro-text p:last-child {
  font-style: italic;
  color: var(--muted);
}

/* ─── Projects ───────────────────────────────────────────────────────── */
.projects {
  padding: 4.5rem 0 5.5rem;
  border-top: 1px solid var(--line);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: .25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.project-header {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
}

.project-subtitle {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
}

.project-lead {
  font-weight: 500;
  margin: 0;
  font-size: .97rem;
  line-height: 1.5;
}

.project-detail {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.68;
  flex: 1;
}

.project-link {
  display: inline-block;
  padding-top: .25rem;
  font-size: .86rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.project-link:hover { border-bottom-color: var(--accent); }

.project-link-pending {
  display: inline-block;
  padding-top: .25rem;
  font-size: .86rem;
  color: var(--muted);
  font-style: italic;
}

/* ─── Badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  white-space: nowrap;
  vertical-align: baseline;
}

.badge-live {
  background: var(--badge-live-bg);
  color: var(--badge-live-text);
}

.badge-dev {
  background: var(--badge-dev-bg);
  color: var(--badge-dev-text);
}

/* ─── Philosophy ─────────────────────────────────────────────────────── */
.philosophy {
  padding: 4.5rem 0 5rem;
  border-top: 1px solid var(--line);
}

.philosophy-text {
  max-width: 40rem;
  position: relative;
  padding-left: 1.5rem;
}

.philosophy-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: .4em;
  width: 3px;
  bottom: .4em;
  background: var(--accent);
  border-radius: 2px;
  opacity: .35;
}

.philosophy-text p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
}

/* ─── Institution ────────────────────────────────────────────────────── */
.institution {
  padding: 4.5rem 0 5rem;
  border-top: 1px solid var(--line);
}

.institution p {
  max-width: 40rem;
}

.institution a {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(29, 77, 70, 0.3);
  padding-bottom: .05rem;
}

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

/* ─── Contact ────────────────────────────────────────────────────────── */
.contact {
  padding: 5rem 0 6.5rem;
  border-top: 1px solid var(--line);
}

.contact h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: .75rem;
}

.contact-desc {
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.contact-email {
  display: inline-block;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: .1rem;
  margin-bottom: 2.25rem;
  font-family: 'DM Sans', system-ui, sans-serif;
}

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

.social-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

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

/* ─── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

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

.footer-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .88rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: .82rem;
  color: var(--muted);
  text-decoration: none;
}

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

/* ─── Responsive: tablet ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  .hero { padding: 3.5rem 0 3.5rem; }

  .hero-layout {
    grid-template-columns: 1fr 180px;
    gap: .5rem 2rem;
  }

  .intro { padding: 4rem 0; }
  .projects { padding: 3.5rem 0 4rem; }
  .philosophy { padding: 3.5rem 0 4rem; }
  .institution { padding: 3.5rem 0 4rem; }
  .contact { padding: 4rem 0 5rem; }
}

/* ─── Responsive: mobile ─────────────────────────────────────────────── */
@media (max-width: 620px) {
  .hero { padding: 2.5rem 0 3rem; }

  .hero-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "portrait"
      "tagline";
    gap: 1.5rem;
  }

  .hero-portrait-wrap {
    width: 150px;
    margin: 0 auto;
  }

  .tagline { max-width: none; padding-top: 0; }

  .scroll-hint { margin-top: 2.5rem; }

  .project-grid { grid-template-columns: 1fr; }

  .nav-links { gap: 1.1rem; }

  .footer-inner { flex-direction: column; gap: .75rem; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 400px) {
  .hero { padding: 2rem 0 2.5rem; }
  .intro { padding: 3rem 0; }
  .projects { padding: 3rem 0; }
  .philosophy { padding: 3rem 0; }
  .institution { padding: 3rem 0; }
  .contact { padding: 3rem 0 4rem; }
}

/* ─── Print ───────────────────────────────────────────────────────────── */
@media print {
  @page { size: Letter; margin: .6in; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .site-nav,
  .scroll-hint,
  .site-footer,
  .social-links,
  .badge { display: none !important; }

  .hero { border: none; padding: 0 0 1.5rem; }
  .hero-portrait-wrap { display: none !important; }
  .hero-layout { display: block; }

  h1 { font-size: 28pt; }
  h2 { font-size: 16pt; }

  .project-grid { grid-template-columns: 1fr; }
  .project-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    break-inside: avoid;
  }

  .philosophy-text::before { display: none; }

  a { color: #000 !important; }

  section { break-inside: auto; }
}
