:root {
  /* Cool Waters palette */
  --baltic: #22577a; /* Baltic Blue */
  --teal: #38a3a5; /* Tropical Teal */
  --mint: #57cc99; /* Mint Leaf */
  --light: #80ed99; /* Light Green */
  --tea: #c7f9cc; /* Tea Green */
  --gold-soft-1: #cdffe6;
  --gold-soft-2: #ffffff;
  --gold-shadow: rgba(0, 0, 0, 0.15);

  /*
    SHUFFLE (inverted order usage)
    Primary flow: Tea -> Light -> Mint -> Teal -> Baltic
  */
  --bg-1: var(--tea);
  --bg-2: var(--light);
  --bg-3: var(--mint);
  --bg-4: var(--teal);
  --bg-5: var(--baltic);

  /* Text (kept dark for contrast on lighter shuffled surfaces) */
  --ink: #07202a;
  --ink-soft: rgba(7, 32, 42, 0.78);
  --white: rgba(255, 255, 255, 0.94);

  /* Surfaces (shuffled to match the new order) */
  --card: linear-gradient(
    180deg,
    rgba(199, 249, 204, 0.94) 0%,
    rgba(128, 237, 153, 0.9) 52%,
    rgba(87, 204, 153, 0.86) 100%
  );

  --card-soft: linear-gradient(
    180deg,
    rgba(199, 249, 204, 0.72),
    rgba(128, 237, 153, 0.58)
  );

  /* Borders and accents (navy keeps structure) */
  --border: 2px solid rgba(34, 87, 122, 0.42);
  --border-strong: 2px solid rgba(34, 87, 122, 0.62);

  /* Radius and shadows */
  --radius: 22px;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.16);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* RESET */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  color: var(--ink);

  /*
    Background uses the SHUFFLED order (Tea -> Light -> Mint -> Teal -> Baltic)
    so the site reads brighter first, deeper last.
  */
  background:
    radial-gradient(
      900px 600px at 15% 20%,
      rgba(255, 255, 255, 0.32),
      transparent 60%
    ),
    radial-gradient(
      900px 700px at 85% 35%,
      rgba(34, 87, 122, 0.16),
      transparent 55%
    ),
    linear-gradient(
      135deg,
      var(--bg-1),
      var(--bg-2),
      var(--bg-3),
      var(--bg-4),
      var(--bg-5)
    );

  background-size: 160% 160%;
  animation: bgMove 18s ease-in-out infinite alternate;
  min-height: 100vh;
}

@keyframes bgMove {
  from {
    background-position: 0% 12%;
  }
  to {
    background-position: 100% 88%;
  }
}

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

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);

  /* Header stays bright to match shuffled palette start */
  background: rgba(199, 249, 204, 0.55);
  border-bottom: 1px solid rgba(34, 87, 122, 0.22);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: var(--border-strong);
  display: grid;
  place-items: center;

  /* Shuffled: brighter start, deeper end */
  background: radial-gradient(
    circle at 30% 30%,
    rgba(199, 249, 204, 0.96),
    rgba(56, 163, 165, 0.9)
  );

  box-shadow: 0 0 22px rgba(56, 163, 165, 0.36);
}

.brand-mark span {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  color: var(--ink);
}

.brand-name strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 18px;
}

.brand-name small {
  font-size: 12px;
  opacity: 0.9;
}

/* NAV */
.nav-links {
  display: flex;
  gap: 14px;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 14px;
  transition: all 240ms var(--ease);
  text-decoration: none;
  color: var(--ink);
}

.nav-links a:hover {
  background: rgba(128, 237, 153, 0.28);
  border: 1px solid rgba(34, 87, 122, 0.22);
}

.nav-links a.active {
  background: rgba(34, 87, 122, 0.16);
  border: 1px solid rgba(34, 87, 122, 0.34);
}

/* HERO */
.hero {
  padding: 96px 0 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
}

/* CARD BASE */
.card {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 320ms var(--ease),
    box-shadow 320ms var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      420px 220px at 20% 0%,
      rgba(255, 255, 255, 0.38),
      transparent 62%
    ),
    radial-gradient(
      420px 220px at 80% 100%,
      rgba(255, 255, 255, 0.16),
      transparent 68%
    );
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 44px 90px rgba(0, 0, 0, 0.28);
}

.card-inner {
  position: relative;
  padding: 32px;
}

/* TEXT */
.kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--ink);
  opacity: 0.9;
}

.h1 {
  font-family: "Playfair Display", serif;
  font-size: 56px;
  line-height: 1.02;
  margin: 12px 0;
  color: var(--ink);
}

.lead {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 22px;
  color: var(--ink-soft);
}

/* BADGES */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border: 1px solid rgba(34, 87, 122, 0.22);
  font-size: 13px;
}

/* IMAGE */
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* SECTIONS */
.section {
  padding: 80px 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
}

.section-title h2 {
  font-family: "Playfair Display", serif;
  font-size: 34px;
  color: var(--ink);
}

.section-title p {
  font-size: 14px;
  opacity: 0.9;
  color: var(--ink-soft);
}

/* MINI CARDS */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.mini {
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow-soft);
  padding: 26px;
  transition: transform 260ms var(--ease);
}

.mini:hover {
  transform: translateY(-5px);
}

.mini h3 {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  margin: 0 0 10px;
}

.mini p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* WORK */
.work {
  display: grid;
  gap: 22px;
}

.work-item {
  background: rgba(255, 255, 255, 0.54);
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow-soft);
  padding: 28px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.work-item h3 {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  margin: 0 0 14px;
  color: var(--ink);
}

/* Work item with side image (only where needed) */
.work-item.has-image {
  grid-template-columns: 0.55fr 1.2fr 0.8fr;
  align-items: stretch;
}

.work-thumb {
  align-self: stretch;
  padding: 10px;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: calc(var(--radius) - 10px);
  border: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

/* Responsive: stack image on top */
@media (max-width: 980px) {
  .work-item.has-image {
    grid-template-columns: 1fr;
  }

  .work-thumb {
    order: -1;
    height: 240px;
    padding: 12px;
  }

  .work-thumb img {
    height: 100%;
  }
}

/* TAGS */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;

  /* Shuffled brighter chip */
  background: rgba(199, 249, 204, 0.66);
  border: 1px solid rgba(34, 87, 122, 0.2);
  color: var(--ink);
  font-size: 13px;
}

/* WORK META */
.work-meta {
  align-self: start;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(34, 87, 122, 0.22);
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-row span::after {
  content: ":\00a0";
}

.meta-row span {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.meta-row strong {
  font-size: 13px;
  color: var(--ink);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

/* ACCORDION */
.work-accordion {
  margin-top: 10px;
}

.work-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab-btn {
  appearance: none;
  border: 1px solid rgba(34, 87, 122, 0.28);

  /* Buttons follow shuffled order: tea/light highlights */
  background: rgba(199, 249, 204, 0.6);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    border 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.tab-btn:hover {
  transform: translateY(-1px);
  background: rgba(128, 237, 153, 0.5);
  border: 1px solid rgba(34, 87, 122, 0.42);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.tab-btn:focus-visible {
  outline: 3px solid rgba(56, 163, 165, 0.45);
  outline-offset: 3px;
}

.tab-btn[aria-expanded="true"] {
  background: rgba(56, 163, 165, 0.26);
  border: 1px solid rgba(34, 87, 122, 0.55);
}

.tab-panel {
  border: 1px solid rgba(34, 87, 122, 0.22);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  padding: 16px 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.tab-panel.is-open {
  animation: panelIn 220ms var(--ease) both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bullet {
  margin: 0;
  padding-left: 18px;
}

.bullet li {
  margin: 8px 0;
  line-height: 1.55;
  font-size: 15px;
  color: var(--ink);
}

.work-link {
  margin: 14px 0 0;
}

.work-link a {
  font-weight: 800;
  text-decoration: none;
  color: var(--baltic);
  border-bottom: 2px solid rgba(34, 87, 122, 0.28);
}

.work-link a:hover {
  color: rgba(34, 87, 122, 0.92);
  border-bottom-color: rgba(34, 87, 122, 0.48);
}

.work-foot {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* FOOTER */
footer {
  padding: 56px 0;
}

.footer-card {
  background: rgba(199, 249, 204, 0.52);
  border: 1px solid rgba(34, 87, 122, 0.24);
  border-radius: var(--radius);
  padding: 22px;
  font-size: 13px;
  color: var(--ink);
}

/* Portfolio hero image */
.image-card,
.portfolio-hero-image {
  position: relative;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.image-card img,
.portfolio-hero-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

/* Uniform image card style */
.image-card {
  padding: 12px;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.image-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}

/* Fix contact image border */
.contact-photo {
  min-height: auto;
  padding: 0;
  display: block;
}

/* sr-only helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .work-item {
    grid-template-columns: 1fr;
  }
  .h1 {
    font-size: 42px;
  }
}

@media (min-width: 981px) {
  .work-item {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 22px;
  }
}

@media (max-width: 980px) {
  .work-item {
    display: block;
  }
}

.work-meta {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.meta-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: start;
}

.content-divider {
  border: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 32px 0;
}

.content-block {
  max-width: 860px;
}

/* CV PAGE - structure + spacing */
.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 980px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.separator,
.content-divider {
  border: none;
  height: 1px;
  background: rgba(34, 87, 122, 0.18);
  margin: 34px 0;
}

.cv-block {
  margin-top: 12px;
  display: grid;
  gap: 18px;
}

.cv-card {
  background: linear-gradient(
    180deg,
    var(--gold-soft-1) 0%,
    var(--gold-soft-2) 100%
  );
  border: 1px solid rgba(34, 87, 122, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px var(--gold-shadow);
  padding: 26px;
}

.cv-card h3 {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  margin: 0 0 14px;
}

.cv-role {
  padding: 18px 0;
  border-top: 1px solid rgba(34, 87, 122, 0.18);
}

.cv-role:first-child {
  padding-top: 0;
  border-top: none;
}

.cv-role-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 8px;
}

.cv-role-title strong {
  font-size: 15px;
  color: var(--ink);
}

.cv-role-title span {
  font-size: 13px;
  color: var(--ink-soft);
}

.cv-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.cv-list li {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--ink);
  font-size: 15px;
}

.cv-list li em {
  font-style: normal;
  font-weight: 700;
}

.cv-meta {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.cv-meta .meta-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: start;
}

.cv-meta .meta-row strong {
  white-space: normal;
  text-align: left;
}

/* Optional: make the right column meta look tighter on CV */
@media (max-width: 980px) {
  .cv-meta {
    max-width: none;
  }
}

/* Footer link fix (no --gold in this palette) */
.footer-card a.footer-credit {
  color: var(--baltic);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(34, 87, 122, 0.35);
}

.footer-card a.footer-credit:hover {
  border-bottom-color: rgba(34, 87, 122, 0.6);
}

/* NAV MOBILE + TABLET */
.nav {
  gap: 16px;
}

.nav-toggle {
  display: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(34, 87, 122, 0.28);
  border-radius: 14px;
  width: 46px;
  height: 46px;
  cursor: pointer;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.1);
}

.nav-toggle:hover {
  transform: translateY(-1px);
  background: rgba(199, 249, 204, 0.7);
}

.nav-toggle:focus-visible {
  outline: 3px solid rgba(56, 163, 165, 0.45);
  outline-offset: 3px;
}

.nav-toggle-bars {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(34, 87, 122, 0.9);
  margin: 0 auto;
  position: relative;
  border-radius: 2px;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: rgba(34, 87, 122, 0.9);
  border-radius: 2px;
}

.nav-toggle-bars::before {
  top: -7px;
}

.nav-toggle-bars::after {
  top: 7px;
}

/* Tablet: allow wrapping but keep neat */
@media (max-width: 980px) {
  .nav-links {
    gap: 10px;
  }

  .nav-links a {
    padding: 10px 12px;
  }
}

/* Mobile menu */
@media (max-width: 760px) {
  .nav {
    padding: 12px 0;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    position: relative;
    z-index: 80;
  }

  .nav-links {
    position: fixed;
    top: 74px; /* below sticky header */
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    width: min(560px, calc(100vw - 22px));
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(34, 87, 122, 0.22);
    background: rgba(199, 249, 204, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18);

    display: grid;
    gap: 10px;

    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 70;

    transition:
      opacity 180ms var(--ease),
      transform 180ms var(--ease),
      visibility 180ms var(--ease);
  }

  .nav-links a {
    display: block;
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(34, 87, 122, 0.16);
  }

  body.nav-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  /* Optional: subtle page dim when menu open */
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: 40;
  }

  header {
    z-index: 50;
  }
}

/* Fix overflow on Portfolio cards (long meta text) */
@media (max-width: 980px) {
  html,
  body {
    overflow-x: hidden;
  }

  .work-item {
    width: 100%;
    overflow: hidden;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .meta-row span {
    white-space: normal;
  }

  .meta-row strong {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .work-meta {
    max-width: none;
  }
}

/* Portfolio tabs: wrap on mobile */
@media (max-width: 760px) {
  .work-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
  }
}

/* CV: make accordions look clean and always visible */
.page-cv .work-item {
  align-items: start;
}

.page-cv .work-tabs {
  flex-wrap: wrap;
  overflow: visible;
}

.page-cv .tab-btn {
  flex: 0 0 auto;
}

/* Safety: hidden panels must disappear fully */
.page-cv .tab-panel[hidden] {
  display: none;
}

/* Prevent cut cards in CV layout */
.page-cv .work-item,
.page-cv .cv-card {
  overflow: visible;
}

/* CV list typography inside panels */
.page-cv .cv-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.page-cv .cv-list li {
  margin: 8px 0;
  line-height: 1.6;
}

/* CV accordions: clean + modern */
.page-cv .cv-item {
  align-items: start;
}

.page-cv .cv-left {
  min-width: 0;
}

.page-cv .cv-acc-btn {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(34, 87, 122, 0.28);
  background: rgba(199, 249, 204, 0.6);
  color: var(--ink);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    border 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.page-cv .cv-acc-btn:hover {
  transform: translateY(-1px);
  background: rgba(128, 237, 153, 0.5);
  border: 1px solid rgba(34, 87, 122, 0.42);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.page-cv .cv-acc-btn:focus-visible {
  outline: 3px solid rgba(56, 163, 165, 0.45);
  outline-offset: 3px;
}

.page-cv .cv-acc-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 87, 122, 0.22);
  background: rgba(255, 255, 255, 0.62);
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.page-cv .cv-acc-panel {
  margin-top: 12px;
  border: 1px solid rgba(34, 87, 122, 0.22);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  padding: 18px 18px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.page-cv .cv-acc-panel[hidden] {
  display: none;
}

/* Prevent clipping on mobile */
@media (max-width: 980px) {
  .page-cv .work-item {
    overflow: visible;
  }
}
