:root {
  --bg: #15161a;
  --surface: #1e2026;
  --surface-hover: #252830;
  --fg: #e8e6e3;
  --muted: #94908a;
  --border: #2c2f36;
  --accent: #d9823b;
  --accent-contrast: #15161a;
  --tag-border: #3a3d45;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 54rem;
  --gap: 1.5rem;
  --radius: 6px;
}

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

html {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--fg); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-icon {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
}

.nav-icon:hover { color: var(--fg); }

.nav-resume {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-contrast);
  background: var(--accent);
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.nav-resume:hover {
  background: #e88e4a;
}

/* Page */
.page { max-width: 42rem; }

.page h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.page p {
  margin-bottom: 1rem;
  color: var(--fg);
  max-width: 40rem;
}

.page a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.15s;
}

.page a:hover { background-size: 100% 1px; }

.page-header {
  margin-bottom: 1.5rem;
}

.page-org {
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted);
}

.page-org a {
  color: var(--muted);
  background-image: linear-gradient(var(--muted), var(--muted));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.15s;
}

.page-org a:hover {
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
}

.page-dates {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.page-back {
  margin-top: 3rem;
  font-size: 0.9rem;
}

.page-back a {
  text-decoration: none;
  color: var(--muted);
  background-image: linear-gradient(var(--muted), var(--muted));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.15s;
}

.page-back a:hover {
  color: var(--fg);
  background-image: linear-gradient(var(--fg), var(--fg));
  background-size: 100% 1px;
}

/* Home intro */
.home p {
  max-width: 38rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.home p a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.15s;
}

.home p a:hover { background-size: 100% 1px; }

/* Cards section */
.cards-section {
  margin-top: 3rem;
}

.cards-section h2 {
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
}

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

.card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  position: relative;
}

.card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217,130,59,0.08);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  color: var(--fg);
}

.card-org {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.card-dates {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-summary {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.card-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.card-tags li {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--tag-border);
  border-radius: 3px;
  padding: 0.125rem 0.4rem;
}

.card-arrow {
  font-size: 0.85rem;
  color: var(--muted);
  position: absolute;
  bottom: 1rem;
  right: 1.25rem;
  transition: transform 0.15s;
}

.card:hover .card-arrow { transform: translateX(2px); }

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.15s;
}

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

.footer-sep { color: var(--border); }

.footer-copy {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .wrapper { padding: 1.25rem 1rem 2rem; }
  .cards { grid-template-columns: 1fr; }
  .page h1 { font-size: 1.5rem; }
  nav { gap: 0.5rem; }
  .nav-cta { margin-left: 0; }
  .nav-links { display: none; }
}
