@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f7f1e6;
  --bg-soft: #f1e9da;
  --card: #fffdfa;
  --text: #241c14;
  --text-muted: #7a6f5f;
  --accent: #5b3a24;
  --accent-hover: #462c1a;
  --eyebrow: #a8622f;
  --pill-bg: #efe2cd;
  --pill-text: #5b4632;
  --icon-bg: #f0e2cc;
  --border: #e8dcc7;
  --max-width: 1120px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

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

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -4px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 1.3rem;
  font-weight: 600;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 34px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.96rem;
  color: var(--text);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

.nav-links a.active { color: var(--accent); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 58, 36, 0.25);
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: var(--card);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-block { width: 100%; justify-content: center; }

/* Hero (home) */
.hero {
  position: relative;
  padding: 130px 0 100px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 98, 47, 0.16) 0%, rgba(168, 98, 47, 0) 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  margin: 0 0 14px;
  line-height: 1.08;
}

.hero-subtitle {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 22px;
  font-family: "Inter", sans-serif;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin: 0 0 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Page header (subpages) */
.page-header {
  padding: 70px 32px 32px;
  text-align: left;
}

.page-header h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  margin: 0 0 16px;
}

.page-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

.page-lead + .page-lead {
  margin-top: 18px;
}

.page-lead-note {
  font-size: 0.98rem;
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin-top: 26px !important;
}

.page-header-center { text-align: center; }
.page-header-center .page-lead { margin: 0 auto; }

/* Sections */
.section {
  padding: 60px 32px;
}

.section-top {
  border-top: 1px solid var(--border);
}

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.section-head-row h2 {
  font-size: 1.9rem;
  margin: 0 0 8px;
}

.section-head-row p {
  color: var(--text-muted);
  margin: 0;
  max-width: 560px;
}

.section-head-row p.wide {
  max-width: none;
}

.link-arrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.link-arrow:hover { text-decoration: underline; }

.about-columns p {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 22px;
}

/* Cards grid (home areas + habilidades) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.cards-grid.cols-3 { grid-template-columns: repeat(3, 1fr); align-items: start; }
.cards-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.icon-circle .icon { color: var(--accent); }

.mini-card {
  display: block;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(36, 28, 20, 0.08);
}

.mini-card h3 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.mini-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin: 0;
}

/* Skill cards (habilidades) */
.skill-card {
  scroll-margin-top: 100px;
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.skill-card-head .icon-circle {
  margin-bottom: 0;
  flex-shrink: 0;
}

.skill-card h3 {
  font-size: 1.2rem;
  margin: 0;
}

.skill-card h3.tight-title {
  line-height: 1.2;
}

.skill-card > p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin: 0 0 18px;
}

.skill-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: var(--accent);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.skill-toggle:hover { opacity: 0.75; }

.skill-toggle .icon {
  width: 15px;
  height: 15px;
  transform: rotate(90deg);
  transition: transform 0.25s ease;
}

.skill-toggle[aria-expanded="true"] .icon {
  transform: rotate(-90deg);
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, margin-top 0.35s ease;
}

.skill-list.open {
  max-height: 500px;
  margin-top: 18px;
}

.skill-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.95rem;
}

.skill-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--eyebrow);
}

.tools-card {
  margin-top: 48px;
}

.tools-card h3 {
  font-size: 1.3rem;
  margin: 0 0 20px;
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  background: color-mix(in srgb, var(--pill-bg) 70%, transparent);
  color: var(--pill-text);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Articles page */
.article-group {
  border-top: 1px solid var(--border);
}

.article-group:last-child {
  border-bottom: 1px solid var(--border);
}

.article-group h2 {
  margin: 0;
  font-size: 1.25rem;
}

.article-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  background: none;
  border: none;
  padding: 22px 4px;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.article-toggle:hover { color: var(--accent); }

.article-toggle .icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transform: rotate(90deg);
  transition: transform 0.25s ease;
}

.article-toggle[aria-expanded="true"] .icon {
  transform: rotate(-90deg);
  color: var(--accent);
}

.article-list {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.article-list.open {
  max-height: 1400px;
}

.article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 1.02rem;
  transition: color 0.15s ease;
}

.article-list a.article-item:last-child {
  border-bottom: 1px solid var(--border);
}

.article-item:hover {
  color: var(--accent);
}

.article-item .icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.article-item:hover .icon {
  color: var(--accent);
}

.cta-band {
  text-align: center;
  padding: 40px 32px 90px;
}

.cta-band p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 22px;
}

/* Experience preview cards (home) */
.exp-preview-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exp-preview-card {
  display: block;
  padding: 26px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.exp-preview-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(36, 28, 20, 0.08);
}

.exp-preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.exp-preview-top h3 { font-size: 1.15rem; margin: 0 0 4px; }

.exp-preview-card > p:last-child {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* Timeline */
.timeline {
  position: relative;
}

.timeline-item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding: 0 0 40px 24px;
  border-left: 2px solid var(--border);
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--eyebrow);
  border: 3px solid var(--bg);
}

.timeline-item:last-child { padding-bottom: 0; }

.resume-download {
  text-align: center;
  margin-top: 40px;
}

.timeline-date {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.timeline-content h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.timeline-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0;
  font-family: "Inter", sans-serif;
}

.timeline-bullets {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--eyebrow);
}

.timeline-item .timeline-content > p {
  color: var(--text-muted);
  margin: 4px 0 0;
  font-size: 0.95rem;
}

/* Strategic projects (projetos.html) */
.strategic-project {
  margin-bottom: 110px;
  padding-bottom: 110px;
  border-bottom: 1px solid var(--border);
}

.strategic-project-last {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.strategic-project-header {
  /* mirrors .container's centering offset inside the wider .container-wide box, so text lines up with the page-header above */
  padding-left: clamp(0px, (100vw - var(--max-width)) / 2, 60px);
  padding-right: clamp(0px, (100vw - var(--max-width)) / 2, 60px);
  margin-bottom: 48px;
}

.strategic-project-header .eyebrow-inline {
  margin-bottom: 18px;
}

.strategic-project-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0;
}

.eyebrow-inline {
  color: var(--eyebrow);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 10px;
}

.strategic-project-body {
  padding-left: clamp(0px, (100vw - var(--max-width)) / 2, 60px);
  padding-right: clamp(0px, (100vw - var(--max-width)) / 2, 60px);
  margin: 0 0 44px;
}

.strategic-project-body:last-child { margin-bottom: 0; }

.strategic-project-body .eyebrow-inline { margin-top: 30px; }
.strategic-project-body .eyebrow-inline:first-child { margin-top: 0; }

.strategic-project-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0;
}

.strategic-project-text + .strategic-project-text {
  margin-top: 18px;
}

.project-highlights {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.project-visual-frame {
  margin: 40px 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0a0714;
  box-shadow: 0 24px 60px rgba(36, 28, 20, 0.16);
}

.project-visual-frame iframe {
  display: block;
  width: 100%;
  height: 1000px;
  border: none;
}

.project-visual-frame-compact iframe {
  height: 760px;
}

.project-visual-frame-image {
  background: var(--card);
}

.project-visual-frame-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Step diagram (ICA) */
.step-diagram {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 16px;
  margin: 40px 0;
  padding: 48px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-node:not(:nth-child(4n+1))::before {
  content: "";
  position: absolute;
  top: 21px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
}

.step-num {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.step-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.step-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: center;
}

.contact-grid h2 {
  font-size: 1.4rem;
  margin: 0 0 20px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.info-card .icon-circle {
  margin-bottom: 0;
  flex-shrink: 0;
}

.info-card-body { flex: 1; }

.info-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.info-value {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}

.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn .icon { width: 16px; height: 16px; }

.message-card p {
  color: var(--text-muted);
  margin: 0 0 24px;
}

.message-card .btn { margin-bottom: 12px; width: 100%; justify-content: center; }

.message-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.message-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 !important;
}

.message-note strong { color: var(--text); }

.message-note .tag {
  color: var(--accent);
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px 24px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
}

.footer-brand .logo { font-size: 1.15rem; display: block; margin-bottom: 4px; }

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links .btn {
  padding: 10px 18px;
  font-size: 0.88rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Creative carousels */
.carousel-section {
  margin-bottom: 56px;
}

.carousel-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.carousel-section-head h2 {
  font-size: 1.6rem;
  margin: 0 0 6px;
}

.carousel-section-head p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.carousel-group {
  margin-bottom: 34px;
}

.carousel-group:last-child { margin-bottom: 0; }

.carousel-group h3 {
  font-size: 1.1rem;
  margin: 0 0 14px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  color: var(--accent);
}

.carousel-wrap {
  position: relative;
}

.carousel-wrap + .carousel-wrap {
  margin-top: 16px;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 auto;
  height: 300px;
  scroll-snap-align: start;
}

.carousel-slide figure {
  margin: 0;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
}

.carousel-slide img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
}

.carousel-slide video {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  background: #000;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(36, 28, 20, 0.12);
  z-index: 2;
  color: var(--text);
}

.carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.carousel-btn.prev { left: -10px; }
.carousel-btn.next { right: -10px; }
.carousel-btn .icon { width: 18px; height: 18px; }

/* Creative hub cover grid */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.cover-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.cover-card-short {
  aspect-ratio: 3 / 1;
}

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

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

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

.cover-card:hover video { transform: scale(1.05); }

.cover-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 15, 10, 0.28) 0%, rgba(20, 15, 10, 0.42) 35%, rgba(20, 15, 10, 0.88) 100%);
}

.cover-card-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  z-index: 2;
}

.cover-card-label h2 {
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.25;
  white-space: nowrap;
  margin: 0 0 4px;
}

.cover-card-label p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  margin: 0;
  font-family: "Inter", sans-serif;
}

/* Masonry gallery (category detail pages) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 18px;
}

.back-link:hover { color: var(--accent); }
.back-link .icon { width: 16px; height: 16px; }

.masonry {
  column-count: 1;
  column-gap: 20px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 20px;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
}

.masonry-subhead {
  column-span: all;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
  margin: 8px 0 14px;
  break-after: avoid;
}

.masonry-subhead:first-child { margin-top: 0; }

.brand-block { margin-bottom: 36px; }
.brand-block:last-child { margin-bottom: 0; }
.masonry + .brand-block { margin-top: 36px; }

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 20px;
}

.brand-row img {
  height: 260px;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  object-fit: contain;
}

.brand-row-wrap {
  position: relative;
}

.brand-row-tall {
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.brand-row-tall::-webkit-scrollbar { display: none; }

.brand-row-tall img {
  height: 320px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .masonry { column-count: 2; }
}

@media (min-width: 1000px) {
  .masonry { column-count: 3; }
}

/* Responsive */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}

/* Book viewer (page-turn) */
.container-wide {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.book-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
}

.book-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.book-img-under,
.book-flip {
  position: absolute;
  inset: 0;
}

.book-img-under img,
.book-flip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-lg);
}

.book-img-under { z-index: 1; }

.book-flip {
  z-index: 2;
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -18px 0 40px rgba(36, 28, 20, 0.22);
}

.book-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(36, 28, 20, 0.12);
  color: var(--text);
}

.book-btn:hover { border-color: var(--accent); color: var(--accent); }
.book-btn:disabled { opacity: 0.3; cursor: default; border-color: var(--border); color: var(--text); }
.book-btn .icon { width: 18px; height: 18px; }

.book-counter {
  text-align: center;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
}

.book-stage .media-expand-btn {
  opacity: 1;
  z-index: 3;
}

@media (max-width: 640px) {
  .book-viewer { gap: 10px; }
  .book-btn { width: 36px; height: 36px; }
}

/* Lightbox */
.zoomable { cursor: zoom-in; }

.media-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 15, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.carousel-slide:hover .media-expand-btn,
.media-expand-btn:focus {
  opacity: 1;
}

.media-expand-btn:hover { background: rgba(20, 15, 10, 0.8); }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 11, 8, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  display: flex;
}

.lightbox-content img,
.lightbox-content video {
  /* fixed box + object-fit keeps phone-recorded photos/videos centered even when
     their reported intrinsic size doesn't match the rotation metadata on the file */
  width: 90vw;
  height: 86vh;
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

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

body.lightbox-locked { overflow: hidden; }

.file-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 11, 8, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.file-overlay.open {
  opacity: 1;
  visibility: visible;
}

.file-overlay-inner {
  position: relative;
  width: 100%;
  max-width: 880px;
  height: 100%;
  background: var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.file-overlay-inner iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.file-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}

.file-overlay-close:hover { background: rgba(0, 0, 0, 0.75); }

@media (max-width: 720px) {
  .file-overlay { padding: 0; }
  .file-overlay-inner { max-width: 100%; border-radius: 0; }
}

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

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.open {
    max-height: 480px;
  }

  .nav-links li {
    width: 100%;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
  }

  .hero { padding: 90px 20px 60px; }
  .page-header { padding: 50px 20px 10px; }
  .section { padding: 44px 20px; }

  .cards-grid { grid-template-columns: 1fr; }
  .cards-grid.cols-3 { grid-template-columns: 1fr; }

  .cover-card-label h2 { white-space: normal; }

  .footer-top { flex-direction: column; align-items: flex-start; }

  .carousel-slide { height: 220px; }
  .carousel-btn { width: 34px; height: 34px; }
  .carousel-btn.prev { left: 2px; }
  .carousel-btn.next { right: 2px; }

  .lightbox-overlay { padding: 20px; }
  .lightbox-content img,
  .lightbox-content video { width: 90vw; height: 80vh; }

  .masonry { column-count: 1; }

  .strategic-project { margin-bottom: 70px; padding-bottom: 70px; }
  .project-visual-frame iframe { height: 520px; }
  .project-visual-frame-compact iframe { height: 480px; }

  .step-diagram { grid-template-columns: 1fr; gap: 22px; padding: 32px 24px; }
  .step-node { flex-direction: row; text-align: left; gap: 14px; }
  .step-num { margin-bottom: 0; flex-shrink: 0; }
  .step-node:not(:nth-child(4n+1))::before { display: none; }
}
