@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── SKIP LINK (accessibility) ──────────────────────────── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 24px;
  background: var(--amber);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  z-index: 10000;
  transition: top .2s;
}
.skip-link:focus { top: 24px; }


/* ============================================================
   HUBERT MALENDA — PORTFOLIO
   Fonts:  Syne (display) · DM Sans (body)
   Palette: Stormy Morning
   ============================================================ */

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

:root {
  /* ── Stormy Morning palette ─────────────────────────── */

  /* Darks — the heavy pre-dawn sky */
  --storm:       #1a2235;   /* deep night-before-storm navy */
  --storm-mid:   #2a3654;   /* storm cloud blue — slightly lighter surfaces */

  /* Lights — morning mist and silver skies */
  --mist:        #eaf0f8;   /* pale silver-blue mist — main background */
  --mist-deep:   #d8e3f0;   /* slightly deeper mist — alternating sections */

  /* Accents — contrasting light breaking through the storm */
  --rain:        #3f72b3;   /* storm-rain blue — cool, trustworthy */
  --rain-dk:     #305a96;   /* deeper rain for hover states */
  --amber:       #c07830;   /* warm amber sunrise — the light through the clouds */
  --amber-dk:    #a0621c;   /* darker amber for hover */

  /* Typography */
  --text:        #1a2438;   /* near-black with storm-blue cast */
  --text-sub:    #647494;   /* muted blue-grey */
  --border:      #c4d0e3;   /* soft blue-grey border */

  --max: 1000px;

  /* Prevent theme.css overrides */
  --background: var(--mist);
  --foreground: var(--text);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--mist);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Global image quality improvements */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: bicubic;
}

/* For photographic images — smooth rendering beats crisp */
img.photo, .carousel-slide img, .image-frame img, .project-thumbnail img {
  image-rendering: auto;
  image-rendering: high-quality;
}

h1, h2, h3, h4, h5, h6 { font-weight: inherit; font-size: inherit; }

/* ── NAVIGATION ─────────────────────────────────────────── */
.site-nav {
  background: var(--storm);
  height: 80px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-bottom: 2px solid var(--rain);
}
.site-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max);
}
.site-nav .brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.site-nav .brand::after {
  content: '';
  display: block;
  height: 2px;
  width: 0;
  background: var(--amber);
  transition: width .25s ease;
  margin-top: 2px;
}
.site-nav .brand:hover::after { width: 100%; }

.site-nav .nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color .2s;
}
.nav-links a:hover { color: #fff; }

.btn-contact {
  background: var(--amber);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 9px 18px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background .2s, transform .15s;
}
.btn-contact:hover { background: var(--amber-dk); transform: translateY(-1px); }

/* ── READING PROGRESS BAR ──────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--rain), var(--amber));
  z-index: 9999;
  transition: width .1s linear;
  pointer-events: none;
}

/* ── BACK-TO-TOP ────────────────────────────────────────── */
.btn-top {
  position: fixed;
  bottom: 24px;
  right: 32px;
  background: var(--storm);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  padding: 11px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(26,34,53,.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease, background .2s;
}
.btn-top:hover { background: var(--rain); transform: translateY(-3px) !important; }

/* ── MOBILE NAV ─────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  align-items: center;
  justify-content: center;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--storm-mid);
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  padding: 16px 24px 24px;
  border-bottom: 2px solid var(--rain);
  z-index: 99;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: color .2s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { color: #fff; }
.mobile-nav .btn-contact { margin-top: 8px; text-align: center; border-bottom: none; }

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.from-left { transform: translateX(-24px); }
.reveal.scale-in  { transform: scale(0.97); }
.reveal.visible   { opacity: 1; transform: none; }

/* ── CASE STUDY HERO ────────────────────────────────────── */
.hero {
  min-height: 520px;
  background: var(--storm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 180px 24px;
  border-bottom: 3px solid var(--amber);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: .35;
}
.hero-dark { background: var(--storm); }

.hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 6vw, 72px);
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: var(--max);
  line-height: 1.08;
  letter-spacing: -1px;
}
.hero-title.light { color: #fff; }

/* ── TEXT BLOCKS ────────────────────────────────────────── */
.text-block {
  background: var(--mist);
  padding: 56px 24px;
  display: flex;
  justify-content: center;
}
.text-block .content-wrap { max-width: var(--max); width: 100%; }
.text-block .content-wrap p,
.text-block > p {
  font-family: 'DM Sans', sans-serif;
  font-size: 19px;
  line-height: 1.85;
  color: var(--text);
  max-width: var(--max);
  width: 100%;
}
.text-block .content-wrap p + p { margin-top: 22px; }

/* ── SECTION HEADING ────────────────────────────────────── */
.section-heading {
  background: var(--mist);
  padding: 64px 24px 0;
  min-height: 104px;
  display: flex;
  justify-content: center;
}
.section-heading h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--amber);
  max-width: var(--max);
  width: 100%;
  padding-left: 18px;
  border-left: 4px solid var(--rain);
  line-height: 1.4;
}

/* ── IMAGE BLOCK ────────────────────────────────────────── */
.image-block {
  background: var(--mist);
  padding: 48px 24px;
  display: flex;
  justify-content: center;
}
.image-frame {
  width: 100%;
  max-width: var(--max);
  height: 560px;
  position: relative;
  overflow: hidden;
  background: var(--storm-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border-top: 3px solid var(--rain);
}
/* Portrait images — taller frame shows much more detail */
.image-frame.portrait {
  height: 720px;
}
.image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
.image-frame img.cover {
  object-fit: cover;
  object-position: center top;
}
/* Small images — don't upscale past natural size */
.image-frame.natural img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: none;
  position: relative;
  inset: auto;
}
.img-placeholder {
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,.3);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* ── VIDEO BLOCK ────────────────────────────────────────── */
.video-frame {
  width: 100%;
  max-width: var(--max);
  height: 560px;
  background: var(--storm);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.video-frame video { width: 100%; height: 100%; object-fit: contain; }

/* ── QUOTE BLOCK ────────────────────────────────────────── */
.quote-block {
  background: var(--rain);
  padding: 72px 24px;
  display: flex;
  justify-content: center;
}
.quote-text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 22px;
  line-height: 1.7;
  color: #fff;
  text-align: center;
  max-width: 600px;
  position: relative;
}
.quote-text::before {
  content: '\201C';
  display: block;
  font-family: 'Syne', sans-serif;
  font-style: normal;
  font-size: 80px;
  line-height: .75;
  color: rgba(255,255,255,.2);
  margin-bottom: 8px;
}

/* ── SKILLS CLOUD ───────────────────────────────────────── */
.skills-section,
.home-skills-section {
  background: var(--storm);
  padding: 80px 24px;
  display: flex;
  justify-content: center;
  border-top: 3px solid var(--amber);
}
.skills-cloud,
.home-skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  max-width: var(--max);
  width: 100%;
}

/* Skill words alternate rain-blue and amber-gold */
.skills-cloud > *:nth-child(4n+1),
.home-skills-cloud > *:nth-child(4n+1) { color: var(--amber) !important; }
.skills-cloud > *:nth-child(4n+3),
.home-skills-cloud > *:nth-child(4n+3) { color: var(--rain) !important; }
.skills-cloud > *:nth-child(9),
.home-skills-cloud > *:nth-child(9)    { color: var(--amber) !important; }

.skill-word,
.home-skill-word {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.8vw, 46px);
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.skill-icon,
.home-skill-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .55s cubic-bezier(.4,0,.2,1);
  opacity: .45;
}
.skill-icon:hover { transform: rotate(360deg) scale(1.15); opacity: 1; }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--storm);
  border-top: 1px solid rgba(255,255,255,.07);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max);
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,.45);
}
.footer-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}
.footer-contact {
  display: flex;
  gap: 24px;
  align-items: center;
  font-weight: 400;
  font-size: 14px;
}
.footer-linkedin {
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  transition: color .2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.footer-linkedin::before {
  content: 'in';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--rain);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 11px;
  border-radius: 3px;
  flex-shrink: 0;
}
.footer-linkedin:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════ */

.hero-home {
  background: linear-gradient(160deg, #111824 0%, #1a2a44 100%);
  padding: 96px 24px;
  display: flex;
  justify-content: center;
  border-bottom: 3px solid var(--amber);
}
.hero-home-inner {
  max-width: var(--max);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,.1);
  border: 2px solid var(--rain);
  flex-shrink: 0;
}
.hero-home h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 4vw, 42px);
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.hero-home p {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.75;
  color: rgba(255,255,255,.65);
  max-width: 680px;
}
.hero-home p strong { color: #fff; font-weight: 600; }

/* Case studies heading */
.case-studies-heading {
  background: var(--mist-deep);
  padding: 64px 24px 0;
  min-height: 104px;
  display: flex;
  justify-content: center;
}
.case-studies-heading h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.3px;
  color: var(--text);
  max-width: var(--max);
  width: 100%;
}

/* Project cards */
.project-card {
  background: var(--mist-deep);
  padding: 0 24px 56px;
  display: flex;
  justify-content: center;
}
.project-card-inner {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  max-width: var(--max);
  width: 100%;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}
.project-thumbnail {
  flex: 0 0 46%;
  aspect-ratio: 484 / 350;
  background: var(--storm);
  overflow: hidden;
  position: relative;
  border-radius: 4px;
  border-top: 3px solid var(--rain);
}
.project-card:nth-child(even) .project-thumbnail { border-top-color: var(--amber); }

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform .5s ease;
}
.project-thumbnail:hover img { transform: scale(1.04); }

.project-desc {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding-top: 8px;
}
.project-desc h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--text);
}
.project-desc p {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-sub);
}
.btn-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rain);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  align-self: flex-start;
  margin-top: 8px;
  transition: background .2s, transform .15s;
}
.btn-project::after { content: '→'; font-size: 15px; }
.btn-project:hover  { background: var(--amber); transform: translateY(-2px); }

/* Home back-to-top */
.page-wrap { position: relative; }
.btn-top-home {
  position: absolute;
  bottom: 24px;
  right: 32px;
  background: transparent;
  color: rgba(255,255,255,.45);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.btn-top-home:hover { color: #fff; border-color: var(--amber); }

/* ── ORDERED LIST ───────────────────────────────────────── */
.text-block ol {
  padding-left: 0;
  list-style: none;
  counter-reset: item;
  margin-top: 20px;
}
.text-block ol li {
  font-family: 'DM Sans', sans-serif;
  font-size: 19px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 20px;
  padding-left: 44px;
  position: relative;
  counter-increment: item;
}
.text-block ol li:nth-child(odd)::before  { background: var(--rain); }
.text-block ol li:nth-child(even)::before { background: var(--amber); }
.text-block ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 4px;
  width: 26px;
  height: 26px;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── CASE STUDY NAVIGATION ──────────────────────────────── */
.case-nav {
  background: var(--storm-mid);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 0 24px;
  display: flex;
  justify-content: center;
}
.case-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
  max-width: var(--max);
  min-height: 100px;
}
.case-nav-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
  text-decoration: none;
  gap: 5px;
  max-width: 48%;
  transition: opacity .2s;
}
.case-nav-btn:hover { opacity: .65; }
.case-nav-btn.next { align-items: flex-end; text-align: right; margin-left: auto; }
.case-nav-btn.prev { align-items: flex-start; }

.case-nav-btn.prev .case-nav-label { color: var(--rain); }
.case-nav-btn.next .case-nav-label { color: var(--amber); }
.case-nav-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.case-nav-arrow {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  line-height: 1;
}
.case-nav-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

/* ── IMAGE CAROUSEL ─────────────────────────────────────── */
.carousel {
  position: relative;
  width: 100%;
  max-width: var(--max);
  height: 560px;
  overflow: hidden;
  border-radius: 4px;
  border-top: 3px solid var(--rain);
  background: var(--storm-mid);
}
/* Tall carousel for portrait content (Depop posters, web banners) */
.carousel.portrait {
  height: 740px;
}
.carousel-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}
.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--storm-mid);
}
.carousel-slide img {
  /* Default: contain for portrait images — show full poster */
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  /* Sharper downscaling */
  -webkit-font-smoothing: antialiased;
}
/* Landscape carousels (idents, scouts) use cover */
.carousel.landscape .carousel-slide img {
  object-fit: cover;
  object-position: center center;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(26,34,53,.75);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  backdrop-filter: blur(6px);
}
.carousel-btn:hover { background: var(--rain); transform: translateY(-50%) scale(1.1); }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.carousel-dot.active { background: var(--amber); transform: scale(1.4); }
.carousel-counter {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(26,34,53,.7);
  color: rgba(255,255,255,.8);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 10;
  backdrop-filter: blur(6px);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 680px) {
  .project-card-inner    { flex-direction: column; gap: 24px; }
  .project-thumbnail     { flex: 0 0 auto; width: 100%; aspect-ratio: 16/9; }
  .hero                  { padding: 120px 20px; }
  .hero-title            { font-size: 32px; letter-spacing: -.5px; }
  .hero-home             { padding: 64px 20px; }
  /* Desktop nav links hidden on mobile — hamburger takes over */
  .nav-links             { display: none; }
  .nav-toggle            { display: flex; }
  .site-nav              { position: relative; }
  .footer-contact        { display: none; }
  .quote-text            { font-size: 18px; }
  .quote-text::before    { font-size: 56px; }
  .case-nav-title        { font-size: 14px; }
  .carousel              { height: 400px; }
  .carousel.portrait     { height: 560px; }
}
