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

:root {
  --bg: #111827;
  --bg-alt: #1f2937;
  --fg: #f9fafb;
  --fg-secondary: #9ca3af;
  --fg-muted: #6b7280;
  --accent: #60a5fa;
  --accent-btn: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #374151;
  --border-strong: #4b5563;
  --nav-h: 68px;
  --section-pad: 96px;
  --container: 1140px;
  --font: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--fg);
  border-radius: 6px;
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.15s;
}
.skip-link:focus-visible { transform: translateY(0); }

* {
  scrollbar-color: var(--border-strong) var(--bg);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--bg);
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid var(--bg);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--fg-muted);
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 40px; }

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
nav .container { height: 100%; }
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  line-height: 1;
}
.nav-links,
.footer-links { display: flex; list-style: none; gap: 32px; align-items: center; }
.nav-links a,
.footer-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  line-height: 1;
}
.nav-links a:hover,
.footer-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--fg); transition: all 0.25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: var(--bg);
  z-index: 99;
  padding: 32px 40px;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.nav-mobile a:hover { color: var(--accent); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--accent-btn); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--fg); border: 1.5px solid var(--border-strong); }
.btn-outline:hover { border-color: var(--fg-secondary); background: var(--bg-alt); }

/* ===== SECTION COMMON ===== */
section { padding: var(--section-pad) 0; }

.section-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-heading {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-intro {
  font-size: 17px;
  color: var(--fg-secondary);
  line-height: 1.75;
  max-width: 540px;
  margin-bottom: 52px;
}
.divider { height: 1px; background: var(--border); }

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 80px;
  align-items: center;
  padding: 60px 0;
  width: 100%;
}
.hero-name {
  font-size: clamp(52px, 7.5vw, 88px);
  font-weight: 700;
  line-height: 1.0;
  color: var(--fg);
  margin-bottom: 16px;
}
.hero-role {
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: 16px;
}
.hero-desc {
  font-size: 17px;
  color: var(--fg-secondary);
  line-height: 1.8;
  max-width: 500px;
  margin-bottom: 40px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-photo { display: flex; justify-content: flex-end; align-items: center; }
.photo-placeholder {
  --image-position: 40% 100%;
  --image-scale: 1.5;
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--fg-muted);
  overflow: hidden;
}
.photo-placeholder img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--image-position);
  transform: scale(var(--image-scale));
  transform-origin: var(--image-position);
}
.photo-placeholder svg { opacity: 0.3; }
.photo-placeholder span { font-size: 14px; font-weight: 500; opacity: 0.5; }

/* ===== ABOUT ===== */
#about { background: var(--bg-alt); }

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: start;
}
.about-bio {
  font-size: 17px;
  color: var(--fg-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}
.about-bio strong { color: var(--fg); font-weight: 600; }

.info-list { margin-top: 4px; }
.info-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.info-row:first-child { border-top: 1px solid var(--border); }
.info-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-secondary);
}
.info-value { font-size: 16px; font-weight: 500; color: var(--fg); }

/* ===== SKILLS ===== */
#skills { background: var(--bg); }

.skills-list { display: flex; flex-direction: column; }
.skill-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.skill-row:first-child { border-top: 1px solid var(--border); }
.skill-cat {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-secondary);
}
.skill-items {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-secondary);
  line-height: 1.6;
}
.skill-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  vertical-align: middle;
  margin: 0 4px;
  font-size: 0;
}

/* ===== PORTFOLIO ===== */
#portfolio { background: var(--bg-alt); }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.portfolio-card {
  --image-position: top center;
  --image-scale: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}
.portfolio-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
  cursor: pointer;
}
.portfolio-card:focus-visible {
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.28);
}
.portfolio-image {
  aspect-ratio: 16/10;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.portfolio-card-brightspark { --image-position: top center; --image-scale: 1; }
.portfolio-card-whisk { --image-position: top center; --image-scale: 1; }
.portfolio-card-oakfield { --image-position: top center; --image-scale: 1; }
.portfolio-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--image-position);
  transform: scale(var(--image-scale));
  transform-origin: var(--image-position);
}
.portfolio-body { padding: 24px; }
.portfolio-title { font-size: 19px; font-weight: 700; color: var(--fg); margin-bottom: 8px; letter-spacing: -0.01em; }
.portfolio-desc { font-size: 15px; color: var(--fg-secondary); line-height: 1.65; }

/* ===== PROJECTS ===== */
#projects { background: var(--bg); }

.projects-list {
  border-top: 1px solid var(--border);
}
.project-item {
  border-bottom: 1px solid var(--border);
}
.project-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  gap: 32px;
  align-items: center;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
}
.project-summary::-webkit-details-marker { display: none; }
.project-summary::marker { content: ""; }
.project-summary::after {
  content: "+";
  grid-column: 3;
  width: 24px;
  height: 24px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.project-item[open] .project-summary::after {
  transform: rotate(45deg);
}
.project-summary:hover .project-title,
.project-summary:hover::after,
.project-item[open] .project-title,
.project-item[open] .project-summary::after {
  color: var(--accent);
}
.project-title {
  min-width: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.15s;
}
.project-desc {
  padding: 0 88px 28px 0;
  font-size: 16px;
  color: var(--fg-secondary);
  line-height: 1.75;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  line-height: 1.6;
}
.project-tag {
  display: inline-flex;
  align-items: center;
  color: inherit;
}
.project-tag:not(:last-child)::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fg-muted);
  margin: 0 8px;
}

/* ===== CONTACT ===== */
#contact { background: var(--bg-alt); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.contact-heading {
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.contact-text {
  font-size: 16px;
  color: var(--fg-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
}
.contact-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  margin-bottom: 14px;
  transition: color 0.15s;
}
.contact-detail:hover { color: var(--fg); }
.contact-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 14px; font-weight: 600; color: var(--fg); }
.form-input, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--fg-muted); }
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input:focus-visible, .form-textarea:focus-visible { outline: none; }
.form-textarea { resize: vertical; min-height: 130px; }
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form .btn:disabled {
  cursor: wait;
  opacity: 0.75;
}
.form-success,
.form-error {
  display: none;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
}
.form-success {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: #4ade80;
}
.form-error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #f87171;
}
.form-success.show { display: block; }
.form-error.show { display: block; }

/* ===== FOOTER ===== */
footer { padding: 32px 0; background: var(--bg); border-top: 1px solid var(--border); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-link { font-size: 14px; color: var(--fg-secondary); text-decoration: none; transition: color 0.15s; }
.footer-link:hover { color: var(--fg); }
.footer-copy { font-size: 13px; color: var(--fg-secondary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .skill-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 768px) {
  :root { --section-pad: 72px; }
  .container { padding: 0 20px; }
  nav .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .footer-inner { align-items: flex-start; }
  .footer-links { flex-wrap: wrap; gap: 12px 24px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .project-summary {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 16px;
    align-items: start;
  }
  .project-tags {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .project-summary::after {
    grid-column: 2;
    grid-row: 1;
  }
  .project-desc {
    padding-right: 0;
  }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; }
  .btn { justify-content: center; }
}
