/* Shared styles for the portfolio home page and the resume pages. */
:root {
  --ink: #0f172a;
  --body: #1f2937;
  --muted: #475569;
  --subtle: #334155;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #eff4ff;
  --rule: #cbd5e1;
  --surface: #ffffff;
  --canvas: #f1f5f9;
  --card: #ffffff;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 4px 16px rgb(15 23 42 / 6%);
  --font: "Aptos", "Calibri", "Helvetica Neue", Arial, sans-serif;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f1f5f9;
    --body: #d6dde8;
    --muted: #9aa7b8;
    --subtle: #b6c1cf;
    --accent: #7aa2ff;
    --accent-ink: #0b1220;
    --accent-soft: #16223d;
    --rule: #334155;
    --surface: #111827;
    --canvas: #0b1220;
    --card: #111a2b;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}
:root[data-theme="dark"] {
  --ink: #f1f5f9;
  --body: #d6dde8;
  --muted: #9aa7b8;
  --subtle: #b6c1cf;
  --accent: #7aa2ff;
  --accent-ink: #0b1220;
  --accent-soft: #16223d;
  --rule: #334155;
  --surface: #111827;
  --canvas: #0b1220;
  --card: #111a2b;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.button.secondary { background: transparent; color: var(--accent); }
.button:hover { filter: brightness(1.08); }

/* ---------- Portfolio ---------- */
.site { max-width: 1040px; margin: 0 auto; padding: 24px 24px 64px; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.theme-toggle { min-width: 92px; justify-content: center; }
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.hero .headline { margin-top: 10px; font-size: clamp(16px, 2.4vw, 20px); font-weight: 700; color: var(--accent); }
.hero .summary { max-width: 68ch; margin: 14px 0 0; font-size: 17px; line-height: 1.55; }
.hero .contact { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.hero .contact a { color: var(--muted); text-decoration: none; }
.hero .contact a:hover { color: var(--accent); text-decoration: underline; }

.resume-card {
  margin-top: 32px;
  padding: 24px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.resume-card h2 { margin: 0; font-size: 22px; color: var(--ink); }
.resume-card p { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; max-width: 52ch; }
.resume-card .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.resume-card .downloads { width: 100%; font-size: 13.5px; color: var(--muted); }
.resume-card .downloads a { color: var(--muted); }

.projects { margin-top: 48px; }
.projects > h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.project-group { margin-top: 28px; }
.project-group h3 {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 20px;
  color: var(--ink);
}
.project-group .intro { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.cards {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.card .card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card h4 { margin: 0; font-size: 16.5px; color: var(--ink); }
.card .year { color: var(--muted); font-size: 13px; font-weight: 700; }
.card p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0; list-style: none; }
.tags li { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--subtle); }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.links a { text-decoration: none; }
.links a:hover { text-decoration: underline; }
.links a::after { content: " \2197"; font-weight: 400; }

.site-footer { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }

@media (max-width: 600px) {
  .site { padding: 32px 16px 48px; }
  .resume-card { padding: 18px; }
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Resume ---------- */
.toolbar {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.toolbar .back { color: var(--muted); text-decoration: none; font-weight: 700; }
.toolbar .back:hover { color: var(--accent); }
.toolbar .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar .button { padding: 7px 12px; font-size: 13px; }
.toolbar .theme-toggle { min-width: 80px; }

.resume {
  max-width: 8.5in;
  margin: 12px auto 40px;
  padding: 0.45in 0.6in 0.5in;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 10pt;
  line-height: 1.32;
}
.resume h1 { margin: 0; font-size: 22pt; line-height: 1; color: var(--ink); letter-spacing: 0.5px; text-transform: uppercase; }
.resume .headline { margin: 5px 0 0; font-size: 11.5pt; font-weight: 700; color: var(--accent); }
.resume h1 + ul, .resume .headline + ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  list-style: none;
  margin: 5px 0 12px;
  padding: 0;
  color: var(--muted);
  font-size: 9.3pt;
}
.resume h1 + ul li, .resume .headline + ul li { margin: 0; }
.resume h1 + ul li:not(:last-child)::after, .resume .headline + ul li:not(:last-child)::after { content: "\2022"; margin: 0 8px; }
.resume h1 + ul a, .resume .headline + ul a { color: var(--muted); text-decoration: none; }
.resume h1 + ul a:hover, .resume .headline + ul a:hover { color: var(--accent); text-decoration: underline; }
.resume h2 {
  margin: 12px 0 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 9.2pt;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.resume hr { display: none; }
.resume h3 { margin: 12px 0 0; color: var(--ink); font-size: 10.4pt; break-after: avoid; page-break-after: avoid; }
.resume .role-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.resume .role-dates { white-space: nowrap; font-weight: 700; color: var(--subtle); font-size: 9.4pt; }
.resume .role-meta { margin: 0 0 3px; color: var(--subtle); font-size: 9.2pt; font-weight: 600; }
.resume .subrole { margin: 7px 0 2px; color: var(--ink); font-weight: 700; }
.resume .subrole em { font-style: normal; }
.resume .tooling { color: var(--muted); font-size: 9.2pt; }
.resume .clients { margin: 1px 0 3px; color: var(--muted); font-size: 9.2pt; font-style: italic; }
.resume .clients a { color: inherit; }
.resume h2 + p, .resume h2 + ul { margin-top: 0; }
.resume p { margin: 4px 0; }
.resume ul, .resume ol { margin: 3px 0 4px; padding-left: 18px; }
.resume li { margin: 2px 0; }
.resume strong { color: var(--ink); }
.resume a { color: var(--accent); text-decoration: none; word-break: break-word; }
.resume a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .resume { margin: 8px 0 24px; padding: 24px 16px; border-radius: 0; border-left: 0; border-right: 0; font-size: 11pt; }
  .resume .role-header { flex-direction: column; gap: 0; }
}

@page { size: letter; margin: 0.5in; }
@media print {
  :root, :root[data-theme="dark"] { --ink: #0f172a; --body: #1f2937; --muted: #475569; --subtle: #334155; --accent: #1d4ed8; --rule: #cbd5e1; --surface: #fff; }
  body { background: #fff; }
  .toolbar { display: none; }
  .resume { margin: 0; padding: 0; max-width: none; border: 0; box-shadow: none; border-radius: 0; }
  .resume a { color: inherit; }
  .resume h3, .resume .role-meta { break-inside: avoid; }
}
