/* ==========================================================================
   OpenSoftwares — Master Stylesheet
   Design System: "Paper, Ink and Saffron"
   Brand: OpenSoftwares (opensoftwares.in)
   Flagship: Schoolmate by OpenSoftwares
   Inspired by: apple.com, openai.com, perplexity.ai
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Google Fonts & Fontshare Imports
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;1,400&family=DM+Mono:wght@400;500&family=Instrument+Serif:ital@1&display=swap');

/* --------------------------------------------------------------------------
   2. Design Tokens (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Core Palette */
  --paper:       #F6F4EF;
  --paper-2:     #EFEBE3;
  --ink:         #0E0E10;
  --ink-soft:    #55555C;
  --ink-mute:    #8A8A92;
  --midnight:    #0B1630;
  --midnight-2:  #14234A;
  --saffron:     #E8A317;
  --saffron-dim: rgba(232, 163, 23, 0.18);
  --line:        rgba(14, 14, 16, 0.12);
  --line-light:  rgba(255, 255, 255, 0.10);

  /* Functional */
  --color-whatsapp: #25D366;
  --success: #2F8F6B;
  --danger:  #C4503F;

  /* Typography */
  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono:  'DM Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Courier, monospace;

  /* Scale */
  --container-max: 1240px;
  --header-h: 68px;

  /* Spacing 8px grid */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 40px; --s6: 48px; --s7: 64px; --s8: 80px;

  /* Radius */
  --r-card:   14px;
  --r-btn:    999px;
  --r-device: 28px;
  --r-inner:  10px;

  /* Shadow */
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 24px 60px -20px rgba(11,22,48,.18);
  --shadow-float: 0 8px 24px rgba(11,22,48,.22);

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --dur-fast: 0.22s;
  --dur-med:  0.55s;
  --dur-slow: 0.85s;
}

/* --------------------------------------------------------------------------
   3. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* Safe area for floating buttons */
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  /* Paper grain texture overlay */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23grain)' opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

main { flex: 1 0 auto; }

img, svg, picture, video {
  max-width: 100%;
  display: block;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

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

ul, ol { list-style: none; }

/* --------------------------------------------------------------------------
   4. SVG Icon System (1.5px stroke, round caps, ink colour)
   -------------------------------------------------------------------------- */
.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }
.icon-filled { fill: currentColor; stroke: none; }

/* --------------------------------------------------------------------------
   5. Accessibility
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   6. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 7.5vw, 6.5rem); line-height: 0.98; font-weight: 600; }
h2 { font-size: clamp(2rem, 4.5vw, 3.75rem); line-height: 1.05; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.2; }
h4 { font-size: 1.1rem; letter-spacing: -0.02em; }

p { color: var(--ink-soft); line-height: 1.65; }

.text-lead {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 62ch;
}

/* Instrument Serif italic for accented words */
em.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  color: var(--ink);
}

/* Mono label style */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--s2);
}

/* --------------------------------------------------------------------------
   7. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--s3);
  padding-right: var(--s3);
}

.section {
  padding-top: clamp(80px, 12vw, 160px);
  padding-bottom: clamp(80px, 12vw, 160px);
  position: relative;
}

.section-alt { background-color: var(--paper-2); }
.section-dark { background-color: var(--midnight); color: #fff; }
.section-dark p { color: rgba(255,255,255,0.6); }
.section-dark h2, .section-dark h3 { color: #fff; }

/* Hairline dividers */
.hairline {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}
.hairline-dark { border-top-color: var(--line-light); }

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  height: 52px;
  padding: 0 1.75rem;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-primary:hover {
  background-color: #1c1c20;
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(14,14,16,0.22);
}

/* Arrow icon slides on hover */
.btn-primary .btn-arrow {
  transition: transform var(--dur-fast) var(--ease-out);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  height: 52px;
}

.btn-ghost:hover {
  background-color: var(--paper-2);
  border-color: rgba(14,14,16,0.22);
  transform: translateY(-1px);
}

/* Text link style with saffron underline on hover */
.link-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
}

.link-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  transform-origin: left;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.link-text:hover::after { background-color: var(--saffron); }

.btn-sm {
  height: 40px;
  padding: 0 1.25rem;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   9. Header (Floating Pill Nav)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 920px;
  z-index: 1000;
  transition: all var(--dur-fast) var(--ease-out);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--s2);
  background-color: rgba(246, 244, 239, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  transition: all var(--dur-fast) var(--ease-out);
}

.site-header.scrolled .header-inner {
  height: 50px;
  box-shadow: 0 4px 20px rgba(11,22,48,.10);
}

/* Brand Link & Wordmark */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
  color: inherit;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}

.brand-link:hover .brand-logo-img {
  transform: scale(1.04);
}

@media (max-width: 768px) {
  .brand-logo-img {
    width: 32px;
    height: 32px;
  }
}

/* Dark midnight backgrounds: brightness(0) invert(1) turns dark mark pure crisp white while keeping transparency */
.brand-logo-darkmode {
  filter: brightness(0) invert(1);
}

/* Fallback rounded tile if ever needed */
.brand-logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 8px;
  background-color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brand-logo-tile .brand-logo-img {
  width: 100%;
  height: 100%;
  mix-blend-mode: normal;
  filter: none;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
  color: var(--ink);
  user-select: none;
  text-decoration: none;
}

.brand-cap {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--midnight);
  display: inline-block;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: var(--saffron);
  border-radius: 50%;
  margin-left: 2px;
  align-self: baseline;
  margin-bottom: 3px;
}

.brand-link-light .brand-wordmark {
  color: #ffffff;
}

.brand-link-light .brand-cap {
  color: rgba(255, 255, 255, 0.95);
}

.brand-link-light .brand-dot {
  background-color: var(--saffron);
}

/* Desktop Nav Links */
.nav-desktop {
  display: flex;
  align-items: center;
}

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

.nav-link {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: 6px;
  transition: color var(--dur-fast) var(--ease-out);
  text-decoration: none;
}

.nav-link:hover { color: var(--ink); }

/* Rolling text effect on hover */
.nav-link .nav-text-front { display: block; }
.nav-link .nav-text-back {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.nav-link:hover .nav-text-front {
  animation: navRollUp 0.3s var(--ease-out) forwards;
}
.nav-link:hover .nav-text-back {
  animation: navRollIn 0.3s var(--ease-out) forwards;
}

@keyframes navRollUp {
  to { opacity: 0; transform: translateY(-100%); }
}
@keyframes navRollIn {
  to { opacity: 1; top: 50%; transform: translate(-50%, -50%); }
}

/* Active nav link — small saffron dot */
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--saffron);
}

.header-cta { display: flex; align-items: center; gap: var(--s2); }
.header-cta .btn { height: 38px; padding: 0 1.1rem; font-size: 0.875rem; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  gap: 5px;
}

.nav-bar {
  width: 22px;
  height: 1.5px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform 0.35s var(--ease-in-out), opacity 0.2s;
  display: block;
}

.nav-toggle[aria-expanded="true"] .nav-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 860px) {
  .site-header { top: 12px; width: calc(100% - 24px); }
  .nav-desktop { display: none; }
  .header-cta .btn-primary { display: none; }
  .nav-toggle { display: flex; }
}

/* --------------------------------------------------------------------------
   10. Mobile Fullscreen Overlay Menu
   -------------------------------------------------------------------------- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--midnight);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  padding: var(--s3);
  clip-path: circle(0% at calc(100% - 36px) 38px);
  transition: clip-path 0.65s var(--ease-in-out);
  pointer-events: none;
}

.mobile-overlay.open {
  clip-path: circle(150% at calc(100% - 36px) 38px);
  pointer-events: all;
}

.mobile-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s6);
  padding-top: 4px;
}

.mobile-overlay .brand-wordmark { color: #fff; }
.mobile-overlay .brand-cap { color: rgba(255,255,255,0.9); }
.mobile-overlay .brand-dot { background-color: var(--saffron); }

.overlay-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-light);
  color: #fff;
}

.mobile-nav-list {
  flex: 1;
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s2);
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.mobile-overlay.open .mobile-nav-item:nth-child(1) { transition-delay: 0.15s; opacity: 1; transform: none; }
.mobile-overlay.open .mobile-nav-item:nth-child(2) { transition-delay: 0.22s; opacity: 1; transform: none; }
.mobile-overlay.open .mobile-nav-item:nth-child(3) { transition-delay: 0.29s; opacity: 1; transform: none; }
.mobile-overlay.open .mobile-nav-item:nth-child(4) { transition-delay: 0.36s; opacity: 1; transform: none; }

.mobile-nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--saffron);
  letter-spacing: 0.08em;
  min-width: 28px;
}

.mobile-nav-link {
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  line-height: 1;
  transition: color var(--dur-fast);
}

.mobile-nav-link:hover { color: var(--saffron); }

.mobile-overlay-footer {
  border-top: 1px solid var(--line-light);
  padding-top: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.mobile-footer-notice {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}

.mobile-footer-contacts {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}

.mobile-footer-link {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--dur-fast);
}
.mobile-footer-link:hover { color: #fff; }

/* --------------------------------------------------------------------------
   11. Floating Action Buttons
   -------------------------------------------------------------------------- */
.floating-actions {
  position: fixed;
  bottom: calc(var(--s3) + env(safe-area-inset-bottom, 0px));
  right: var(--s3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 900;
}

.floating-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  color: #fff;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
  position: relative;
}

.floating-btn:hover { transform: scale(1.07); }
.floating-btn:active { transform: scale(0.94); }

.floating-btn-whatsapp { background-color: #25D366; }
.floating-btn-call { background-color: var(--midnight); }
.floating-btn-instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.floating-btn-instagram:hover {
  box-shadow: 0 8px 24px rgba(214, 36, 159, 0.45);
}

/* WhatsApp pulse */
.floating-btn-whatsapp::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: pulse-ring 2.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  opacity: 0;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% { transform: scale(0.88); opacity: 0.8; }
  60% { transform: scale(1.32); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Tooltip */
.floating-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  background-color: var(--midnight);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}

.floating-btn:hover .floating-tooltip { opacity: 1; transform: translateX(0); }

@media (max-width: 768px) {
  .floating-btn { width: 48px; height: 48px; }
  .floating-tooltip { display: none; }
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--midnight);
  color: rgba(255,255,255,0.7);
  padding-top: clamp(60px, 8vw, 100px);
  padding-bottom: clamp(40px, 5vw, 60px);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--s6);
  padding-bottom: var(--s7);
  border-bottom: 1px solid var(--line-light);
  margin-bottom: var(--s4);
}

.footer-brand .brand-link { margin-bottom: var(--s3); display: inline-flex; }
.footer-brand .brand-wordmark { color: #fff; display: inline-flex; }
.footer-brand .brand-cap { color: rgba(255,255,255,0.95); }
.footer-brand .brand-dot { background-color: var(--saffron); }

.footer-brand p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  max-width: 300px;
  margin-bottom: var(--s3);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.footer-contact-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-contact-list li a:hover { color: #fff; }

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: var(--s2);
}

.footer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.footer-nav-list a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-nav-list a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
}

.footer-legal-links {
  display: flex;
  gap: var(--s2);
  list-style: none;
}

.footer-legal-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-legal-links a:hover { color: rgba(255,255,255,0.6); }

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s4); }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--s3); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   13. Scroll Reveal Animations
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

/* Line reveal for headlines — text mask reveal */
.line-reveal-wrap {
  overflow: hidden;
  display: block;
}

.line-reveal-inner {
  display: block;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

.revealed .line-reveal-inner { transform: none; }

/* --------------------------------------------------------------------------
   14. Section Row layouts (anti-AI card grid)
   -------------------------------------------------------------------------- */
/* Numbered sections — big mono numerals */
.numbered-section-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--s3);
}

/* Asymmetric two-column */
.split-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s6);
  align-items: center;
}

.split-two.flip { direction: rtl; }
.split-two.flip > * { direction: ltr; }

@media (max-width: 768px) {
  .split-two { grid-template-columns: 1fr; gap: var(--s4); }
  .split-two.flip { direction: ltr; }
}

/* Hairline table / list rows */
.row-list {
  list-style: none;
}

.row-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-fast);
}

.row-list li:first-child { border-top: 1px solid var(--line); }

/* Group/Company rows */
.group-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--dur-fast);
  position: relative;
}
.group-row:first-child { border-top: 1px solid var(--line); }
.group-row:hover { background-color: var(--paper-2); }
.group-row-arrow {
  transition: transform var(--dur-fast) var(--ease-out);
  color: var(--ink-mute);
}
.group-row:hover .group-row-arrow { transform: translateX(8px); color: var(--ink); }

.group-row-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--saffron);
  font-weight: 500;
}

.group-row-info h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.group-row-info p {
  font-size: 0.9rem;
  color: var(--ink-mute);
  line-height: 1.4;
}

.group-row-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.group-row-status.live {
  color: var(--success);
  border-color: var(--success);
}

@media (max-width: 640px) {
  .group-row { grid-template-columns: 32px 1fr; }
  .group-row-arrow { display: none; }
  .group-row-status { display: none; }
}

/* --------------------------------------------------------------------------
   CTA Logo Wrap
   -------------------------------------------------------------------------- */
.cta-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--s4);
}

/* --------------------------------------------------------------------------
   Loading Splash Screen (First visit per session)
   -------------------------------------------------------------------------- */
.site-splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: #F6F4EF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.8s;
  will-change: opacity, transform;
}

.site-splash.splash-dismissed {
  opacity: 0;
  transform: translateY(-24px);
  visibility: hidden;
  pointer-events: none;
}

html.splash-skip .site-splash {
  display: none !important;
}

body.splash-locked {
  overflow: hidden !important;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 90vw;
  text-align: center;
}

.splash-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* Logo animation (First to appear) */
.splash-logo-wrap {
  opacity: 0;
  transform: scale(0.85);
  animation: splashLogoIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.12s;
}

@keyframes splashLogoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Staggered letter rise & fade (Appears second, below the logo icon) */
.splash-text {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.035em;
  color: #0E0E10;
  user-select: none;
}

.splash-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  animation: splashLetterIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.55s + var(--i) * 0.045s);
}

.splash-cap {
  font-size: 1.25em;
  font-weight: 700;
  color: #0B1630;
}

.splash-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #E85C0D;
  border-radius: 50%;
  margin-left: 4px;
  margin-bottom: 6px;
  opacity: 0;
  transform: scale(0);
  animation: splashDotIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1.2s;
}

@keyframes splashLetterIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashDotIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-logo-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  display: block;
}

@keyframes splashLogoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Thin saffron progress line */
.splash-progress-track {
  width: 140px;
  height: 2px;
  background: rgba(14, 14, 16, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.splash-progress-bar {
  width: 0%;
  height: 100%;
  background: #E85C0D;
  border-radius: 999px;
  animation: splashProgressFill 1.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.9s;
}

@keyframes splashProgressFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-letter, .splash-dot, .splash-logo-wrap, .splash-progress-bar {
    animation-duration: 0.2s !important;
    animation-delay: 0s !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .site-splash {
    transition: opacity 0.4s ease !important;
  }
}
