/* ===== Tokens ===== */
:root {
  --bg: #0a0a0c;
  --bg-panel: #111113;
  --bg-elevated: #17171a;
  --border: #2a2a2e;
  --text: #ece9e4;
  --text-muted: #92908c;
  --accent: #c9a876;
  --accent-soft: #e6d3ae;
  --silver: #b8bcc4;
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); }

ul { list-style: none; margin: 0; padding: 0; }

/* Visible focus state for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ===== Intro loader ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  animation: loader-out 0.7s ease 1.2s forwards;
}
.loader-logo {
  width: 130px;
  opacity: 0;
  transform: scale(0.94);
  animation: loader-logo-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards;
}
@keyframes loader-logo-in {
  to { opacity: 1; transform: scale(1); }
}
@keyframes loader-out {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
body.loaded .loader { display: none; }

.hero-logo, .hero .bio, .hero .hero-links {
  opacity: 0;
}
body.loaded .hero-logo {
  animation: hero-in 0.7s ease 0.15s forwards;
}
body.loaded .hero .bio {
  animation: hero-in 0.7s ease 0.35s forwards;
}
body.loaded .hero .hero-links {
  animation: hero-in 0.7s ease 0.52s forwards;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .loader { display: none; }
  .hero-logo, .hero .bio, .hero .hero-links { opacity: 1; animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 18px 40px;
}
.nav-mark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: 0.03em;
}
.nav-mark:hover { color: var(--accent); }
.nav-links { display: flex; gap: 36px; }
.tab {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ===== Sections ===== */
.section {
  max-width: 720px;
  margin: 0 auto;
  padding: 110px 24px 50px;
  position: relative;
}
.section h2 {
  font-size: 2.1rem;
  padding-bottom: 18px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.section-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -20px;
  margin-bottom: 30px;
  font-style: italic;
}

/* ===== Hero / About ===== */
.hero { padding-top: 130px; text-align: center; }
.hero-logo {
  width: clamp(170px, 24vw, 230px);
  display: block;
  margin: 0 auto 32px;
}
.bio {
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 auto 32px;
  font-size: 1.05rem;
}
.hero-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 13px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #14100a; }
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Resume ===== */
.resume-block { margin-bottom: 40px; }
.resume-block h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 18px;
}
.entry { margin-bottom: 20px; }
.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 1rem;
}
.entry-title { font-weight: 500; }
.entry-date { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }
.entry-desc { color: var(--text-muted); margin: 6px 0 0; }
.skills-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skills-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.resume-download { margin-top: 8px; }

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.projects-grid .project-card:nth-child(2) { transition-delay: 0.12s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.24s; }
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease;
}
.project-card:hover { border-color: var(--accent); }
.project-thumb {
  height: 120px;
  border-radius: 2px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--bg-elevated), #1e1e22);
  border: 1px solid var(--border);
}
.project-card h3 { font-size: 1.2rem; }
.project-card p { color: var(--text-muted); font-size: 0.92rem; flex-grow: 1; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tags span {
  font-size: 0.72rem;
  color: var(--silver);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
}
.project-links { display: flex; gap: 18px; font-size: 0.88rem; }

/* ===== Contact ===== */
.contact-intro { color: var(--text-muted); margin-bottom: 28px; }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 36px;
}
.contact-form label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: 14px;
}
.contact-form input,
.contact-form textarea {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 11px 14px;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); outline: none; }
.contact-form button { margin-top: 20px; align-self: flex-start; }
.form-status { font-size: 0.85rem; color: var(--accent); min-height: 1.2em; }

.socials { display: flex; gap: 24px; font-size: 0.92rem; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 34px 20px 55px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav { padding: 16px 20px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .tab { padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .section { padding-top: 70px; }
  .hero { padding-top: 90px; }
}
