/* Layne Fester — shared site styles */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --border: #e2e8f0;
  --brand: #1e3a8a;
  --accent: #2563eb;
  --accent-soft: #e0e9fb;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);

  --radius: 10px;
  --radius-lg: 14px;
  --wide: 1080px;
  --narrow: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --surface-2: #16223a;
    --text: #e5ecf6;
    --muted: #a8b5c8;
    --subtle: #8391a7;
    --border: #22304a;
    --brand: #c7d6f5;
    --accent: #6d9eff;
    --accent-soft: #1b2b4d;
    --on-accent: #0b1120;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { color: var(--brand); line-height: 1.2; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 42px); letter-spacing: -0.02em; }
h2 { font-size: 22px; letter-spacing: -0.01em; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 12px; }

.container { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: var(--narrow); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px;
}
.site-name { font-weight: 700; font-size: 18px; color: var(--brand); text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; gap: 4px; }
.nav-link {
  font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
}
.nav-link:hover { color: var(--brand); background: var(--surface-2); }
.nav-link[aria-current="page"] { color: var(--brand); background: var(--accent-soft); }

/* Footer */
.site-footer {
  margin-top: 64px; border-top: 1px solid var(--border);
  background: var(--surface); color: var(--subtle); font-size: 14px;
}
.site-footer .container {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 24px;
}
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: var(--subtle); }
.site-footer a:hover { color: var(--brand); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
  transition: transform 150ms ease, background-color 150ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--secondary { background: var(--surface); color: var(--brand); border-color: var(--border); }
.btn--secondary:hover { border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag {
  font-size: 13px; line-height: 1.4; color: var(--brand);
  background: var(--accent-soft); padding: 3px 10px; border-radius: 999px;
}

/* Page intro */
.page-head { padding: 56px 0 28px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 10px; }
.lede { font-size: 19px; color: var(--muted); margin: 14px 0 0; max-width: 60ch; }
.back-link { display: inline-block; font-size: 15px; margin-bottom: 20px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card h2 { font-size: 20px; }
.card p { color: var(--muted); margin: 0; }
.card .meta { font-size: 14px; color: var(--subtle); margin: -4px 0 0; }
.card .btn-row { margin-top: auto; padding-top: 4px; }
.card-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card--featured { border-left: 4px solid var(--accent); }

/* Home */
.hero { padding: 64px 0 40px; }
.hero .container {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(36px, 6vw, 52px); }
.hero .subtitle { font-size: 18px; font-weight: 500; color: var(--accent); margin: 10px 0 20px; }
.hero p { color: var(--muted); }
.hero .btn-row { margin-top: 28px; }
.hero-photo img {
  width: 100%; max-width: 420px; margin-left: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 18px; box-shadow: var(--shadow);
}
.highlights {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  list-style: none; margin: 0; padding: 0;
}
.highlights li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.highlights strong { display: block; color: var(--brand); margin-bottom: 4px; }
.highlights span { color: var(--muted); font-size: 15px; }
.highlight-badge { display: flex; align-items: center; gap: 16px; }
.highlight-badge img { width: 72px; height: 72px; flex: none; }
.highlight-badge span { display: block; }
.verify-link { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 600; }

/* Articles (case studies) */
.article h2 { margin: 40px 0 12px; }
.article ul { padding-left: 1.2em; margin: 0 0 1em; }
.article li { margin-bottom: 6px; }
.article p, .article li { color: var(--text); }
.glance {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 22px; margin: 8px 0 0;
}
.glance dt { font-size: 13px; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.04em; }
.glance dd { margin: 2px 0 0; }
.figure { margin: 24px 0; }
.figure img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }
.figure figcaption { font-size: 14px; color: var(--subtle); margin-top: 8px; }
.component-list { margin: 0; }
.component-list dt { font-weight: 600; color: var(--brand); margin-top: 14px; }
.component-list dd { margin: 2px 0 0; }

/* Résumé */
.resume { font-size: 15px; line-height: 1.55; }
.resume-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px;
  padding: 40px 0 24px;
}
.resume-head h1 { font-size: 32px; }
.resume-head .lede { font-size: 16px; margin-top: 10px; max-width: 70ch; }
.resume-head .btn { flex: none; }
.resume-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px 40px; align-items: start; }
.resume-main { grid-column: 2; grid-row: 1; }
.resume-side {
  grid-column: 1; grid-row: 1; position: sticky; top: 80px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 4px 20px;
}
.resume-section { padding: 14px 0; border-top: 1px solid var(--border); }
.resume-section:first-child { border-top: 0; }
.resume-section > h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--subtle); margin-bottom: 10px;
}
.resume-section p { margin: 0; }
.entry + .entry { margin-top: 14px; }
.entry-head { display: flex; justify-content: space-between; gap: 2px 16px; flex-wrap: wrap; align-items: baseline; }
.entry-title { font-weight: 700; color: var(--brand); }
.entry-date { font-size: 14px; color: var(--subtle); white-space: nowrap; }
.entry-sub { color: var(--muted); font-size: 14px; margin: 0; }
.entry ul { margin: 6px 0 0; padding-left: 1.1em; }
.entry li { margin-bottom: 3px; }
.skills { margin: 0; }
.skills dt { font-weight: 600; color: var(--brand); font-size: 14px; }
.skills dd { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.skills dd:last-child { margin-bottom: 0; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li + li { margin-top: 3px; }
.resume-side .plain-list, .resume-side p { font-size: 14px; }

/* Contact */
.contact-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.contact-card {
  gap: 14px;
  text-decoration: none; color: inherit;
  transition: border-color 150ms ease, transform 150ms ease;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-tile {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  transition: background-color 150ms ease, color 150ms ease;
}
.contact-card:hover .icon-tile { background: var(--accent); color: var(--on-accent); }
.contact-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-card .label { font-size: 13px; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.04em; }
.contact-card .value { font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.contact-card .hint { font-size: 14px; color: var(--subtle); }
.location { display: flex; align-items: center; gap: 8px; margin-top: 28px; color: var(--muted); }
.location .icon { color: var(--accent); }

/* Shared helpers */
.page-actions { margin-top: 20px; }
.icon { display: block; }

/* Responsive (desktop rules above stay untouched) */
@media (max-width: 899px) {
  .resume-head { flex-direction: column; align-items: flex-start; padding-top: 32px; }
  .resume-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .resume-main, .resume-side { display: contents; }
  .resume-section, .resume-section:first-child { border-top: 1px solid var(--border); }
  .resume-section.r-exp { order: 1; border-top: 0; }
  .r-proj { order: 2; }
  .r-edu { order: 3; }
  .r-cert { order: 4; }
  .r-skills { order: 5; }
  .r-add { order: 6; }
  .r-inv { order: 7; }
}
@media (max-width: 820px) {
  .hero .container { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { order: -1; }
  .hero-photo img { max-width: 220px; margin: 0; }
  .highlights { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header .container { flex-wrap: wrap; gap: 0 12px; padding-block: 8px 4px; }
  .site-nav { width: 100%; margin-left: -10px; }
  .nav-link { font-size: 14px; padding: 11px 10px; }
  .page-head { padding: 36px 0 20px; }
  .hero { padding-top: 36px; }
  .hero .subtitle { font-size: 16px; }
  .hero .subtitle .sep { display: none; }
  .hero .subtitle span { display: block; }
  .entry-head { display: block; }
  .entry-date { display: block; }
  .glance { grid-template-columns: 1fr; gap: 12px; }
  .figure figcaption { font-size: 13px; }
}
@media (max-width: 380px) {
  .site-nav { justify-content: space-between; margin-left: -8px; margin-right: -8px; width: calc(100% + 16px); }
  .nav-link { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
