/* ── Design tokens ───────────────────────────────────────────────────────── */

:root {
  color-scheme: light dark;

  --bg:          #f6f7f9;
  --bg-glow-a:   #dbe7f5;
  --bg-glow-b:   #e8e3f3;
  --surface:     #ffffff;
  --border:      #e3e6ea;
  --text:        #14181d;
  --text-muted:  #5c6672;
  --accent:      #216ba5;
  --shadow:      0 1px 2px rgb(20 24 29 / 6%), 0 12px 32px rgb(20 24 29 / 8%);

  --radius:      14px;
  --radius-lg:   22px;
  --measure:     46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0d1117;
    --bg-glow-a:  #16283d;
    --bg-glow-b:  #221d33;
    --surface:    #161b22;
    --border:     #262d36;
    --text:       #e7edf4;
    --text-muted: #9aa6b3;
    --accent:     #64b5f0;
    --shadow:     0 1px 2px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 32%);
  }
}

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

/* ── Page ────────────────────────────────────────────────────────────────── */

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(60rem 40rem at 15% -10%, var(--bg-glow-a), transparent 60%),
    radial-gradient(50rem 36rem at 90% 110%, var(--bg-glow-b), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.card {
  width: min(100%, var(--measure));
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  padding: clamp(1.75rem, 5vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero { display: grid; justify-items: center; text-align: center; gap: 0.35rem; }

.avatar {
  width: clamp(6rem, 20vw, 8.75rem);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.9rem;
  border: 3px solid var(--surface);
  outline: 1px solid var(--border);
  box-shadow: 0 6px 20px rgb(20 24 29 / 14%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.021em;
  line-height: 1.15;
}

.role {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.section { display: grid; gap: 0.85rem; }

.section-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Focus tags ──────────────────────────────────────────────────────────── */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, transparent);
  border-radius: 999px;
}

/* ── Education ───────────────────────────────────────────────────────────── */

.edu { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }

.edu-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--text) 2.5%, transparent);
}

/* The logo is a single dark navy — the white chip keeps it legible on the
   dark surface and blends into the light one. */
.edu-logo {
  width: 3.25rem;
  height: auto;
  padding: 0.3rem;
  border-radius: 8px;
  background: #fff;
}

.edu-head { display: grid; gap: 0.1rem; min-width: 0; }

.edu-degree {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.edu-meta {
  font-size: 0.8rem;
  color: color-mix(in oklab, var(--text-muted) 78%, transparent);
}

/* ── Certificates ────────────────────────────────────────────────────────── */

.certs { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }

.cert {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--text) 2.5%, transparent);
}

.cert-link {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "badge head"
    "desc  desc";
  align-items: center;
  gap: 0.55rem 0.9rem;
  padding: 0.95rem 1rem 1rem;
  text-decoration: none;
  color: inherit;
  border-radius: inherit;
  transition: background-color 150ms ease, transform 150ms ease;
}

/* Wide enough for the paragraph to sit beside the badge without going narrow. */
@media (min-width: 30rem) {
  .cert-link {
    grid-template-areas:
      "badge head"
      "badge desc";
    align-items: start;
  }
}

.cert-link:hover,
.cert-link:focus-visible {
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  transform: translateY(-1px);
}

.cert-badge {
  grid-area: badge;
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
}

.cert-head {
  grid-area: head;
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.cert-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  text-wrap: balance;
}

.cert-meta {
  font-size: 0.8rem;
  color: color-mix(in oklab, var(--text-muted) 78%, transparent);
}

.cert-desc {
  grid-area: desc;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* ── Contact ─────────────────────────────────────────────────────────────── */

.links { display: grid; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  margin-left: -0.55rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.links a:hover,
.links a:focus-visible {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 9%, transparent);
}

.icon {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-muted);
}

.links a:hover .icon,
.links a:focus-visible .icon { color: inherit; }

/* ── A11y ────────────────────────────────────────────────────────────────── */

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
