:root {
  --accent: #ed5f98;
  --bg: #fff;
  --text: #111;
  --muted: rgba(0, 0, 0, 0.45);
  --link: #111;
  --border: rgba(0, 0, 0, 0.12);
  --divider: rgba(0, 0, 0, 0.1);
  --panel-bg: #fff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  --font-sans: "ROM Variable", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Responsive side padding: tight on phones, roomy on desktop */
  --page-pad-x: clamp(16px, 7vw, 96px);
}

html[data-theme="dark"] {
  --bg: #0f1012;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.58);
  --link: rgba(255, 255, 255, 0.92);
  --border: rgba(255, 255, 255, 0.14);
  --divider: rgba(255, 255, 255, 0.12);
  --panel-bg: #16181c;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

html.modal-open,
html.modal-open body {
  overflow: hidden;
}

.image-modal[hidden] {
  display: none !important;
}

/* Ensure the HTML `hidden` attribute always hides elements, even if component CSS sets display values. */
[hidden] {
  display: none !important;
}

@font-face {
  font-family: "ROM Variable";
  src:
    url("https://type.cargo.site/files/CargoROMVariable.woff2") format("woff2-variations"),
    url("https://type.cargo.site/files/CargoROMVariable.woff") format("woff");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: "ROM Variable";
  src:
    url("https://type.cargo.site/files/CargoROMItalicVariable.woff2") format("woff2-variations"),
    url("https://type.cargo.site/files/CargoROMItalicVariable.woff") format("woff");
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
}

body {
  font-family: var(--font-sans);
  line-height: 1.55;
  background: var(--bg);
  font-variation-settings: "slnt" 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.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;
}

.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px var(--page-pad-x);
}

.site-header .header-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
}

.thumb,
.project-detail__hero,
.project-detail__image {
  cursor: zoom-in;
}
.site-title {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
}

.site-title a { color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
  justify-content: flex-end;
  font-size: 16px;
}

.site-nav--mobile {
  display: none;
}

.nav-menu {
  position: relative;
}

.nav-toggle {
  list-style: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.icon--menu {
  width: 22px;
  height: 22px;
}

.nav-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.nav-item {
  display: block;
  padding: 6px 6px;
}

.nav-item--icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-divider {
  height: 1px;
  background: var(--divider);
  margin: 4px 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  fill: currentColor;
  box-sizing: content-box;
}

.theme-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.theme-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}

.theme-icon {
  display: none;
}

html[data-theme="dark"] .theme-icon--sun {
  display: inline-block;
}

html:not([data-theme="dark"]) .theme-icon--moon {
  display: inline-block;
}

/* Reversed LinkedIn icon: dark background + white mark */
.icon--linkedin {
  background: #111;
  color: #fff;
  padding: 2px;
  border-radius: 4px;
}

.site-nav .icon-link {
  /* Match Cargo feel: icons sit on the text baseline */
  display: inline-block;
}

.site-nav .icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.12em;
}

.footer-links .icon {
  width: 16px;
  height: 16px;
}

@media (min-width: 900px) {
  .site-title {
    font-size: 40px;
  }

  .site-nav {
    font-size: 17px;
  }
}

@media (max-width: 720px) {
  .site-header .header-row {
    align-items: center;
  }

  .site-title {
    font-size: 30px;
  }

  .site-title a {
    white-space: nowrap;
  }

  .site-nav--desktop {
    display: none;
  }

  .site-nav--mobile {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
  }
}

main {
  padding-top: 8px;
}

h1, h2 {
  line-height: 1.2;
}

h2 {
  margin-top: 0;
  font-size: 22px;
  font-weight: 600;
}

.muted { color: var(--muted); }

.lede {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 10px;
}

/* Home page intro spacing (aligns closer to Cargo layout) */
.home .lede {
  padding-top: 18px;
  padding-bottom: 4px;
}

.sublede {
  font-size: 18px;
  margin: 0 0 18px;
}

.home .sublede {
  padding-top: 6px;
  padding-bottom: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.work-archive {
  margin: 8px 0 0;
  text-align: left;
}

/* Work page (grid of image cards with titles) */
.work-page h2 {
  margin-bottom: 18px;
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 700px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

@media (min-width: 1100px) {
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
  }
}

.work-card {
  margin: 0;
}

.work-card__link {
  display: block;
}

.work-card__image {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.work-card__title {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 600;
}

/* Project detail pages */
.project-detail__header {
  margin-bottom: 18px;
}

.project-detail__hero {
  margin-top: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.project-detail__image {
  width: 100%;
  display: block;
  margin-top: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.project-detail__section {
  margin-top: 22px;
}

.project-nav {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.project-nav__prev {
  justify-self: start;
}

.project-nav__work {
  justify-self: center;
  font-weight: 600;
}

.project-nav__next {
  justify-self: end;
  text-align: right;
}

@media (max-width: 620px) {
  .project-nav {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .project-nav__prev,
  .project-nav__next {
    justify-self: center;
    text-align: center;
  }
}

.project-detail__section ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.project-detail__two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

@media (min-width: 900px) {
  .project-detail__two-col {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

/* Carousel (Recruiting Platform slides) */
.carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.carousel--solo {
  grid-template-columns: 1fr;
}

.carousel--solo .carousel__control {
  display: none;
}

.carousel--solo .carousel__track {
  grid-auto-flow: row;
  grid-auto-columns: 1fr;
}

.carousel__control {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: inherit;
  cursor: pointer;
}

.carousel__control:disabled {
  opacity: 0.4;
  cursor: default;
}

.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 78%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 4px;
}

@media (min-width: 800px) {
  .carousel__track {
    grid-auto-columns: minmax(320px, 520px);
  }
}

.carousel__slide {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  scroll-snap-align: start;
}

.carousel__slide img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

/* Image modal */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.image-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
}

.image-modal__content {
  position: relative;
  width: min(92vw, 980px);
  max-height: 92vh;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.image-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: inherit;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.image-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: inherit;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

html[data-theme="dark"] .image-modal__nav {
  background: rgba(20, 20, 20, 0.85);
}

.image-modal__nav--prev {
  left: 10px;
}

.image-modal__nav--next {
  right: 10px;
}

.image-modal__img {
  width: 100%;
  height: auto;
  max-height: calc(92vh - 28px);
  object-fit: contain;
  border-radius: 10px;
}

.contact-row {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

/* CV page (Cargo-like 4/8 split and typography) */
.cv-timeline {
  display: block;
  margin: 0;
  width: 100%;
  max-width: none;
}

.cv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .cv-grid {
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
  }
}

.cv .cv-company {
  font-weight: 700;
}

.cv .cv-company-desc {
  color: #999;
  font-style: italic;
}

.cv .cv-role {
  color: var(--accent);
}

.cv hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 18px 0;
}

.cv ul {
  margin: 10px 0 16px;
  padding-left: 18px;
}

.cv ul ul {
  margin-top: 6px;
  list-style: circle;
}

.media-placeholder {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 14px;
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.02);
}

.project {
  margin: 0 0 26px;
}

.project .thumb {
  margin-top: 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.gallery img {
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.project h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.project p {
  margin: 0 0 10px;
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.footer-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.footer-row--center {
  justify-content: center;
}

.footer-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-home {
  text-decoration: none;
}

.footer-home:hover {
  text-decoration: underline;
}

.partial-error {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  padding: 12px 16px;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}
