@import url('https://fonts.googleapis.com/css2?family=Cardo:ital,wght@0,400;0,700;1,400&family=Open+Sans:wght@300;400;700&display=swap');

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

/* ── Skip link ───────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--dark, #111);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Focus visible ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* ── Tokens ────────────────────────────────────────────────────── */
:root {
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --speed:        0.3s;
  --font:         'Open Sans', sans-serif;
  --font-heading: 'Cardo', serif;
  --nav-h:        80px;
  --dark:         #111;
  --mid:          #777;
  --light:        #f5f5f5;
  --max-w:        1200px;
}

/* ── Base ────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--dark);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: 0.03em;
}

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

/* ── Nav ─────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: #fff;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo { line-height: 0; }
.nav-logo img { height: 80px; width: auto; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.1rem;
  flex-wrap: wrap;
  align-self: stretch;
  align-items: stretch;
}

.nav-links li {
  display: flex;
  align-items: stretch;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  font-size: 0.69rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mid);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--speed) var(--ease);
}

.nav-links a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dark);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform var(--speed) var(--ease);
  z-index: -1;
}

.nav-links a:hover::before { transform: scaleY(1); }
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: var(--dark); }
.nav-links a.active:hover { color: #fff; }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: transform var(--speed) var(--ease),
              opacity var(--speed) var(--ease);
}

/* Animated burger → X */
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 4rem;
  align-items: center;
}

.breadcrumb {
  display: flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: rgba(255,255,255,0.9); }

.breadcrumb a:not(:first-child)::before,
.breadcrumb span::before {
  content: '/';
  margin: 0 0.4rem;
}

.hero-content h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-content p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255,255,255,0.8);
}

/* ── Works section ───────────────────────────────────────────────── */
.works {
  padding: 5rem 0;
  background: var(--light);
}

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

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.25rem;
  list-style: none;
}

/* Single-column variant — full width per image */
.works-grid--1col { grid-template-columns: 1fr; }

/* 2-column variant for image-heavy pages */
.works-grid--2col { grid-template-columns: repeat(2, 1fr); }

/* Portrait cards — shows artwork without landscape cropping */
.works-grid--portrait .card-img { aspect-ratio: 2 / 3; }

/* Natural size — no forced aspect ratio, image renders at full height */
.works-grid--natural .card-img { aspect-ratio: unset; background: none; }
.works-grid--natural .card-img img { height: auto; object-fit: unset; }

/* ── Work card ───────────────────────────────────────────────────── */
.work-card a {
  display: block;
  text-decoration: none;
  color: var(--dark);
  outline-offset: 3px;
}

.card-img {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #ddd;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  padding: 0.8rem 0.1rem 0.25rem;
}

.card-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin-left: -0.5rem;
  background: linear-gradient(var(--dark), var(--dark)) no-repeat left center;
  background-size: 0% 100%;
  transition: background-size var(--speed) var(--ease),
              color var(--speed) var(--ease);
}

.work-card a:hover .card-info h3 {
  background-size: 100% 100%;
  color: #fff;
}

.card-info span {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--mid);
}

/* ── Card promo section ──────────────────────────────────────────── */
.card-promo {
  background: #f5f5f5;
}

.card-promo-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-end;
  max-width: var(--max-w);
  margin: 0 auto;
}

.card-promo-text {
  padding: 3rem 0 3rem 2rem;
  text-align: right;
}

.card-promo-text a {
  display: block;
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--dark);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

.card-promo-text a:hover { color: var(--mid); }

.card-promo-img {
  line-height: 0;
}

.card-promo-img a { display: block; }

.card-promo-img img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .card-promo-inner { grid-template-columns: 1fr; }
}

/* ── Dark section divider banner ─────────────────────────────────── */
.hero + .section-divider { border-top: 6px solid #fff; }

.section-divider {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 2rem;
  text-align: center;
}

.section-divider-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.section-divider-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
}

.section-divider h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

/* ── Lightbox (native dialog) ────────────────────────────────────── */
.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
  /* Explicit centering — browser defaults vary */
  position: fixed;
  inset: 0;
  margin: auto;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(0,0,0,0.92);
  cursor: zoom-out;
}

.lightbox img {
  display: block;
  max-width: 88vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}

.lightbox-close:hover { background: rgba(255,255,255,0.28); }

/* ── Project showcase rows ───────────────────────────────────────── */
.project-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.project-row-img {
  overflow: hidden;
}

.project-row-img img {
  width: 100%;
  height: auto;
  display: block;
}

.project-row-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 3rem;
}

.project-row-text p {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--mid);
  margin-bottom: 2rem;
}

/* Slide-fill CTA for project rows */
.project-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dark);
  border: 2px solid var(--dark);
  align-self: flex-start;
  overflow: hidden;
  transition: color var(--speed) var(--ease);
}

/* Fill slides in from left on hover */
.project-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dark);
  transform: translateX(-100%);
  transition: transform var(--speed) var(--ease);
  z-index: 0;
}

.project-link:hover::before { transform: translateX(0); }
.project-link:hover { color: #fff; }

.project-link span {
  position: relative;
  z-index: 1;
}

.project-link::after {
  content: '→';
  position: relative;
  z-index: 1;
  font-size: 1rem;
  transition: transform var(--speed) var(--ease);
}

.project-link:hover::after { transform: translateX(4px); }

@media (max-width: 700px) {
  .project-row { grid-template-columns: 1fr; }
  .project-row-text { padding: 2rem 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .skills-strip-inner { gap: 3rem; }
}

/* ── CTA strip ───────────────────────────────────────────────────── */
.cta {
  position: relative;
  overflow: hidden;
  padding: 5rem 2rem;
  text-align: center;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.cta-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.56);
}

.cta-content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.cta-content h2 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 40px;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              color var(--speed) var(--ease);
}

.btn:hover {
  background: #fff;
  border-color: #fff;
  color: var(--dark);
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3.5rem 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  text-align: center;
}

.footer-logo img { height: 52px; width: auto; }

/* LinkedIn diamond icon */
.linkedin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--dark);
  border-radius: 8px;
  transform: rotate(45deg);
  text-decoration: none;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}

.linkedin-link:hover { background: var(--dark); }

.linkedin-link span {
  display: block;
  transform: rotate(-45deg);
  font-size: 1.05rem;
  font-weight: 800;
  font-style: italic;
  color: var(--dark);
  transition: color var(--speed) var(--ease);
  user-select: none;
}

.linkedin-link:hover span { color: #fff; }

.back-to-top {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

.back-to-top:hover { color: var(--dark); }

/* ── Detail page: text + image layout ───────────────────────────── */
.detail-section { padding: 5rem 0; background: var(--light); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  align-items: start;
}

.detail-text h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.detail-text p {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--mid);
  margin-bottom: 1.5rem;
}

.role-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dark);
  margin: 2rem 0 0.85rem;
}

.role-list { list-style: none; }

.role-list li {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--mid);
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.role-list li::before {
  content: '⊙';
  font-size: 0.8rem;
  color: var(--mid);
  flex-shrink: 0;
}

.btn-dark {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.7rem 1.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dark);
  border: 2px solid var(--dark);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}

.btn-dark:hover { background: var(--dark); color: #fff; }

/* ── Image slider (vanilla JS, no deps) ──────────────────────────── */
.img-slider { position: relative; }

.img-slider-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.img-slider-track::-webkit-scrollbar { display: none; }

.img-slider-track img {
  flex-shrink: 0;
  width: 100%;
  height: auto;
  scroll-snap-align: start;
  display: block;
}

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

.slider-btn:hover { background: rgba(0,0,0,0.75); }
.slider-prev { left: 0.5rem; }
.slider-next { right: 0.5rem; }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 0 0;
}

.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.slider-dot.active { background: var(--dark); }

/* ── Brand logos ─────────────────────────────────────────────────── */
.brand-logos {
  padding: 4rem 2rem;
  background: #fff;
  text-align: center;
}

.brand-logos-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 2.5rem;
}

.brand-logos-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem 3rem;
}

.brand-logos-grid img {
  height: 50px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.45;
  transition: filter var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.brand-logos-grid img:hover { filter: grayscale(0); opacity: 1; }

/* ── Skills strip ────────────────────────────────────────────────── */
.skills-strip {
  position: relative;
  overflow: hidden;
  padding: 4rem 2rem;
}

.skills-strip-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.skills-strip-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
}

.skills-strip-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 5rem;
  flex-wrap: wrap;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: rgba(255,255,255,0.85);
}

.skill-icon {
  width: 46px;
  height: 46px;
  stroke: rgba(255,255,255,0.7);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skill-item span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .nav-burger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    padding: 0.5rem 2rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    gap: 0;
  }

  .nav-links.open { display: flex; }

  .nav-links li { border-bottom: 1px solid rgba(0,0,0,0.06); }
  .nav-links li:last-child { border-bottom: none; }

  .nav-links li { display: block; }

  .nav-links a {
    display: block;
    padding: 0.85rem 0;
    font-size: 0.85rem;
  }

  .nav-links a.active {
    background: var(--dark);
    color: #fff;
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .works-grid { grid-template-columns: 1fr; }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2.5rem 2rem;
  }

}
