/* =========================================================
   Chris Britton - personal site
   Theme is driven by CSS variables. Change the navy palette
   below and the whole site reskins. Dark mode overrides sit
   under [data-theme="dark"].
   ========================================================= */

:root {
  /* Navy-forward palette */
  --navy-900: #0a1733;
  --navy-800: #0f2147;
  --navy-700: #16305f;
  --navy-600: #1e3f7a;
  --navy-500: #2b5aa6;
  --accent:   #ea6a1e;  /* orange for CTAs / links (light mode) */
  --accent-2: #ff8a3d;  /* lighter orange accent */

  --bg:        #f6f8fc;
  --bg-alt:    #eef2f9;
  --surface:   #ffffff;
  --text:      #0f1b33;
  --text-soft: #3a4a66;  /* firmer secondary text for stronger contrast */
  --border:    #dde4f0;
  --shadow:    0 10px 30px rgba(15, 33, 71, 0.08);

  --radius:    14px;
  --radius-sm: 10px;
  --maxw:      1080px;
  --content-maxw: 1000px;  /* shared inner width so sections align */

  --font-sans:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
}

[data-theme="dark"] {
  --bg:        #070e20;
  --bg-alt:    #0b1630;
  --surface:   #0f1d3d;
  --text:      #e8eefc;
  --text-soft: #9db0d4;
  --border:    #1c2c52;
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
  --accent:    #ff8a3d;  /* brighter orange reads well on deep navy */
  --accent-2:  #ffa968;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.01em; }

/* Accessibility: a clear, on-brand focus ring for keyboard users.
   :focus-visible shows only for keyboard navigation, not mouse clicks,
   so it helps keyboard/screen-reader users without affecting mouse users. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Inputs keep their own focus treatment (the orange glow), so suppress
   the double ring on them. */
.field input:focus-visible,
.field textarea:focus-visible { outline: none; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  /* Roughly half-and-half: orange leads in from the top-left and
     blends through to navy across the middle. */
  background: linear-gradient(135deg, var(--accent) 0%, var(--navy-500) 55%, var(--navy-600) 100%);
  background-clip: padding-box;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(30, 63, 122, 0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  /* Roughly half-and-half navy-to-orange, matching the buttons. */
  background: linear-gradient(135deg, var(--navy-600) 0%, var(--navy-500) 45%, var(--accent) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.brand-name { font-family: var(--font-display); font-size: 1.05rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a { color: var(--text-soft); font-weight: 500; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-socials { display: flex; gap: 14px; }
.nav-socials a { color: var(--text-soft); display: inline-flex; }
.nav-socials a:hover { color: var(--accent); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle, .nav-toggle-label { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 64px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(234,106,30,0.12), transparent 70%),
    radial-gradient(50% 50% at 90% 10%, rgba(30,63,122,0.14), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 8px; }
.role {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 18px;
}
.lead { font-size: 1.15rem; color: var(--text-soft); margin: 0 0 24px; max-width: 46ch; }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-cta-divider {
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  background: var(--border);
}
.hero-socials { display: flex; gap: 18px; }
.hero-socials a { color: var(--text-soft); }
.hero-socials a:hover { color: var(--accent); }

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  position: relative;
  width: 280px; height: 320px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  display: none;
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-display);
  font-weight: 600;
}
.photo-frame.photo-empty .photo-placeholder { display: block; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 8px; }
.section-sub { color: var(--text-soft); margin: 0 0 36px; }

/* About - centred heading to match other sections; prose stays
   left-aligned inside a centred column for readability. */
#about .section-title { text-align: center; }
.about-text { max-width: var(--content-maxw); margin: 0 auto; }
.about-text p { margin: 0 0 18px; color: var(--text-soft); }
.about-text p:first-child { color: var(--text); font-size: 1.08rem; }
/* Skills & certifications - two columns: certs left, skill tiles right */
#skills .section-title { text-align: center; }
.skillcert-layout {
  display: grid;
  /* Certs is a short text list; give the skills grid more width so the
     3-wide tiles and longer labels sit comfortably. */
  grid-template-columns: 0.75fr 1fr;
  gap: 48px;
  align-items: start;
  max-width: var(--content-maxw);
  margin: 0 auto;
}
.skills-block h3,
.certs h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}
.certs h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}
.certs-verify { font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500; }
.certs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.certs li {
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Fixed-width icon slot: logos can differ in size but the text after
   each always starts at the same x position and shares a baseline.
   The slot is a fixed width; each SVG keeps its own dimensions,
   centred within it. */
.certs li .cert-icon {
  flex: 0 0 36px;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* "aws" wordmark uses currentColor so it follows the text colour in both
   themes; only the smile-arrow stays AWS orange (legible on light + dark). */
/* Beyond the cloud (interests) */
.beyond-intro { text-align: center; max-width: 680px; margin: 0 auto; }
.interests {
  list-style: none;
  margin: 0 auto; padding: 0;
  max-width: var(--content-maxw);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.interests li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.interests .emoji {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  /* Keep native emoji colour regardless of theme */
}
/* Skills grid - 3-wide square (9 disciplines = tidy 3x3). Equal row
   heights (grid default) plus flex-centred content means a 1-line and
   a 2-line label render as the same size tile. */
.skills-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.skills-grid li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  min-height: 72px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Skills are labels, not links - no hover affordance, so readers
   aren't misled into thinking they're clickable. */



/* Work cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); text-decoration: none; }
.card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.card p { margin: 0 0 16px; color: var(--text-soft); font-size: 0.95rem; }
.card-tags { font-size: 0.78rem; color: var(--accent); font-weight: 600; letter-spacing: 0.03em; }

/* Contact - centred heading/intro with the form below */
.contact-layout { max-width: 620px; margin: 0 auto; }
.contact-intro { text-align: center; }
.contact-intro .section-sub { margin-bottom: 36px; }

/* Contact form */
.contact-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234,106,30,0.18);
}
.field textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 4px 0 0; font-weight: 500; min-height: 1.4em; }
.form-status.ok { color: #16a34a; }
.form-status.err { color: #dc2626; }

/* Confirmation panel shown in place of the form after a successful send. */
.form-success {
  text-align: center;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-success-tick {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--navy-500) 70%);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}
.form-success h3 { margin: 0 0 6px; font-size: 1.25rem; }
.form-success p { margin: 0; color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg-alt);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; color: var(--text-soft); }
.footer-socials { display: flex; gap: 20px; }
.footer-socials a { color: var(--text-soft); font-weight: 500; }
.footer-socials a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-photo { justify-content: flex-start; }

  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
  }
  .nav-toggle-label span {
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 22px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }
  .nav-links li { width: 100%; }
  .nav-socials { padding-top: 6px; }
  .nav-toggle:checked ~ .nav-links {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .skillcert-layout { grid-template-columns: 1fr; gap: 32px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .interests { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
