/* PaperMod-inspired personal site — readable, not minified */

:root {
  --gap: 24px;
  --nav-width: 1024px;
  --main-width: 720px;
  --header-height: 60px;
  --footer-height: 60px;
  --radius: 8px;

  --theme: rgb(255, 255, 255);
  --entry: rgb(255, 255, 255);
  --primary: rgb(30, 30, 30);
  --secondary: rgb(108, 108, 108);
  --tertiary: rgb(214, 214, 214);
  --content: rgb(31, 31, 31);
  --code-bg: rgb(245, 245, 245);
  --border: rgb(238, 238, 238);
  --accent: rgb(30, 30, 30);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --theme: rgb(29, 30, 32);
  --entry: rgb(46, 46, 51);
  --primary: rgb(218, 218, 219);
  --secondary: rgb(155, 156, 157);
  --tertiary: rgb(65, 66, 68);
  --content: rgb(196, 196, 197);
  --code-bg: rgb(39, 40, 43);
  --border: rgb(51, 51, 51);
  --accent: rgb(218, 218, 219);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background: var(--theme);
  color: var(--content);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}

a:hover {
  opacity: 0.75;
}

h1,
h2,
h3 {
  color: var(--primary);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.45rem;
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--nav-width) + var(--gap) * 2);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.container.narrow {
  max-width: calc(var(--main-width) + var(--gap) * 2);
}

/* —— Header —— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: color-mix(in srgb, var(--theme) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--nav-width) + var(--gap) * 2);
  margin-inline: auto;
  padding-inline: var(--gap);
  height: var(--header-height);
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.logo:hover {
  opacity: 1;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.site-nav {
  margin-left: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.35rem;
  align-items: center;
}

.nav-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-links a:hover {
  opacity: 0.7;
}

.theme-toggle,
.mobile-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover,
.mobile-toggle:hover {
  border-color: var(--border);
  background: var(--code-bg);
}

.mobile-toggle {
  display: none;
}

:root[data-theme="light"] #icon-sun {
  display: none;
}

:root[data-theme="dark"] #icon-moon {
  display: none;
}

/* —— Sections —— */

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--code-bg);
}

.section-intro {
  color: var(--secondary);
  margin-bottom: 1.75rem;
  max-width: 42rem;
}

.eyebrow {
  color: var(--secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}

.hero {
  padding: 4.5rem 0 3.25rem;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--content);
  max-width: 38rem;
}

.hero-meta {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    opacity 0.15s ease;
}

.btn:hover {
  opacity: 1;
}

.btn-primary {
  background: var(--primary);
  color: var(--theme);
  border-color: var(--primary);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--secondary);
  background: var(--code-bg);
}

.prose p {
  max-width: 42rem;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-top: 1.5rem;
}

.skill-chips li {
  font-size: 0.85rem;
  color: var(--secondary);
  border: 1px solid var(--border);
  background: var(--entry);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

/* —— Cards —— */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.card {
  background: var(--entry);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.card p {
  margin: 0;
  color: var(--content);
  font-size: 0.95rem;
}

/* —— Timeline —— */

.timeline {
  list-style: none;
  border-left: 1px solid var(--border);
  margin-left: 0.35rem;
  padding-left: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--theme);
  border: 2px solid var(--secondary);
}

.timeline-meta {
  margin-bottom: 0.65rem;
}

.timeline-role {
  display: block;
  color: var(--primary);
  font-weight: 600;
  font-size: 1.02rem;
}

.timeline-org {
  display: block;
  color: var(--secondary);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.timeline-points {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--content);
}

.timeline-points li {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.timeline-points li:last-child {
  margin-bottom: 0;
}

/* —— Writing —— */

.writing-card {
  background: var(--entry);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}

.writing-pitch {
  margin-bottom: 1.25rem;
  max-width: 36rem;
  font-size: 1.05rem;
}

/* —— Contact —— */

.contact-list {
  list-style: none;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--entry);
  overflow: hidden;
}

.contact-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-label {
  color: var(--secondary);
  font-size: 0.9rem;
}

.contact-list a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  word-break: break-word;
}

.contact-list a:hover {
  text-decoration: underline;
}

.contact-note {
  color: var(--secondary);
  font-size: 0.95rem;
}

/* —— Footer —— */

.site-footer {
  border-top: 1px solid var(--border);
  min-height: var(--footer-height);
  display: flex;
  align-items: center;
  color: var(--secondary);
  font-size: 0.9rem;
}

.footer-inner {
  padding-block: 1.25rem;
}

.site-footer a {
  color: var(--secondary);
}

.site-footer p {
  margin: 0;
}

/* —— Fade-in (subtle) —— */

.fade-in-section {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* —— Responsive —— */

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .mobile-toggle {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .theme-toggle {
    order: 3;
  }

  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    margin: 0;
    background: var(--theme);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 0.75rem var(--gap) 1rem;
  }

  .site-nav.open {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .nav-inner {
    position: relative;
  }

  .contact-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .hero {
    padding-top: 3rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
