/* Peter Nugent — site styles, 2026 */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f4f6f8;
  --bg-card:   #ffffff;
  --fg:        #1b1f24;
  --fg-muted:  #59636e;
  --fg-faint:  #7d8894;
  --rule:      #dfe3e8;
  --accent:    #0b5fa5;
  --accent-fg: #ffffff;
  --accent-soft:#e8f1f9;
  --warn-bg:   #fff8e6;
  --warn-rule: #e0be62;
  --nav-bg:    rgba(255,255,255,0.92);
  --shadow:    0 1px 2px rgba(16,24,40,.06), 0 1px 8px rgba(16,24,40,.05);
  --radius:    10px;
  --measure:   68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0f1418;
    --bg-soft:   #161c22;
    --bg-card:   #171e25;
    --fg:        #e4e9ee;
    --fg-muted:  #9fabb7;
    --fg-faint:  #7b8794;
    --rule:      #2a333c;
    --accent:    #6bb4f0;
    --accent-fg: #08131c;
    --accent-soft:#16283a;
    --warn-bg:   #241f13;
    --warn-rule: #6d5a2a;
    --nav-bg:    rgba(15,20,24,0.92);
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 1px 8px rgba(0,0,0,.3);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
        "Helvetica Neue", Arial, sans-serif;
  font-synthesis-weight: none;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; }

code, pre, tt { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-fg);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Site header / nav ---------- */
.sitehead {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.sitehead .wrap {
  max-width: var(--measure); margin: 0 auto;
  padding: .55rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.5rem;
}
.brand {
  font-weight: 650; font-size: 1.02rem; letter-spacing: -.01em;
  color: var(--fg); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--accent); }
.sitenav { display: flex; flex-wrap: wrap; gap: .1rem .35rem; margin-left: auto; }
.sitenav a {
  display: inline-block;
  padding: .3rem .6rem; border-radius: 6px;
  font-size: .92rem; color: var(--fg-muted); text-decoration: none; white-space: nowrap;
}
.sitenav a:hover { background: var(--bg-soft); color: var(--fg); }
.sitenav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- Layout ---------- */
main { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4rem; }
h2 {
  font-size: 1.35rem; letter-spacing: -.01em; margin: 3rem 0 1rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.06rem; margin: 1.8rem 0 .5rem; }
h2:first-of-type { margin-top: 2rem; }
p { margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.lede { font-size: 1.08rem; color: var(--fg-muted); }
.muted { color: var(--fg-muted); }
.small { font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.hero-text { flex: 1 1 22rem; min-width: 0; }
.hero-photo { flex: 0 0 auto; width: 200px; max-width: 45%; }
.hero-photo img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--rule); display: block;
}
.titleblock { margin: .3rem 0 1.2rem; line-height: 1.5; }
.titleblock .role { font-size: 1.12rem; font-weight: 600; }
.titleblock .org { color: var(--fg-muted); }

/* ---------- Buttons ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; }
.btn {
  display: inline-block; padding: .45rem .95rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg-card); color: var(--fg);
  font-size: .9rem; font-weight: 550; text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-fg); filter: brightness(1.08); }

/* ---------- Cards ---------- */
.cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  margin: 1.25rem 0 0;
}
.card {
  background: var(--bg-card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .links { margin-top: .75rem; font-size: .88rem; }
.card .links a { margin-right: .9rem; white-space: nowrap; }

/* ---------- Definition-style listings (talks, vita, repos) ---------- */
.entries { list-style: none; margin: 1rem 0 0; padding: 0; }
.entries > li {
  padding: .85rem 0; border-bottom: 1px solid var(--rule);
  display: grid; gap: .15rem;
}
.entries > li:last-child { border-bottom: 0; }
.entries .title { font-weight: 600; }
.entries .meta { color: var(--fg-muted); font-size: .92rem; }

.timeline { list-style: none; margin: .75rem 0 0; padding: 0; }
.timeline > li {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: .25rem 1rem;
  padding: .4rem 0; border-bottom: 1px solid var(--rule);
}
.timeline > li:last-child { border-bottom: 0; }
.timeline .when {
  color: var(--fg-muted); font-variant-numeric: tabular-nums;
  font-size: .92rem; white-space: nowrap;
}
@media (max-width: 34rem) {
  .timeline > li { grid-template-columns: 1fr; }
  .timeline .when { order: -1; }
}

.biblio { list-style: none; margin: 1rem 0 0; padding: 0; }
.biblio > li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.biblio > li:last-child { border-bottom: 0; }

/* ---------- Template table ---------- */
.tablewrap { overflow-x: auto; margin: 1.25rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--fg-muted); font-size: .88rem; letter-spacing: .02em; text-transform: uppercase; }
tbody tr:hover { background: var(--bg-soft); }

.tmpl { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1rem 0; background: var(--bg-card); box-shadow: var(--shadow); }
.tmpl h3 { margin-top: 0; }
.tmpl .files { margin-top: .75rem; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .5rem .9rem; }

/* ---------- Callout ---------- */
.callout {
  background: var(--warn-bg); border: 1px solid var(--warn-rule);
  border-left-width: 4px; border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--fg); }

.note { background: var(--bg-soft); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.note p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.contact .addr { font-style: normal; line-height: 1.7; }

/* ---------- Footer ---------- */
.sitefoot {
  border-top: 1px solid var(--rule); margin-top: 3rem;
  background: var(--bg-soft);
}
.sitefoot .wrap {
  max-width: var(--measure); margin: 0 auto; padding: 1.75rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  font-size: .88rem; color: var(--fg-muted);
}
.sitefoot a { color: var(--fg-muted); }
.sitefoot a:hover { color: var(--accent); }
.sitefoot nav { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ---------- Focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
