/* ==========================================================================
   RESET + THEME VARIABLES
   Change colors here: everything on the site pulls from these variables.
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --bg2: #f5f4f0;
  --ink: #18170f;
  --ink-mid: #5c5a50;
  --ink-light: #9c9a8e;
  --rule: #e0ddd5;
  --accent: #2d4a3e;
  --accent-bg: #e8efe9;
  --accent-text: #2d4a3e;
  --card: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.93);
  --shadow: rgba(0, 0, 0, 0.06);
  --pat: rgba(45, 74, 62, 0.09);
}

[data-theme="dark"] {
  --bg: #0f1209;
  --bg2: #161b10;
  --ink: #eceadf;
  --ink-mid: #9c9a8e;
  --ink-light: #5c5a50;
  --rule: #252a1e;
  --accent: #7ab88a;
  --accent-bg: #1a2b1c;
  --accent-text: #7ab88a;
  --card: #161b10;
  --nav-bg: rgba(15, 18, 9, 0.93);
  --shadow: rgba(0, 0, 0, 0.3);
  --pat: rgba(122, 184, 138, 0.07);
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
  line-height: 1.6;
  transition: background 0.4s, color 0.4s;
  min-height: 100vh;
}

/* dotted background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--pat) 1.2px, transparent 1.2px);
  background-size: 28px 28px;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  height: 54px;
  transition: background 0.4s, border-color 0.4s;
}

.nav-name {
  font-family: "DM Serif Display", serif;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-mid);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 20px;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--bg2);
}

.nav-links a.active {
  color: var(--accent-text);
  background: var(--accent-bg);
}

/* light/dark toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-lbl {
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 28px;
}

.toggle {
  position: relative;
  width: 42px;
  height: 23px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.tog-sl {
  position: absolute;
  inset: 0;
  background: var(--rule);
  border-radius: 24px;
  transition: background 0.3s;
}

.tog-sl::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  background: var(--ink-mid);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}

.toggle input:checked + .tog-sl {
  background: var(--accent-bg);
}

.toggle input:checked + .tog-sl::before {
  transform: translateX(19px);
  background: var(--accent);
}

/* ==========================================================================
   PAGE LAYOUT
   The site is a single HTML file with one <div class="page"> per section;
   script.js shows/hides them instead of doing real page navigation.
   ========================================================================== */
.page {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  min-height: calc(100vh - 54px);
}

.page.active {
  display: flex;
  flex-direction: column;
}

.page.visible {
  opacity: 1;
  transform: translateY(0);
}

.page-inner {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 40px 60px;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--rule);
}

/* ==========================================================================
   HOME
   ========================================================================== */
#page-home .page-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 54px);
  padding-top: 54px;
  padding-bottom: 40px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-tag {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 14px;
}

.hero-name {
  font-family: "DM Serif Display", serif;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.0;
  margin-bottom: 18px;
}

.hero-name em {
  font-style: italic;
  color: var(--accent-text);
}

.hero-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 28px;
  max-width: 380px;
}

.hero-btns {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 11px 24px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
  font-family: "DM Sans", sans-serif;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.btn-ghost {
  font-size: 13px;
  color: var(--ink-mid);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
  font-family: "DM Sans", sans-serif;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink-mid);
}

.stats-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-card {
  border: 1px solid var(--rule);
  padding: 18px 22px;
  background: var(--card);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
}

.stat-num {
  font-family: "DM Serif Display", serif;
  font-size: 30px;
  color: var(--accent-text);
}

.stat-lbl {
  font-size: 12px;
  color: var(--ink-light);
  margin-top: 2px;
  line-height: 1.5;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-intro {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-mid);
  margin-bottom: 20px;
  max-width: 820px;
}

.about-intro strong {
  color: var(--ink);
  font-weight: 500;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.hl-card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  transition: border-color 0.2s;
}

.hl-card:hover {
  border-color: var(--accent);
}

.hl-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.hl-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 4px;
}

.hl-text {
  font-size: 12px;
  color: var(--ink-mid);
  line-height: 1.55;
}

/* ==========================================================================
   EXPERIENCE
   ========================================================================== */
.exp-feature {
  border: 1px solid var(--rule);
  background: var(--card);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.exp-feature:hover {
  box-shadow: 0 6px 24px var(--shadow);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--rule);
}

.exp-co {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 4px;
}

.exp-role {
  font-family: "DM Serif Display", serif;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--ink);
}

.exp-period {
  font-size: 12px;
  color: var(--ink-light);
}

.exp-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-bg);
  color: var(--accent-text);
  padding: 4px 12px;
  white-space: nowrap;
  align-self: start;
}

.exp-body {
  padding: 22px 32px 28px;
}

.exp-intro {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 20px;
}

.achieve-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 22px;
}

.achieve-list li {
  display: flex;
  gap: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-mid);
}

.achieve-list li::before {
  content: "→";
  color: var(--accent-text);
  flex-shrink: 0;
  margin-top: 1px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-bg);
  color: var(--accent-text);
  padding: 4px 11px;
}

.exp-other-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.subsection-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 28px 0 12px;
}

/* ==========================================================================
   ACCORDION (shared pattern)
   Used by: Experience "other roles", Education "other qualifications",
   and the Portfolio "details" panel. One set of rules, reused everywhere:
   add a new collapsible block by reusing these classes, no new CSS needed.
   ========================================================================== */
.accordion {
  border: 1px solid var(--rule);
  background: var(--card);
  overflow: hidden;
  margin-bottom: 8px;
  transition: box-shadow 0.2s;
}

.accordion:hover {
  box-shadow: 0 4px 14px var(--shadow);
}

.accordion-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.accordion-toggle:hover {
  background: var(--bg2);
}

.accordion-arrow {
  font-size: 16px;
  color: var(--ink-light);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 22px;
}

.accordion.open .accordion-body {
  max-height: 900px;
  padding: 4px 22px 22px;
}

.accordion-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 14px;
}

.mini-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mini-list li {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.6;
}

.mini-list li::before {
  content: "·";
  color: var(--accent-text);
  flex-shrink: 0;
}

/* toggle-row text, kept per-section since the hierarchy differs
   (experience leads with an uppercase company name; education and
   portfolio lead with a plain label), not just a styling variant */
.eot-co {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 2px;
}

.eot-role {
  font-size: 13px;
  color: var(--ink-mid);
}

.eot-date {
  font-size: 11px;
  color: var(--ink-light);
  margin-top: 1px;
}

.edt-year {
  font-size: 11px;
  color: var(--ink-light);
  margin-bottom: 2px;
}

.edt-inst {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.edt-qual {
  font-size: 12px;
  color: var(--ink-mid);
  margin-top: 2px;
}

.proj-toggle-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}

.proj-toggle-sub {
  font-size: 11.5px;
  color: var(--ink-light);
  margin-top: 2px;
}

/* ==========================================================================
   SKILLS
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--rule);
}

.skill-cell {
  background: var(--card);
  padding: 26px 30px;
}

.skill-cell-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 14px;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-pill {
  font-size: 12px;
  color: var(--ink-mid);
  border: 1px solid var(--rule);
  padding: 4px 13px;
  background: transparent;
  transition: border-color 0.15s, color 0.15s;
}

.skill-pill:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* ==========================================================================
   EDUCATION
   ========================================================================== */
.edu-featured {
  border: 1px solid var(--accent);
  background: var(--card);
  overflow: hidden;
  margin-bottom: 20px;
}

.edu-featured-header {
  padding: 24px 30px 18px;
  border-bottom: 1px solid var(--rule);
}

.edu-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-bg);
  color: var(--accent-text);
  padding: 3px 11px;
  margin-bottom: 10px;
}

.edu-inst-big {
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 4px;
}

.edu-qual-big {
  font-size: 13.5px;
  color: var(--ink-mid);
  margin-bottom: 4px;
}

.edu-period {
  font-size: 12px;
  color: var(--ink-light);
}

.edu-body {
  padding: 20px 30px 28px;
}

.edu-year-section {
  margin-bottom: 22px;
}

.edu-year-section:last-child {
  margin-bottom: 0;
}

.edu-year-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.course-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 20px;
}

.course-name {
  font-size: 13px;
  color: var(--ink-mid);
  padding: 3px 0;
}

.course-grade {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 3px 0;
  text-align: right;
  white-space: nowrap;
}

.grade-star {
  color: var(--accent-text);
}

/* ==========================================================================
   PORTFOLIO
   ========================================================================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.portfolio-card {
  border: 1px solid var(--rule);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--accent);
}

/* --- photo slideshow (Carlton / QR app / Kauri info) --- */
.slideshow {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--bg2);
  border-bottom: 1px solid var(--rule);
}

.slideshow img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.slideshow img.active {
  opacity: 1;
}

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.slide-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.slide-prev { left: 8px; }
.slide-next { right: 8px; }

.slide-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 10;
}

.slide-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.2s;
}

.slide-dot.active {
  background: #fff;
}

/* mobile screenshot slideshows show the whole screen instead of cropping */
.slideshow-mobile img {
  object-fit: contain;
  background: var(--bg2);
}

.portfolio-info {
  padding: 18px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 5px;
}

.portfolio-desc {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1;
}

.portfolio-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-bg);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.portfolio-link:hover {
  border-color: var(--accent-text);
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
}

.ptag {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-bg);
  color: var(--accent-text);
  padding: 3px 9px;
}

/* "+ Add project" placeholder tile */
.portfolio-add {
  border: 1px dashed var(--rule);
  background: transparent;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  color: var(--ink-light);
  transition: border-color 0.2s, color 0.2s;
  min-height: 240px;
}

.portfolio-add:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.portfolio-add-icon {
  font-size: 26px;
}

.portfolio-add-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-heading {
  font-family: "DM Serif Display", serif;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  margin-bottom: 14px;
}

.contact-heading em {
  font-style: italic;
  color: var(--accent-text);
}

.contact-desc {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  border: 1px solid var(--rule);
  padding: 16px 20px;
  background: var(--card);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.contact-link:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 4px 14px var(--shadow);
}

.cl-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  color: var(--accent-text);
  font-weight: 500;
}

.cl-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  display: block;
  margin-bottom: 1px;
}

.cl-val {
  font-size: 13.5px;
  color: var(--ink);
}

/* ==========================================================================
   FOOTER + SHARED ANIMATION HELPERS
   ========================================================================== */
footer {
  border-top: 1px solid var(--rule);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  margin-top: auto;
}

.footer-name {
  font-family: "DM Serif Display", serif;
  font-size: 14px;
}

.footer-note {
  font-size: 11px;
  color: var(--ink-light);
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 680px) {
  .home-grid, .contact-grid {
    grid-template-columns: 1fr;
  }

  .stats-col {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .stat-card {
    min-width: 150px;
  }

  .skills-grid, .portfolio-grid, .highlights {
    grid-template-columns: 1fr;
  }

  nav {
    padding: 0 16px;
  }

  .nav-links a {
    padding: 5px 8px;
    font-size: 10.5px;
  }

  .page-inner {
    padding: 20px 16px 50px;
  }

  footer {
    padding: 16px;
  }
}
