:root {
  --coral: #ff5248;
  --white: #fff;
  --off: #f9f9f9;
  --ink: #1a1a1a;
  --muted: #777;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Montserrat', Arial, sans-serif;
  --header-h: 70px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  background: #fff;
  color: #111;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.main-header {
  height: var(--header-h);
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4.2%;
  color: #fff;
  background: var(--coral);
  transition: background 0.35s, color 0.35s, box-shadow 0.35s;
}

.main-header.scrolled {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 1px 18px #1a1a1a0b;
  backdrop-filter: blur(12px);
}

.nav-left {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Pins left nav to the left edge */
  gap: clamp(16px, 2.3vw, 34px);
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Pins social links to the right edge */
  gap: clamp(16px, 2.3vw, 34px);
}

.nav-left a,
.social-links a {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}

.nav-left a:hover,
.social-links a:hover {
  transform: translateY(-3px);
  opacity: 0.65;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center; /* Ensures the logo sits strictly in the center grid column */
}

.header-logo-svg {
  width: 50px;
  height: auto;
  display: block;
}

.social-links {
  justify-content: flex-end;
  gap: 18px;
}

.social-links a {
  font-size: 13px;
  letter-spacing: 0;
}
/* ==========================================================================
   RESPONSIVE HEADER (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 767px) {
  .main-header {
    grid-template-columns: auto 1fr;
    padding: 0 20px;
  }

  /* Hide social icons on mobile */
  .nav-right.social-links {
    display: none;
  }

  /* Move logo to the first column (left) */
  .logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .header-logo-svg {
    width: 40px;
  }

  /* Move navigation to the second column (right) */
  .nav-left {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    gap: 18px;
  }

  /* Slightly larger tap targets for touch screens */
  .nav-left a {
    font-size: 11px;
    padding: 8px 2px;
  }
}
/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  height: 100svh;
  min-height: 620px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: var(--coral);
  background-image: url('images/tullips.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  color: #fff;
}

.hero-plain-layer {
  position: absolute;
  inset: 0; /* Changed from -2% to 0 so it matches the base image dimensions perfectly */
  background-image: url('images/tullips-plain.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  /* 300x300px circular mask with integrated soft SVG outline halo */
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><circle cx="150" cy="150" r="147" fill="black"/><circle cx="150" cy="150" r="148.5" fill="none" stroke="rgba(255,255,255,0.4)" stroke-width="2"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><circle cx="150" cy="150" r="147" fill="black"/><circle cx="150" cy="150" r="148.5" fill="none" stroke="rgba(255,255,255,0.4)" stroke-width="2"/></svg>');
  -webkit-mask-size: 300px 300px;
  mask-size: 300px 300px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(47, 25, 24, 0.6);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  will-change: backdrop-filter;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 100px 24px 80px;
}

.hero-content h1 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin: 0 15% 20px;
  color: #fff;
}

.hero-content p {
  font-size: 16px;
  color: #ffffffd9;
  margin-bottom: 30px;
}

.scroll-down-btn {
  color: var(--white);
  font-size: 20px;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */
.about-section {
  position: relative;
  overflow: hidden;
  background: var(--coral);
  color: #fff;
  padding: 120px 40px;
}
.about-section::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -30px;
  width: 240px;
  height: 300px;
  background-image: url('images/tullips.svg'); 
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: contain;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.section-accent {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: #ffffffb8;
  display: inline-block;
  margin-bottom: 15px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.15;
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin: 0 0 30px;
}

.about-container {
  max-width: 900px;
  margin: 0 auto;
}

.text-only-about {
  text-align: center;
}

.about-bio-text {
  max-width: 750px;
  margin: 0 auto 35px;
}

.about-bio-text p {
  font-size: 16px;
  line-height: 1.9;
  color: #ffffffdc;
  margin-bottom: 20px;
}

.cv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--white);
  color: var(--coral);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 100px;
  transition: transform 0.25s, box-shadow 0.25s;
}

.cv-download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.about-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 50px;
  margin-top: 60px;
  text-align: left;
}

.skill-group h4 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0 0 12px;
}

.skill-group p {
  font-size: 13px;
  line-height: 1.8;
  color: #ffffffd9;
  margin: 0;
}

.portfolio-header-centered {
  text-align: center;
  margin-top: 80px;
}

/* ==========================================================================
   WORK & PORTFOLIO GRID FIX
   ========================================================================== */
.gallery-section {
  width: 100%;
  display: block;
}
/* ==========================================================================
   WORK SECTION HEADINGS & TITLES
   ========================================================================== */
.portfolio-header-centered {
  text-align: center;
  margin-top: 70px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.portfolio-header-centered .section-accent {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: #ffffffb8;
  display: inline-block;
  margin-bottom: 15px;
}

.portfolio-header-centered .section-title {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.15;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: #fff;
  margin: 0;
}

.work-heading {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 60px;
  padding: 80px 24px 0 24px;
}

.work-heading .section-kicker {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--coral);
  display: inline-block;
  margin-bottom: 12px;
}

.work-heading h2 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.15;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--ink);
  margin: 0 0 15px;
}

.work-heading p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: 100%;
}

.project-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #2a2a2a; /* Fallback background color if thumbnail is missing */
  display: block;
}

.card-image {
  width: 100%;
  height: 100%;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.project-card:hover .card-image img {
  transform: scale(1.05);
}

/* Make overlay visible or semi-visible by default so cards aren't blank */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20, 16, 14, 0.85) 0%, rgba(20, 16, 14, 0.3) 60%, transparent 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 24px;
  opacity: 0; /* Hidden by default */
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.project-card:hover .card-overlay,
.project-card:focus-within .card-overlay {
  opacity: 1; /* Appears smoothly on hover */
  visibility: visible;
}

.card-overlay h3 {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 24px);
  margin: 0 0 6px;
  line-height: 1.2;
}

.card-overlay p {
  font-size: 11px;
  letter-spacing: 0em;
  text-transform: uppercase;
  opacity: 0.9;
  margin: 0;
  color: var(--white); /* Accent color tint for subtitle */
  font-weight: 200;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .card-overlay {
	  opacity: 1;
	  visibility: visible;
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
/* ==========================================================================
   CASE STUDY EDITORIAL LAYOUT (tinqin.html)
   ========================================================================== */
.case-study-page {
  background-color: var(--white);
}

.editorial-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 60px) 24px 100px;
}

.editorial-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 60px;
}

.project-number-accent {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--coral);
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}

.editorial-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 15px;
  color: var(--ink);
}

.editorial-subtitle {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.two-column-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  align-items: start;
}

.sticky-sidebar {
  position: sticky;
  top: 100px;
}

.meta-block {
  margin-bottom: 25px;
}

.meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 5px;
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
}

.mini-swatches {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.right-col {
  min-width: 0;
}

.media-frame {
  margin: 0 0 24px 0;
  padding: 0;
  background: transparent; /* Removes any default background framing */
  border: none;
  width: 100%;
  overflow: hidden;
}

.media-frame img,
.media-frame video,
.media-frame iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  object-fit: cover; 
  border-radius: 5px;
}
.video-container {
  width: 100%;
  max-width: 100%;
  margin-bottom: 35px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
}

.video-container video,
.video-container iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.text-block {
  margin: 40px 0;
}

.text-block h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}

.text-block p {
  font-size: 14px;
  line-height: 1.8;
  color: #444;
  margin: 0;
}

.inline-two-up {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 35px;
}

.inline-two-up .media-frame {
  margin: 0;
}

.project-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #ddd;
  padding-top: 24px;
  margin-top: 100px;
}

.project-pagination a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--sans); 
}


.project-pagination a:hover {
	color: var(--coral);
}

.project-pagination a.prev-project {
  text-align: left;
}

.project-pagination a.next-project {
  text-align: right;
  margin-left: auto;
}

.project-pagination span {
  font-family: var(--sans);
  font-size: 8px;
  color: #999;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-pagination strong {
  font-family: var(--sans); /* Switches heading text to sans-serif */
  font-size: 16px;
  font-weight: 700;
}

.project-pagination a:hover strong {
  color: var(--coral);
}

/* ==========================================================================
   CONTACT SECTION & FOOTERS
   ========================================================================= */
.contact-section {
  background: var(--off);
  padding: 100px 24px;
  text-align: center;
}

.contact-accent {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--coral);
  display: inline-block;
  margin-bottom: 15px;
}

.contact-subtitle {
  font-size: 15px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 35px;
  line-height: 1.6;
}

.contact-email-link {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 8px;
  transition: color 0.25s;
  display: inline-block;
  margin-bottom: 10px;
}

.contact-email-link:hover {
  color: var(--coral);
}

.contact-location {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 30px;
}

.contact-social-centered {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.contact-social-centered a {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  transition: color 0.25s;
}

.contact-social-centered a:hover {
  color: var(--coral);
}

.case-study-footer {
  padding: 30px 4.2%;
  background: var(--white);
  border-top: 1px solid #eaeaea;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.back-to-top {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-column-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sticky-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .about-skills-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .sticky-sidebar {
    grid-template-columns: 1fr;
  }
  .inline-two-up {
    grid-template-columns: 1fr;
  }
}