/* =============================================
   APLOS AI — SHARED STYLES
   Canonical source for site-wide CSS.
   Page-specific styles remain inline.
   ============================================= */

/* =====================
   VARIABLES
===================== */
:root {
  --bg:       #F7F4EE;
  --bg-2:     #EDE9E1;
  --ink:      #100F0A;
  --ink-2:    #3D3A33;
  --muted:    #8C8880;
  --accent:   #E84A1C;
  --border:   #D8D3C8;
  --white:    #FFFFFF;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Instrument Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  --radius:    4px;
  --radius-lg: 12px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --trans:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:    0 2px 20px rgba(16,15,10,0.08);
  --shadow-lg: 0 8px 40px rgba(16,15,10,0.14);
}

/* =====================
   RESET
===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.45;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* =====================
   TYPE SCALE
===================== */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =====================
   LAYOUT
===================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.section    { padding: 7rem 0; }

/* =====================
   BUTTONS
===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: var(--trans);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover {
  background: #c73d14;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(232,74,28,0.35);
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #c73d14; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: #fff; transform: translateY(-1px); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 0.9375rem; }

/* =====================
   SCROLL REVEAL
===================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }
.reveal-d5 { transition-delay: 0.5s; }

/* =====================
   NAV (class-based — homepage)
===================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 0;
  transition: background var(--trans), box-shadow var(--trans);
}
.nav.scrolled {
  background: rgba(247,244,238,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 900;
  color: var(--ink); letter-spacing: -0.03em; text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2.5rem; }
.nav-links a { font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); transition: color var(--trans); text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 0.875rem; }

/* =====================
   INDUSTRIES MEGA DROPDOWN
===================== */
.nav-dropdown { position: relative; display: flex; align-items: center; align-self: stretch; }
.nav-dropdown-trigger { cursor: default; font-size: .875rem; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: color .2s; white-space: nowrap; }
.nav-dropdown:hover .nav-dropdown-trigger { color: var(--ink); }
.nav-dropdown-menu {
  display: none; position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(16,15,10,.14); padding: 1.5rem 1.75rem;
  width: 800px; grid-template-columns: repeat(4,1fr); gap: 0 1.5rem; z-index: 999;
}
.nav-dropdown:hover .nav-dropdown-menu { display: grid; }
.dropdown-col { display: flex; flex-direction: column; }
.dropdown-col-label { font-family: var(--font-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; padding-bottom: .375rem; border-bottom: 1px solid var(--border); }
.nav-dropdown-menu::before { content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.nav-dropdown-menu a { font-size: .8rem !important; font-weight: 400 !important; color: var(--ink-2) !important; text-decoration: none !important; padding: .15rem 0 !important; transition: color .15s !important; line-height: 1.85 !important; }
.nav-dropdown-menu a:hover { color: var(--accent) !important; }

/* =====================
   FORM FIELDS
===================== */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row .form-group { margin-bottom: 0; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 0.8125rem 1.125rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg); font-family: var(--font-body);
  font-size: 0.9375rem; color: var(--ink); outline: none;
  transition: border-color var(--trans);
  -webkit-appearance: none; appearance: none;
}
.form-input::placeholder { color: var(--muted); }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); background: var(--white); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C8880' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}
.form-success {
  margin-top: 1rem; padding: 1rem 1.25rem;
  background: #F0FBF2; border: 1.5px solid #D4EAD8;
  border-radius: 8px; color: #16A34A;
  font-weight: 600; font-size: 0.9375rem; text-align: center;
  display: none;
}
.form-success.show { display: block; }

/* =====================
   COOKIE CONSENT BANNER
===================== */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 1rem 1.5rem; z-index: 9999;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}
.cookie-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap;
}
.cookie-inner p {
  flex: 1 1 400px; margin: 0;
  font-size: 0.875rem; color: var(--muted);
  line-height: 1.5;
}
.cookie-actions {
  display: flex; gap: 0.5rem; flex-shrink: 0;
}

/* =====================
   SKIP TO CONTENT
===================== */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--accent); color: #fff;
  padding: 0.75rem 1.5rem; border-radius: 0 0 8px 8px;
  font-weight: 600; font-size: 0.875rem;
  z-index: 10000; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* =====================
   MOBILE MENU
===================== */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  padding: 0; z-index: 101;
}
.nav-toggle-icon {
  display: block; width: 22px; height: 2px;
  background: var(--ink); position: relative;
  transition: background 0.2s;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: ''; position: absolute; left: 0;
  width: 22px; height: 2px; background: var(--ink);
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after  { top: 7px; }

/* Open state — X shape */
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after  { top: 0; transform: rotate(-45deg); }

/* =====================
   SHARED RESPONSIVE
===================== */
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  /* Mobile menu open state */
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    padding: 5rem 2rem 2rem;
    gap: 0;
    z-index: 99;
    overflow-y: auto;
  }
  .nav-links.mobile-open a,
  .nav-links.mobile-open li > a {
    display: block;
    padding: 0.875rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.mobile-open li {
    list-style: none;
  }
  .nav-cta.mobile-open {
    display: flex; flex-direction: column; gap: 0.75rem;
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 1.25rem 2rem; z-index: 100;
    background: var(--bg);
    border-top: 1px solid var(--border);
  }
  .nav-cta.mobile-open .btn { justify-content: center; width: 100%; }

  /* Hide dropdown on mobile — show as flat list */
  .nav-links.mobile-open .nav-dropdown { display: block; }
  .nav-links.mobile-open .nav-dropdown-trigger { display: block; padding: 0.875rem 0; font-size: 1.125rem; font-weight: 500; border-bottom: 1px solid var(--border); }
  .nav-links.mobile-open .nav-dropdown-menu { display: none; }

  /* Also handle btn-nav inside nav-links (blog pages) */
  .nav-links.mobile-open .btn-nav {
    display: block;
    margin-top: 1rem;
    padding: 0.875rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border-radius: 100px;
    text-align: center;
    font-weight: 600;
  }

  .container { padding: 0 1.25rem; }
  .section { padding: 4rem 0; }
  .form-row { grid-template-columns: 1fr; }
}
