/* Colors, type and header shared by prignano.ai and its subdomains.
   Dark mode follows the system unless the reader picks one with the toggle
   (html[data-theme]). Sites set --ph-width to line the header up with their
   content. */
:root {
  --bg: #f6f7f9;
  --fg: #111418;
  --muted: #5f6873;
  --card: #ffffff;
  --border: #e3e6ea;
  --accent: #2563d6;
  --active: #17804a;
  --chip: #eef3fe;
  --chip-fg: #2451b3;
  --code-bg: #f3f5f8;
  --art-bg: linear-gradient(135deg, #1b2230, #121821);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #8b949e;
    --card: #151b23;
    --border: #2a313c;
    --accent: #58a6ff;
    --active: #3fb950;
    --chip: #1a2a44;
    --chip-fg: #9cc2ff;
    --code-bg: #0b0f15;
    --art-bg: linear-gradient(135deg, #1a212c, #121821);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --fg: #e6edf3;
  --muted: #8b949e;
  --card: #151b23;
  --border: #2a313c;
  --accent: #58a6ff;
  --active: #3fb950;
  --chip: #1a2a44;
  --chip-fg: #9cc2ff;
  --code-bg: #0b0f15;
  --art-bg: linear-gradient(135deg, #1a212c, #121821);
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: avatar, name and bio on the left, links and the theme toggle on the right. */
.ph-header {
  width: var(--ph-width, min(1080px, calc(100vw - 48px)));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  line-height: 1.5;
}
.ph-identity { display: flex; align-items: center; gap: 16px; min-width: 0; color: var(--fg); }
.ph-identity:hover { text-decoration: none; }
.ph-avatar { border-radius: 50%; border: 1px solid var(--border); flex-shrink: 0; background: var(--card); }
.ph-identity-text { display: flex; flex-direction: column; min-width: 0; }
.ph-name { font-size: clamp(1.25rem, 3.2vh, 1.75rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.ph-bio { margin-top: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-links { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 0.9rem; flex-shrink: 0; }
.ph-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
/* A call-to-action link, drawn as a pill so it stands out. */
.ph-links a.ph-cta {
  padding: 4px 12px; border-radius: 999px; background: var(--accent); color: var(--bg);
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.ph-links a.ph-cta:hover, .ph-links a.ph-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media print { .ph-links a.ph-cta { display: none; } }
.ph-theme-toggle {
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--card); color: var(--fg); cursor: pointer;
}

@media (max-width: 720px) {
  .ph-header { --ph-width: calc(100vw - 32px); flex-wrap: wrap; gap: 10px 12px; }
  .ph-avatar { width: 44px; height: 44px; }
  .ph-identity { gap: 12px; }
  .ph-name { font-size: 1.25rem; }
  .ph-bio { font-size: 0.875rem; }
  .ph-links { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 6px 16px; font-size: 0.925rem; }
}

@media print {
  .ph-header { display: none; }
}
