@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --border: #e8e6e3;
  --text: #111111;
  --muted: #52525b;
  --accent: #9a4a1c;
  --accent-soft: rgba(154, 74, 28, 0.08);
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 24px rgba(17, 17, 17, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --shell: 880px;
  --space: 48px;
  --ease: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Outfit', system-ui, sans-serif;
  --z-nav: 40;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .fade-up { opacity: 1 !important; transform: none !important; }
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, h1, h2, h3, span, li, time, a, em {
  background: none;
  background-color: transparent;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

/* === NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: none;
  transition: transform 0.3s ease;
}

.nav .shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding-block: 12px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  list-style: none;
}

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

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

/* === HERO === */
.hero {
  padding-top: 56px;
  padding-bottom: 8px;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 14ch;
  text-wrap: balance;
  padding-bottom: 4px;
}

.hero h1 em {
  font-style: italic;
  font-weight: 600;
}

/* === SECTIONS === */
.section {
  padding-block: var(--space);
}

.section-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.prose {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: var(--text);
  outline: none;
}

/* === ENTRIES === */
.entry-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.entry {
  padding: 16px 0;
  border: none;
}

.entry:last-child {
  border: none;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
}

.entry-titles {
  min-width: 0;
  flex: 1;
}

.entry-company {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 2px;
}

.entry-role {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.entry-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.entry-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  min-height: calc(1.55em * 3);
}

.entry-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

.entry-link:hover,
.entry-link:focus-visible {
  color: var(--accent);
  outline: none;
}

.entry--edu {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.edu-logo-wrap {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.edu-logo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 44px;
  max-height: 32px;
  object-fit: contain;
  background: transparent !important;
}

/* === PROJECTS — uniform cards === */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.project {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* TracePlane: same card width as peers, centered under the row */
.project:nth-child(3) {
  grid-column: 1 / -1;
  width: 100%;
  max-width: calc((100% - 24px) / 2);
  justify-self: center;
}

.project-media {
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: #f0efed;
  box-shadow: none;
  transition: opacity var(--ease);
}

.project-media:hover,
.project-media:focus-visible {
  opacity: 0.92;
  outline: none;
  transform: none;
  box-shadow: none;
}

.project-media:active {
  opacity: 0.88;
}

.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.project-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
}

.project-body .entry-head {
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin-top: 12px;
}

.tag-row li {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
}

.link-row a {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color var(--ease), border-color var(--ease);
}

.link-row a:hover,
.link-row a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* === FOOTER === */
.footer {
  border-top: none;
  padding: 32px 0 48px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.social-links a {
  color: var(--muted);
  transition: color var(--ease), transform var(--ease);
}

.social-links a:hover,
.social-links a:focus-visible {
  color: var(--accent);
  outline: none;
}

.social-links a:active {
  transform: scale(0.96);
}

/* === MOTION === */
.fade-up {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  :root {
    --space: 40px;
  }

  .shell {
    width: min(100% - 1.75rem, var(--shell));
  }

  .nav-links {
    gap: 6px 16px;
  }

  .entry-head {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .edu-logo-wrap {
    width: 48px;
    height: 48px;
  }

  .edu-logo {
    max-width: 38px;
    max-height: 28px;
  }

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

  .project:nth-child(3) {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
  }
}
