:root {
  --bg: #1e2731;
  --ink: #eff1f3;
  --muted: #aab5c0;
  --faint: #919daa;
  --line: #303c48;
  --field: #18202a;
  --accent: #eda54a;
  --accent-hover: #f8bc6e;
  --on-accent: #1e2731;

  --cream-bg: #f0efeb;
  --cream-ink: #1e2731;
  --cream-muted: #545c65;
  --cream-faint: #656d76;
  --cream-line: #dcdad4;
  --cream-accent: #8f5a12;
  --cream-accent-hover: #6f4508;

  --max-width: 1180px;
  --pad: 56px;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

/* 56px of gutter each side leaves only 208px of content on a 320px
   screen, which overflows. Narrow the gutter on small viewports. */
@media (max-width: 480px) {
  :root { --pad: 32px; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.72;
  font-size: 15px;
}

img { max-width: 100%; display: block; }

p { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { color: var(--accent-hover); }

.cream a { color: var(--cream-accent); }
.cream a:hover { color: var(--cream-accent-hover); }

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

.cream { background: var(--cream-bg); color: var(--cream-ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }

strong { color: var(--ink); font-weight: 700; }
.cream strong { color: var(--cream-ink); }

ul.plain, ol.plain { padding-left: 22px; margin: 0; color: var(--muted); }
.cream ul.plain, .cream ol.plain { color: var(--cream-muted); }
ul.plain li, ol.plain li { margin-bottom: 8px; }

.lede {
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 36em;
  margin: 0;
}
.cream .lede { color: var(--cream-muted); }
.lede em { color: var(--accent); font-style: italic; }

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 30px 0 0;
  padding-top: 0;
}
.cream .rule { border-top-color: var(--cream-line); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--cream-line);
  padding-bottom: 16px;
  margin-bottom: 30px;
}
section:not(.cream) .section-header { border-bottom-color: var(--line); }
.section-header h2 { font-size: clamp(28px, 4vw, 36px); }
.section-header a { font-size: 13px; font-weight: 400; white-space: nowrap; }

/* Links & buttons */
.link-primary {
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 5px;
}
.link-primary:hover { color: var(--accent); }

.link-secondary {
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}
.link-secondary:hover { color: var(--ink); }

.action-row { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 34px; }

/* Header */
.site-header {
  background: var(--cream-bg);
  color: var(--cream-ink);
  border-bottom: 1px solid var(--cream-line);
  font-size: 12.5px;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 22px;
}
.site-brand { display: flex; flex-direction: column; gap: 2px; border-bottom: none; line-height: 1.3; }
.site-brand .site-name { color: var(--cream-ink); font-family: var(--serif); font-size: 16px; }
.site-brand .site-location { color: var(--cream-muted); font-size: 12px; }
.site-brand:hover .site-name { color: var(--cream-accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--cream-line);
  border-radius: 0;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--cream-ink);
  font-family: var(--sans);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  border-bottom: none;
  color: var(--cream-muted);
  padding-bottom: 3px;
  font-size: 14.5px;
}
.main-nav a:hover { color: var(--cream-ink); }
.main-nav a[aria-current="page"] {
  color: var(--cream-ink);
  border-bottom: 1px solid var(--cream-accent);
}
.main-nav a.nav-contact { color: var(--cream-accent); }
.main-nav a.nav-contact:hover { color: var(--cream-accent-hover); }
.main-nav a.nav-contact[aria-current="page"] { color: var(--cream-ink); border-bottom: 1px solid var(--cream-accent); }

/* Product Portfolio dropdown */
.main-nav .has-dropdown { position: relative; }
.main-nav .has-dropdown > a::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  vertical-align: 2px;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
}
.main-nav .has-dropdown.is-current-section > a { color: var(--cream-ink); border-bottom: 1px solid var(--cream-accent); }
.main-nav .nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 20;
  min-width: 210px;
  margin: 0;
  padding: 8px 0;
  flex-direction: column;
  gap: 0;
  list-style: none;
  background: var(--cream-bg);
  border: 1px solid var(--cream-line);
}
.main-nav .has-dropdown:hover > .nav-dropdown,
.main-nav .has-dropdown:focus-within > .nav-dropdown { display: flex; }
.main-nav .nav-dropdown a {
  display: block;
  padding: 7px 16px;
  border-bottom: none;
  white-space: nowrap;
}
.main-nav .nav-dropdown a:hover { color: var(--cream-ink); background: var(--cream-line); }
.main-nav .nav-dropdown a[aria-current="page"] {
  color: var(--cream-ink);
  border-bottom: none;
  box-shadow: inset 2px 0 0 var(--cream-accent);
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--cream-line);
    margin-top: 4px;
  }
  .main-nav a { display: block; padding: 8px 0; }

  .main-nav .has-dropdown > a::after { display: none; }
  .main-nav .nav-dropdown {
    display: flex;
    position: static;
    min-width: 0;
    padding: 0 0 6px;
    border: none;
    background: none;
    box-shadow: none;
  }
  .main-nav .nav-dropdown a { padding: 6px 0 6px 16px; font-size: 13.5px; }
  .main-nav .nav-dropdown a:hover { background: none; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 24px;
  padding-bottom: 24px;
}

/* Page title band (About, Skills, Work Experience, Portfolio, Contact) */
.title-band { padding: 62px 0 56px; }
.title-band h1 {
  font-size: clamp(44px, 9vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.title-band .lede { margin-bottom: 30px; }

.about-intro { padding-top: 30px; max-width: 46em; }
.about-intro p { color: var(--muted); margin: 0 0 20px; }
.about-intro p:last-child { margin-bottom: 0; }

.achievement-list {
  list-style: none;
  margin: 4px 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 32px;
}
.achievement-list li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.5;
}
.achievement-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 10px;
  height: 2px;
  background: var(--accent);
}

.timeline {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  max-width: 46em;
}
.timeline li {
  position: relative;
  padding: 0 0 18px 26px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.6;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline strong { color: var(--accent); font-weight: 700; }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 40px;
  padding-top: 30px;
}
.two-col p, .two-col > div { color: var(--muted); }
.cream .two-col p, .cream .two-col > div { color: var(--cream-muted); }
.two-col p { margin: 0 0 20px; }
.two-col p:last-child { margin-bottom: 0; }

section { padding: 56px 0 64px; }

/* Home */
.intro { padding: 52px 0 62px; }
.intro-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.intro-photo img {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: saturate(0.86) contrast(1.03);
}
.photo-caption {
  font-size: 12px;
  line-height: 1.65;
  color: var(--faint);
  margin: 14px 0 0;
}
.home-h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  max-width: 22em;
  margin-bottom: 26px;
}
.home-h1 em { color: var(--accent); font-style: italic; }
.intro-lede {
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink);
  max-width: 36em;
  margin: 0 0 30px;
}
.intro-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 34px;
  margin-top: 26px;
}
.intro-columns p { color: var(--muted); margin: 0; }

@media (max-width: 760px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-photo img { max-width: 200px; }
}

/* Card grids (shipped / portfolio) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.card-grid.portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }

.card { display: block; color: inherit; border-bottom: none; }
.card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.card-title { font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--cream-ink); margin: 14px 0 4px; }
.card-grid.portfolio-grid .card-title { font-size: 16px; }
.card-sub { font-size: 12px; color: var(--cream-faint); }
.card:hover .card-title { color: var(--cream-accent); }

/* Track record / toolbox row grids */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 36px 44px;
}
.feature-grid h3 { font-family: var(--sans); font-size: 16px; font-weight: 700; color: var(--cream-ink); margin-bottom: 8px; }
.feature-grid p { font-size: 14.5px; line-height: 1.72; color: var(--cream-muted); margin: 0; }

/* Toolbox rows (Skills & Education) */
.toolbox-row {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--cream-line);
}
.toolbox-row:last-child { border-bottom: none; }
.toolbox-row h3 { font-family: var(--sans); font-size: 16px; font-weight: 700; color: var(--cream-ink); margin: 0; }
.toolbox-row p { font-size: 14.5px; line-height: 1.72; color: var(--cream-muted); margin: 0; }

/* Courses / education rows (dark) */
.row-list .course { border-top: 1px solid var(--line); padding: 18px 0; }
.row-list .course:first-child { border-top: none; }
.course { display: flex; align-items: flex-start; gap: 14px; }
.course-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 2px;
  background: #fff;
  border-radius: 7px;
  padding: 4px;
  object-fit: contain;
}
.course-body { flex: 1; min-width: 0; }
.course-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.course-title { font-family: var(--sans); font-size: 16px; font-weight: 700; color: var(--ink); }
.course-meta { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.course ul.plain { font-size: 14px; line-height: 1.8; color: var(--muted); margin-top: 10px; }

.edu-rows .course { border-bottom: 1px solid var(--line); border-top: none; padding: 18px 0; }
.edu-rows .course:last-child { border-bottom: none; }

/* Work experience */
.job {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 40px;
}
.job:first-of-type { border-top: none; padding-top: 0; }
@media (max-width: 760px) {
  .job { grid-template-columns: 1fr; gap: 8px; }
  /* Long credential strings cannot stay on one line on a phone. */
  .course-meta { white-space: normal; }
  .toolbox-row { grid-template-columns: 1fr; gap: 6px; }
}

.job-rail { color: var(--faint); }
.job-dates {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.job-dates + .job-dates { margin-top: 18px; }
.job-loc { font-size: 12.5px; color: var(--faint); margin-top: 8px; }

.job-body h3 {
  font-size: 27px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.job-body h3 + h3 { margin-top: 26px; }

.job-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.job-heading + .job-heading { margin-top: 26px; }
.job-heading h3 { margin-bottom: 0; }
.job-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  object-fit: contain;
}
.job-body ul.plain {
  font-size: 15px;
  line-height: 1.72;
  color: var(--muted);
  max-width: 44em;
  margin: 12px 0 0;
}
.job-body ul.plain li + li { margin-top: 8px; }
.job-body p {
  font-size: 15px;
  line-height: 1.72;
  color: var(--muted);
  max-width: 44em;
  margin: 12px 0 0;
}

/* Contact form */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 48px;
  padding-top: 30px;
}
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; }
.submit-btn {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 0;
  padding: 14px 30px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
}
.submit-btn:hover { background: var(--accent-hover); }
.form-note { font-size: 13px; color: var(--faint); margin-top: 16px; }

.contact-links h2 { font-size: clamp(28px, 4vw, 36px); margin-bottom: 20px; }
.contact-links ul { list-style: none; padding: 0; margin: 0 0 24px; }
.contact-links li { margin-bottom: 4px; }
.contact-links a {
  display: inline-block;
  font-size: 15px;
  line-height: 2.1;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.contact-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact-meta { font-size: 13px; color: var(--faint); }

/* Portfolio detail pages (unredesigned internals, inheriting new tokens) */
main { padding: 56px 0 80px; }
main > .container { max-width: var(--max-width); }
main > .container > p:first-child { margin: 0 0 24px; font-size: 13px; }
main > .container > p:first-child a { color: var(--muted); border-bottom: 1px solid var(--line); }
main > .container > p:first-child a:hover { color: var(--ink); }
article h1 {
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
article p { color: var(--muted); line-height: 1.72; margin: 0 0 20px; max-width: 44em; }
article h2 { font-size: clamp(24px, 3.5vw, 30px); margin: 48px 0 16px; border-top: 1px solid var(--line); padding-top: 32px; }
article h2:first-of-type { border-top: none; padding-top: 0; }

.meta-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin: 24px 0 32px;
  font-size: 14px;
  color: var(--ink);
}
.meta-row div span { display: block; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }

.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.img-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.img-gallery.wide { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.img-gallery.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .img-gallery.thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .img-gallery.thirds { grid-template-columns: 1fr; } }

.product-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 0;
}
.product-row figure { margin: 0; }
.product-row img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.product-row figcaption {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
  min-height: 34px;
}
@media (max-width: 760px) { .product-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .product-row { grid-template-columns: 1fr; } }

.img-gallery.cap-3 {
  display: block;
  columns: 2;
  column-gap: 16px;
  max-width: 60%;
}
.img-gallery.cap-3 img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: initial;
  display: block;
  margin: 0 0 16px;
  break-inside: avoid;
}
.img-gallery.cap-3 img.gallery-full { column-span: all; margin-bottom: 12px; }
@media (max-width: 480px) {
  .img-gallery.cap-3 { columns: 1; max-width: 100%; }
}

.app-row-1 { margin: 32px 0 16px; max-width: 60%; }
.app-row-1 img { width: 100%; height: auto; display: block; }

.app-row-2 {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  aspect-ratio: 1.955;
  max-width: 60%;
}
.app-row-2 img {
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.app-row-2 img:first-child { flex-grow: 0.917; }
.app-row-2 img:last-child { flex-grow: 1.038; }
@media (max-width: 480px) {
  .app-row-2 { flex-direction: column; aspect-ratio: auto; }
  .app-row-2 img { flex: none; width: 100%; height: auto; }
}
