/* ============================================
   Diogo Souza — Portfolio
   Editorial typography and an indigo accent
   ============================================ */

:root {
  --bg: oklch(0.16 0.005 250);
  --bg-2: oklch(0.19 0.006 250);
  --bg-3: oklch(0.23 0.008 250);
  --line: oklch(0.30 0.008 250);
  --line-soft: oklch(0.25 0.006 250 / 0.6);
  --fg: oklch(0.96 0.005 250);
  --fg-2: oklch(0.78 0.006 250);
  --fg-3: oklch(0.67 0.008 250);
  --fg-4: oklch(0.63 0.008 250);

  --topnav-bg: oklch(0.16 0.005 250 / 0.75);
  --watermark-color: oklch(0.22 0.006 250);
  --social-hover-bg: oklch(0.27 0.008 250);
  --gh-cell-empty: oklch(0.22 0.006 250);

  color-scheme: dark;

  /* Easy hand tweaks — edit these to restyle the whole site */
  --accent-h: 258;     /* hue, 0–360 */
  --accent-c: 0.15;    /* chroma/intensity — lower = more muted, higher = more vivid */
  --grain-opacity: 0.05;

  --accent: oklch(0.72 var(--accent-c) var(--accent-h));
  --accent-soft: oklch(0.72 var(--accent-c) var(--accent-h) / 0.12);

  --font-display: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-accent: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1280px;
  --pad-x: clamp(20px, 4vw, 64px);
  --section-y: clamp(64px, 10vw, 160px);
  --radius: 4px;
  --radius-lg: 10px;
}

/* ===========================
   Light mode
   =========================== */

[data-theme="light"] {
  color-scheme: light;

  --bg: oklch(0.98 0.003 60);
  --bg-2: oklch(0.95 0.005 60);
  --bg-3: oklch(0.91 0.006 60);
  --line: oklch(0.84 0.005 250);
  --line-soft: oklch(0.84 0.005 250 / 0.6);
  --fg: oklch(0.15 0.008 250);
  --fg-2: oklch(0.32 0.008 250);
  --fg-3: oklch(0.45 0.008 250);
  --fg-4: oklch(0.48 0.006 250);

  --topnav-bg: oklch(0.98 0.003 60 / 0.82);
  --watermark-color: oklch(0.88 0.005 60);
  --social-hover-bg: oklch(0.87 0.006 60);
  --gh-cell-empty: oklch(0.89 0.006 60);

  --accent: oklch(0.48 var(--accent-c) var(--accent-h));
  --accent-soft: oklch(0.48 var(--accent-c) var(--accent-h) / 0.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.js { scroll-padding-top: 72px; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: var(--grain-opacity, 0.05);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1   0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* subtle vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, oklch(0.72 var(--accent-c) var(--accent-h) / 0.05), transparent 60%);
}

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

a { color: inherit; text-decoration: none; }

/* ===========================
   Accessibility helpers
   =========================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  transform: translateY(-140%);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 999px;
  transition: transform 0.2s ease;
}
.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* ===========================
   Typography utilities
   =========================== */

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}

h1 {
  font-size: clamp(40px, 7.5vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 500;
}

h2 {
  font-size: clamp(30px, 4.5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
  font-weight: 500;
}

p { margin: 0; color: var(--fg-2); }

/* ===========================
   Layout primitives
   =========================== */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  position: relative;
  z-index: 1;
}

section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 64px;
  max-width: 900px;
}

.section-head .lead {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--fg-2);
  max-width: 60ch;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .section-fade {
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  .reveal-ready .section-fade:not(.is-visible, :focus-within, :target) {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ===========================
   Top nav
   =========================== */

.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: var(--topnav-bg);
  border-bottom: 1px solid var(--line-soft);
}

.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg);
}

.brand-name { color: var(--fg); font-weight: 500; }
.brand-slash { color: var(--fg-4); }
.brand-role { color: var(--fg-3); }
@media (max-width: 520px) {
  .brand-role, .brand-slash { display: none; }
  .topnav .brand { gap: 8px; }
  .topnav .topnav-inner { gap: 8px; padding-inline: max(10px, 3.5vw); }
  .topnav .topnav-actions { gap: 6px; }
  .topnav .lang-toggle button { padding-inline: 6px; min-height: 36px; }
}

.topnav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 16px 32px -12px oklch(0 0 0 / 0.45);
  padding: 4px var(--pad-x) 12px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.topnav-links.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}
.topnav-links a {
  padding: 13px 2px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.topnav-links a:last-child { border-bottom: 0; }

@media (min-width: 1200px) {
  .topnav { position: fixed; }
  .topnav-inner {
    position: relative;
    gap: 16px;
    padding-inline: clamp(24px, calc(24vw - 264px), 48px);
  }
  .topnav-links {
    position: static;
    flex-direction: row;
    gap: clamp(10px, calc(6vw - 62px), 18px);
    padding: 0;
    margin: 0 auto 0 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 0;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .topnav-links a {
    padding: 0;
    border-bottom: 0;
    min-height: 0;
    white-space: nowrap;
  }
}

html:not(.js) .topnav { position: static; }
html:not(.js) .topnav-inner { flex-wrap: wrap; }
html:not(.js) .topnav-actions { display: none; }
html:not(.js) .topnav-links {
  position: static;
  flex-flow: row wrap;
  gap: 0 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  max-height: none;
  opacity: 1;
  visibility: visible;
  transform: none;
}
html:not(.js) .topnav-links a { min-height: 32px; padding: 0; border: 0; }
html:not(.js) .hero { padding-top: clamp(48px, 11vh, 148px); }

.topnav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color 0.2s;
  position: relative;
}
.topnav-links a:hover,
.topnav-links a.is-active { color: var(--fg); }
.topnav-links a .num { color: var(--fg-4); margin-right: 6px; }
.topnav-links a.is-active .num { color: var(--accent); }

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.lang-toggle button {
  background: transparent;
  border: 0;
  color: var(--fg-3);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  min-height: 32px;
}
.lang-toggle button.is-active {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: box-shadow 0.25s, transform 0.2s;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px oklch(0 0 0 / 0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--fg-2); }

/* ===========================
   Mobile nav toggle (hamburger)
   =========================== */

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  display: block;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.nav-toggle-icon {
  position: relative;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

@media (min-width: 1200px) {
  .nav-toggle { display: none; }
}

/* ===========================
   Hero
   =========================== */

.hero {
  padding-top: clamp(120px, 18vh, 220px);
  padding-bottom: clamp(72px, 10vw, 140px);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
    align-items: end;
  }
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 36px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  margin-bottom: 16px;
}

.hero h1 {
  margin-bottom: 32px;
  overflow-wrap: break-word;
}

.hero h1 .accent {
  color: var(--accent);
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.4vw, 32px);
  line-height: 1.25;
  color: var(--fg);
  max-width: 22ch;
  margin-bottom: 24px;
  letter-spacing: -0.015em;
  font-weight: 400;
}

.hero-desc {
  max-width: 56ch;
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--fg-2);
  margin-bottom: 40px;
  line-height: 1.65;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-meta-item .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.hero-meta-item .value {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--fg);
  letter-spacing: -0.01em;
}

/* big watermark name */
.hero-watermark {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(110px, 22vw, 320px);
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: var(--watermark-color);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

/* ===========================
   About
   =========================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}
@media (min-width: 980px) {
  .about-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 96px; }
}

.about-prose p + p { margin-top: 20px; }
.about-prose p {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.7;
  color: var(--fg-2);
  text-wrap: pretty;
}

.facts {
  border-top: 1px solid var(--line);
}
.fact {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  align-items: baseline;
}
.fact-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
}
.fact-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--fg);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.fact-desc {
  font-size: 14px;
  color: var(--fg-3);
  line-height: 1.5;
}

/* ===========================
   Skills / Stack
   =========================== */

.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 700px) { .stack-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .stack-grid { grid-template-columns: repeat(4, 1fr); } }

.stack-cell {
  background: var(--bg-2);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 220px;
  position: relative;
  transition: background 0.25s;
}
.stack-cell:hover { background: var(--bg-3); }

.stack-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.06em;
}
.stack-name {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--fg);
  letter-spacing: -0.015em;
}
.stack-desc {
  font-size: 14px;
  color: var(--fg-3);
  line-height: 1.5;
  flex: 1;
}
.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stack-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  border: 1px dashed var(--line);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ===========================
   Work / Projects
   =========================== */

.work-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.work-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  align-items: start;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.3s, background 0.3s;
}
@media (min-width: 880px) {
  .work-row {
    grid-template-columns: 60px minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 40px;
    align-items: center;
  }
}

.work-row:hover {
  padding-left: 16px;
  background: linear-gradient(90deg, var(--accent-soft), transparent 30%);
}
.work-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
}

.work-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.work-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.work-title {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.5vw, 32px);
  letter-spacing: -0.02em;
  color: var(--fg);
  font-weight: 500;
}
.work-row:hover .work-title { color: var(--accent); }

.work-desc {
  font-size: 15px;
  color: var(--fg-3);
  max-width: 56ch;
  line-height: 1.55;
}

.work-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.work-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.work-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--fg-3);
  transition: all 0.25s;
  flex-shrink: 0;
}
.work-row:hover .work-arrow {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: rotate(-45deg);
}

/* ===========================
   Experience timeline
   =========================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--line);
  margin-left: 8px;
  padding-left: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 28px 0 28px 36px;
  position: relative;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 36px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.tl-item:first-child::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

@media (min-width: 880px) {
  .tl-item { grid-template-columns: 200px 1fr; gap: 32px; }
}

.tl-period {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tl-body { display: flex; flex-direction: column; gap: 10px; }
.tl-role {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--fg);
  letter-spacing: -0.015em;
}
.tl-company {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
}
.tl-bullets {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.55;
}
.tl-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ===========================
   Education
   =========================== */

.edu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 880px) { .edu-grid { grid-template-columns: 1fr 1fr; } }

.edu-card {
  background: var(--bg-2);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.edu-card .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.edu-card .inst {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--fg);
  letter-spacing: -0.015em;
}
.edu-card .course {
  font-size: 14px;
  color: var(--fg-2);
}
.edu-courses { grid-column: 1 / -1; }

/* ===========================
   GitHub stats
   =========================== */

.gh-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 48px;
}
@media (min-width: 880px) { .gh-stats { grid-template-columns: repeat(4, 1fr); } }

.gh-stat {
  background: var(--bg-2);
  padding: 28px 24px;
}
.gh-stat .num {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  color: var(--accent);
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 12px;
  font-weight: 500;
  transition: opacity 0.3s;
}
.gh-stat .num[data-state="loading"] { opacity: 0.35; }
.gh-stat .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gh-contrib {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 48px;
}
.gh-contrib-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.gh-contrib-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.gh-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
}
.gh-legend-cells { display: flex; gap: 3px; }
.gh-legend-cells span {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.gh-grid {
  display: grid;
  grid-template-columns: repeat(var(--gh-weeks, 53), minmax(8px, 1fr));
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
  min-height: 80px;
}
.gh-cell,
.gh-legend-cells span {
  aspect-ratio: 1;
  border-radius: 2px;
  min-width: 8px;
  background: var(--gh-cell-empty);
}
.gh-cell:not([data-level]) { visibility: hidden; }
.gh-cell[data-level="1"], .gh-legend-cells span[data-level="1"] { background: oklch(0.85 0.18 var(--accent-h) / 0.18); }
.gh-cell[data-level="2"], .gh-legend-cells span[data-level="2"] { background: oklch(0.85 0.18 var(--accent-h) / 0.42); }
.gh-cell[data-level="3"], .gh-legend-cells span[data-level="3"] { background: oklch(0.85 0.18 var(--accent-h) / 0.7); }
.gh-cell[data-level="4"], .gh-legend-cells span[data-level="4"] { background: var(--accent); }
[data-theme="light"] .gh-cell[data-level="1"], [data-theme="light"] .gh-legend-cells span[data-level="1"] { background: oklch(0.80 0.08 var(--accent-h)); }
[data-theme="light"] .gh-cell[data-level="2"], [data-theme="light"] .gh-legend-cells span[data-level="2"] { background: oklch(0.70 0.11 var(--accent-h)); }
[data-theme="light"] .gh-cell[data-level="3"], [data-theme="light"] .gh-legend-cells span[data-level="3"] { background: oklch(0.59 0.13 var(--accent-h)); }

.gh-pinned {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 880px) { .gh-pinned { grid-template-columns: 1fr 1fr; } }

.gh-pin {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.25s, transform 0.25s, opacity 0.3s;
}
.gh-pin:hover { border-color: var(--accent); }
.gh-pin[data-state="loading"] { opacity: 0.35; }
html:not(.js) .gh-pin[data-state="loading"] { display: none; }
.gh-pin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.gh-pin-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.gh-pin-name .org { color: var(--fg-3); }
.gh-pin-desc {
  font-size: 14px;
  color: var(--fg-3);
  line-height: 1.5;
  min-height: 42px;
}
.gh-pin-foot {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
}
.gh-pin-foot .lang-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); margin-right: 6px;
  display: inline-block; vertical-align: middle;
}

.gh-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-4);
  letter-spacing: 0.02em;
}
.gh-note:not(:empty) { margin-top: 16px; }

.gh-pin-stars {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.02em;
}

.eyebrow-link {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eyebrow-link:hover { text-decoration: underline; }

/* ===========================
   Résumé
   =========================== */

.resume-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: clamp(12px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.resume-preview {
  display: block;
  width: min(100%, 52rem);
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-3);
}

.resume-viewer {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

/* ===========================
   Contact
   =========================== */

.contact {
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}
@media (min-width: 980px) {
  .contact-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 96px; }
}

.contact-display {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 72px);
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--fg);
  font-weight: 500;
}
.contact-display .accent {
  color: var(--accent);
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-row { display: flex; flex-direction: column; gap: 8px; }
.contact-row .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.contact-email {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.contact-email a { min-width: 0; overflow-wrap: anywhere; text-decoration: underline; }
.copy-status:not(:empty) { font-size: 0.8rem; color: var(--fg-3); }
.contact-email button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  min-height: 32px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.contact-email button:hover { color: var(--accent); border-color: var(--accent); }

.socials {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.social-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: background 0.2s;
  cursor: pointer;
}
.social-row:hover { background: var(--social-hover-bg); }
.social-row .platform { color: var(--fg-2); }
.social-row .handle { color: var(--fg-3); overflow-wrap: anywhere; text-align: right; }
.social-row .arrow {
  color: var(--fg-3); transition: transform 0.2s, color 0.2s; flex-shrink: 0;
}
.social-row:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* ===========================
   Footer
   =========================== */

footer.foot {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.foot-inner a { color: var(--fg-3); }
.foot-inner a:hover { color: var(--accent); }

/* ===========================
   Misc
   =========================== */

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-4);
  text-transform: uppercase;
}

/* ===========================
   Section target flash
   =========================== */

section:target {
  animation: section-flash 1.6s ease forwards;
}
@keyframes section-flash {
  0%   { background-color: var(--accent-soft); }
  15%  { background-color: var(--accent-soft); }
  100% { background-color: transparent; }
}

/* ===========================
   Button press + ripple
   =========================== */

.btn-primary,
.btn-ghost {
  position: relative;
  overflow: hidden;
}

.btn-primary::after,
.btn-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(255,255,255,0.28) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s, transform 0.35s;
}

.btn-primary:active,
.btn-ghost:active {
  transform: scale(0.97);
  transition: transform 0.1s;
}

.btn-primary:active::after,
.btn-ghost:active::after {
  opacity: 1;
  transform: scale(1);
  transition: none;
}

/* ===========================
   Theme toggle button
   =========================== */

.theme-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ===========================
   Small screens fine-tuning
   =========================== */

@media (max-width: 480px) {
  .gh-stats { grid-template-columns: 1fr 1fr; }
  .hero-watermark { display: none; }
  .contact-email { flex-direction: column; align-items: stretch; }
  .contact-email button { align-self: flex-start; }
}
