/* ============================================
   SHARED.CSS — Egi Troka / LegalTech Ecosystem
   ============================================ */

:root {
  --cream: #eeebe0;
  --cream-light: #fdfcfa;
  --brown-dark: #302725;
  --brown-mid: #786148;
  --tan: #C4B093;
  --blue: #4672A7;
  --green: #516256;
  --green-dark: #3a4a3f;
  --grey: #919596;
  --text-muted: #919596;
  --nav-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--brown-dark);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(32px, 4.5vw, 56px); }
h2 { font-size: clamp(26px, 3.2vw, 42px); }
h3 { font-size: clamp(20px, 2.5vw, 30px); }

/* --- Layout --- */
.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow { max-width: 720px; margin: 0 auto; }

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--cream);
  border-bottom: 1px solid rgba(48,39,37,0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Bodoni Moda', 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--brown-dark);
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.nav-logo:hover { opacity: 0.7; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--brown-mid);
  letter-spacing: 0.3px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-links a:hover { color: var(--brown-dark); }
.nav-links a.active { color: var(--brown-dark); border-bottom-color: var(--tan); }

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

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--brown-dark);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--cream);
  border-bottom: 1px solid rgba(48,39,37,0.08);
  padding: 24px;
  z-index: 999;
  flex-direction: column;
  gap: 20px;
}

.nav-mobile-overlay.open { display: flex; }

.nav-mobile-overlay a {
  font-size: 18px;
  font-weight: 500;
  color: var(--brown-mid);
  padding: 8px 0;
  border-bottom: 1px solid rgba(48,39,37,0.06);
}

.nav-mobile-overlay a.active { color: var(--brown-dark); }
.nav-mobile-overlay a:last-child { border-bottom: none; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}

.mobile-break { display: none; }

.btn-primary {
  background: var(--brown-dark);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--brown-mid);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--brown-dark);
  border: 1.5px solid var(--brown-dark);
}

.btn-outline:hover {
  background: var(--brown-dark);
  color: var(--cream);
  transform: translateY(-1px);
}

/* --- Marquee --- */
.marquee-section {
  padding: 0;
  overflow: hidden;
  background: #5a4a38;
  border: none;
}

.marquee-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: #ffffff;
  text-align: center;
  padding: 8px 0 6px;
}

.marquee-track-wrap {
  background: var(--brown-mid);
  padding: 8px 0;
}

.marquee-track {
  display: flex;
  animation: marquee-scroll 30s linear infinite;
  width: max-content;
}

.marquee-item {
  flex-shrink: 0;
  padding: 0 48px;
  font-family: 'Inter', sans-serif;
  font-size: clamp(12px, 1.3vw, 15px);
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 48px;
}

.marquee-item::after {
  content: '\00b7';
  color: rgba(255,255,255,0.4);
  font-size: 24px;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Long-form narrative page styles --- */
.narrative-hero {
  padding: 32px 0 12px;
  text-align: center;
}

.narrative-hero h1 {
  margin-bottom: 8px;
}

.subpage-title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 400;
}

.narrative-hero .hook {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(18px, 2.2vw, 26px);
  font-style: italic;
  color: var(--brown-mid);
  max-width: 600px;
  margin: 0 auto;
}

.narrative-section {
  padding: 24px 0;
}

.narrative-section h2 {
  margin-bottom: 20px;
}

.narrative-section p {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--brown-dark);
  line-height: 1.8;
  margin-bottom: 20px;
}

.narrative-section p:last-child {
  margin-bottom: 0;
}

.narrative-section .highlight {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 2.4vw, 30px);
  font-style: italic;
  color: var(--brown-mid);
  border-left: 3px solid var(--tan);
  padding-left: 24px;
  margin: 40px 0;
  line-height: 1.5;
}

.narrative-cta {
  text-align: center;
  padding: 64px 0;
  border-top: 1px solid rgba(48,39,37,0.08);
  margin-top: 48px;
}

.narrative-cta h2 {
  margin-bottom: 12px;
}

.narrative-cta p {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--brown-mid);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

/* --- Methodology Grid --- */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  padding: 0 24px;
}

.method-card {
  text-align: left;
}

.method-card .method-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 48px;
  font-weight: 400;
  color: var(--tan);
  line-height: 1;
  margin-bottom: 16px;
}

.method-card h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 400;
  margin-bottom: 12px;
}

.method-card p {
  font-size: clamp(14px, 1.3vw, 16px);
  color: var(--brown-mid);
  line-height: 1.7;
}

/* --- Dual Column --- */
.dual-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 48px 0;
}

.dual-section h3 {
  font-weight: 400;
  margin-bottom: 16px;
}

.dual-section p {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--brown-mid);
  line-height: 1.8;
  margin-bottom: 16px;
}

.dual-section p:last-child {
  margin-bottom: 0;
}

/* --- Sector Tags --- */
.sector-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  justify-content: center;
}

.sector-tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brown-mid);
  padding: 8px 20px;
  border: 1px solid rgba(48,39,37,0.12);
  border-radius: 24px;
}

/* --- Offering Phases --- */
.offering-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--tan);
  margin-bottom: 8px;
}

.offering-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 400;
  font-style: italic;
  color: var(--brown-dark);
  margin-bottom: 48px;
}

.phase-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.phase-item:last-child {
  margin-bottom: 0;
}

.phase-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--tan);
  line-height: 1;
}

.phase-content h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 400;
  margin-bottom: 8px;
}

.phase-content p {
  font-size: clamp(14px, 1.3vw, 16px);
  color: var(--brown-mid);
  line-height: 1.7;
}

/* --- Result Block --- */
.result-block {
  text-align: center;
  padding: 48px 0;
}

.result-block p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(18px, 2.2vw, 26px);
  font-style: italic;
  color: var(--brown-mid);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .phase-item { grid-template-columns: 48px 1fr; gap: 16px; margin-bottom: 36px; }
  .phase-number { font-size: 32px; }
  .phase-content h3 { font-size: 18px; }
  .phase-content p { font-size: 14px; }
  .offering-title { font-size: 22px; margin-bottom: 32px; }
  .result-block p { font-size: 18px; }
}

/* --- Product Timeline Grid --- */
.product-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 32px;
}

/* Flip card container */
.product-card {
  perspective: 1000px;
  min-height: 320px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  cursor: pointer;
}

.product-card:hover .card-inner,
.product-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
}

.card-front {
  background: #ffffff;
  border: 1px solid rgba(48,39,37,0.08);
}

.card-back {
  background: var(--brown-dark);
  color: #ffffff;
  transform: rotateY(180deg);
  justify-content: space-between;
}

/* Front face styles */
.card-front .product-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--tan);
  line-height: 1;
  margin-bottom: 10px;
}

.card-front h3 {
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 10px;
}

.card-front .product-desc {
  font-size: clamp(11px, 1.1vw, 13px);
  color: var(--brown-dark);
  line-height: 1.6;
  flex-grow: 1;
}

.card-front .flip-hint {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--tan);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 12px;
  text-align: right;
}

/* Back face styles */
.card-back .product-details {
  flex-grow: 1;
}

.card-back .product-details h4 {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--tan);
  margin-bottom: 6px;
}

.card-back .product-details p {
  font-size: clamp(10px, 1vw, 12px);
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}

.card-back .best-for {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #ffffff;
  font-style: italic;
  padding: 8px 10px;
  background: var(--brown-mid);
  border-radius: 6px;
  line-height: 1.4;
  margin-top: 10px;
}

.product-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.product-bullets li {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
  padding: 2px 0 2px 12px;
  position: relative;
}
.product-bullets li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--tan);
}

.cta-subline {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--brown-mid);
  font-style: italic;
  padding-top: 48px;
  white-space: nowrap;
}

/* --- Intro text above products --- */
p.page-intro {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  color: #b5aea8;
  line-height: 1.4;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.sector-pills {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.sector-pill {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brown-mid);
  border: 1px solid var(--brown-mid);
  border-radius: 20px;
  padding: 6px 18px;
}

@media (max-width: 768px) {
  .product-timeline {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 400px;
    margin: 0 auto;
  }
  .product-card { min-height: 320px; }
  .product-card:hover .card-inner { transform: none; }
  .product-card.flipped .card-inner { transform: rotateY(180deg); }
  .card-front, .card-back { padding: 24px 20px; }
  .card-front .product-desc { font-size: 14px; }
  .card-back .product-details p { font-size: 13px; }
  .product-bullets li { font-size: 13px; }
  .card-back .best-for { font-size: 11px; }
  p.page-intro { max-width: 100%; font-size: 10px; }
  .sector-pills { flex-wrap: wrap; gap: 8px; }
  .sector-pill { font-size: 11px; padding: 5px 14px; }
  .subpage-title { font-size: clamp(20px, 5vw, 30px); }
  .cta-subline { white-space: normal; font-size: 13px; padding-top: 32px; }
  .btn { font-size: 14px; padding: 12px 24px; }
  .mobile-break { display: inline; }
}

@media (max-width: 480px) {
  .product-timeline { gap: 20px; }
  .product-card { min-height: 300px; }
  .card-front, .card-back { padding: 20px 16px; }
  .card-front h3 { font-size: 18px; }
  .card-front .product-number { font-size: 26px; }
  .card-front .product-desc { font-size: 13px; }
  .card-back .best-for { font-size: 10px; padding: 8px 12px; }
  .product-bullets li { font-size: 12px; }
  p.page-intro { font-size: 9px; line-height: 1.3; }
  .subpage-title { font-size: 18px; }
  .sector-pill { font-size: 10px; padding: 4px 12px; }
  .btn { font-size: 13px; padding: 10px 20px; }
}

/* --- Divider line --- */
.section-rule {
  border: none;
  border-top: 1px solid rgba(48,39,37,0.08);
  margin: 0;
}

@media (max-width: 768px) {
  .method-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0;
  }
  .dual-section {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0;
  }
  .sector-tags { margin-top: 16px; gap: 8px; }
  .sector-tag { font-size: 10px; padding: 6px 14px; letter-spacing: 1.5px; }
  .method-card .method-number { font-size: 36px; }
}

@media (max-width: 480px) {
  .method-card .method-number { font-size: 28px; margin-bottom: 10px; }
  .method-card h3 { font-size: 16px; }
  .method-card p { font-size: 13px; }
  .dual-section { gap: 24px; padding: 20px 0; }
  .dual-section h3 { font-size: 18px; }
  .dual-section p { font-size: 14px; }
  .narrative-section .highlight { font-size: 18px; padding-left: 14px; margin: 24px 0; }
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  padding: 40px 0;
  border-top: 1px solid rgba(48,39,37,0.08);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left { font-size: 13px; color: var(--grey); }

.footer-socials { display: flex; align-items: center; gap: 20px; }
.footer-socials a { color: var(--grey); transition: color 0.2s; }
.footer-socials a:hover { color: var(--brown-dark); }
.footer-socials svg { width: 20px; height: 20px; }

/* --- Fade-up animation --- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root { --nav-height: 56px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .narrative-hero { padding: 40px 0 16px; }
  .narrative-hero h1 { font-size: clamp(22px, 5vw, 32px); }
  .narrative-section { padding: 20px 0; }
  .narrative-section p { font-size: 15px; }
  .narrative-cta { padding: 40px 0; margin-top: 24px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-left { font-size: 12px; }
  .footer-socials svg { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .narrative-hero { padding: 28px 0 12px; }
  .narrative-hero h1 { font-size: 22px; }
  .narrative-section { padding: 16px 0; }
  .narrative-section p { font-size: 14px; line-height: 1.6; }
  .narrative-cta { padding: 32px 0; margin-top: 16px; }
  .narrow { padding: 0 4px; }
}
