/*
  Macavinis Corporation — Dark Minimal System
  Premium monochrome UI with subtle depth and strong typography.
*/

:root {
  --bg: #050506;
  --bg-elev: #0a0b0d;
  --bg-soft: #0d0e12;
  --text: #eceef0;
  --muted: #a6aab1;
  --line: #131419;
  --line-soft: #101116;
  --focus: #ffffff;
  --accent: #ff2d55; /* premium red accent */
  --shadow: 0 1px 0 rgba(255,255,255,0.02) inset,
            0 8px 24px rgba(0,0,0,0.5),
            0 2px 8px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

html {
  /* Smooth in-page nav with proper offset for fixed nav */
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  padding-top: 80px; /* Account for fixed navbar */
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 40% -10%, rgba(255,255,255,0.03), transparent 55%),
    radial-gradient(900px 500px at 110% 110%, rgba(255, 45, 85, 0.06), transparent 60%),
    #050506;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 768px) {
  body {
    padding-top: 100px; /* Slightly more padding for mobile stacked nav */
    min-height: 100vh;
  }
}

/* Subtle, nearly invisible watermark that hints at a hidden background */
body::after {
  content: "POLICY 7.3.4 // OVERSIGHT EXEMPT // L7";
  position: fixed;
  inset: 0;
  margin: auto;
  height: max(40vh, 280px);
  width: 100%;
  pointer-events: none;
  display: block;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: #fff;
  opacity: 0.016; /* whisper-level */
  mix-blend-mode: overlay;
  transform: rotate(-8deg);
  font-size: clamp(48px, 12vw, 180px);
}

img { max-width: 100%; display: block; }

.container {
  width: min(1120px, 94vw);
  margin-inline: auto;
  padding: 0 16px;
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }
}

.row {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.mt-16 { margin-top: 16px; }

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(5,5,6,0.3);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
}

.nav .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  gap: 12px;
  width: 100%;
  margin: 0;
}

.brand { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: 12px; 
  text-decoration: none; 
  color: var(--text);
  flex-shrink: 0;
  margin: 0 auto;
}
.brand:hover .brand-name { opacity: 1; }
.brand-name { 
  font-weight: 600; 
  letter-spacing: 0.02em; 
  opacity: 0.92; 
  display: inline;
}
.logo { 
  height: 5rem; 
  width: auto; 
  filter: none;
  display: block;
  margin: 0 auto;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: clamp(12px, 3vw, 24px);
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-links a { 
  color: var(--muted); 
  text-decoration: none; 
  font-weight: 500; 
  letter-spacing: 0.02em; 
  position: relative;
  font-size: 14px;
  white-space: nowrap;
}
.nav-links a::after { 
  content: ""; 
  position: absolute; 
  left: 0; 
  bottom: -6px; 
  height: 2px; 
  width: 0%; 
  background: var(--accent); 
  border-radius: 2px; 
  transition: width 200ms ease; 
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: #fff; }
.nav-links a.active::after { width: 100%; }

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav .container {
    gap: 10px;
    padding: 12px 0;
    margin: 0;
  }
  
  .nav-links {
    gap: 16px;
    flex-wrap: wrap;
  }
  
  .nav-links a {
    font-size: 13px;
  }
  
  .logo {
    height: 2.5rem;
  }
}

/* Back to Home */
.back-home { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  color: var(--muted); 
  text-decoration: none; 
  margin: 16px 0 -8px;
  font-size: 14px;
  font-weight: 500;
}
.back-home:hover { color: var(--text); }
.back-home::before { 
  content: "←"; 
  color: var(--accent);
  font-weight: 600;
}

/* Buttons */
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: 8px; 
  padding: 12px 20px; 
  font-weight: 600; 
  font-size: 14px;
  letter-spacing: 0.01em; 
  text-decoration: none; 
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease; 
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-outline { 
  color: var(--text); 
  border: 1px solid #ffffff26; 
  background: #ffffff0d; 
}
.btn-outline:hover { 
  border-color: #ffffff3a; 
  background: #ffffff12; 
}
.btn-solid { 
  color: #0b0b0c; 
  background: #f5f6f7; 
  border: 1px solid #ffffff26; 
}
.btn-solid:hover { background: #ffffff; }
.btn-accent { 
  color: #fff; 
  background: var(--accent); 
  border: 1px solid var(--accent); 
}
.btn-accent:hover { 
  filter: brightness(1.08); 
}

@media (max-width: 768px) {
  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Hero */
.hero { 
  padding: clamp(48px, 8vh, 80px) 0 48px; 
  text-align: center; 
}
.hero h1 { 
  margin: 0 0 16px; 
  font-size: clamp(28px, 6vw, 56px); 
  line-height: 1.1; 
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero p { 
  margin: 0 auto 24px; 
  max-width: 600px; 
  color: var(--muted); 
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.5;
}
.hero-cta { 
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.microcopy { 
  display: block; 
  margin-top: 20px; 
  color: #8d929a;
  font-size: 14px;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 120px;
  }
  
  .hero {
    padding: 24px 0 24px;
  }
  
  .section {
    padding: 32px 0;
  }
  
  .hero-cta {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  .split {
    gap: 24px;
  }
  
  .aside .disclaimer {
    padding: 16px;
  }
  
  .hero-quote {
    padding: 24px 0 16px;
  }
  
  /* Better touch targets */
  .nav-links a,
  .btn,
  .link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Sections */
.section { 
  padding: 48px 0; 
  border-top: 1px solid var(--line-soft); 
}
.section:first-of-type { border-top: none; }
.section-head { 
  margin-bottom: 24px; 
  text-align: center;
}
.section h2 { 
  margin: 0 0 8px; 
  font-size: clamp(24px, 4vw, 32px); 
  letter-spacing: -0.01em; 
  font-weight: 600;
}
.subtitle { 
  margin: 0; 
  color: var(--muted);
  font-size: clamp(14px, 2vw, 16px);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
  margin-top: 32px;
}
@media (max-width: 768px) { 
  .cards { 
    grid-template-columns: 1fr; 
    gap: 16px;
  } 
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.2);
  transition: border-color 220ms ease, transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}
.card:hover { 
  transform: translateY(-2px); 
  border-color: #2a2b30; 
  background: var(--bg-soft); 
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset, 0 16px 40px rgba(0,0,0,0.4);
}
.card h3 { 
  margin: 0 0 8px; 
  font-size: 20px; 
  letter-spacing: -0.01em;
  font-weight: 600;
}
.card p { 
  margin: 0 0 16px; 
  color: var(--muted);
  line-height: 1.5;
  flex-grow: 1;
}
.card .link { margin-top: auto; }
.meta { 
  list-style: none; 
  padding: 0; 
  margin: 0 0 16px; 
  color: #b6bbc4; 
  font-size: 14px; 
}
.meta li { 
  position: relative; 
  padding-left: 16px; 
  margin-bottom: 4px;
}
.meta li::before { 
  content: "•"; 
  position: absolute; 
  left: 0; 
  top: 0; 
  color: var(--accent); 
  opacity: 0.6;
}
.link { 
  color: var(--text); 
  text-underline-offset: 3px; 
  text-decoration: underline transparent; 
  transition: text-decoration-color 200ms ease, color 200ms ease;
  font-weight: 500;
}
.link:hover { 
  color: var(--accent); 
  text-decoration-color: rgba(255,45,85,0.7); 
}

/* Split layout - now always vertical */
.split { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 32px; 
  align-items: start; 
}

.aside .disclaimer { 
  border: 1px solid var(--line); 
  border-radius: 12px; 
  padding: 20px; 
  background: #0c0d10; 
}
.fineprint summary { 
  cursor: pointer; 
  color: var(--text);
  font-weight: 500;
}
.fineprint p { 
  color: #9aa0a8; 
  margin-top: 8px;
}
.dim { color: #8a8f97; }

/* Quote */
.hero-quote { 
  text-align: center; 
  padding: 40px 0 20px; 
}
.hero-quote blockquote { 
  margin: 0; 
  font-size: clamp(18px, 3vw, 24px); 
  color: #cfd3d9; 
  font-weight: 500;
  line-height: 1.4;
}
.hero-quote cite { 
  display: block; 
  margin-top: 12px; 
  color: #8b9098; 
  font-style: normal;
  font-size: 14px;
}

/* Footer */
.footer { 
  border-top: 1px solid var(--line); 
  background: #0a0a0b; 
  padding: 24px 0; 
}
.footer .container { 
  display: flex; 
  gap: 16px; 
  align-items: center; 
  justify-content: space-between; 
  flex-wrap: wrap; 
}
.footer nav { 
  display: inline-flex; 
  gap: 12px; 
  align-items: center; 
  flex-wrap: wrap;
}
.footer a { 
  color: var(--muted); 
  text-decoration: none;
  font-size: 14px;
}
.footer a:hover { color: var(--text); }
.legal { 
  color: #8a8f97;
  font-size: 14px;
}

@media (max-width: 768px) {
  .footer .container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .footer nav {
    justify-content: center;
  }
}

/* Main content area should grow to push footer down */
main {
  flex: 1;
}

/* Ensure page wrapper takes full height */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Focus states */
:where(a, button, [role="button"]) { outline: none; }
:where(a, button, [role="button"]):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 10px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

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

/* Full-screen overlay for #oversight */
#oversight.overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background:
  linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.95)),
  repeating-linear-gradient(0deg, rgba(255,45,85,0.06) 0 1px, transparent 1px 42px);
  border-top: 1px solid var(--line);
}
#oversight.overlay:not(:target) { display: none; }
#oversight .panel { width: min(820px, 92vw); background: #070709; border: 1px solid #1b1c21; border-radius: 16px; box-shadow: var(--shadow); padding: clamp(16px, 3vw, 28px); }
#oversight .panel h3 { margin: 0 0 8px; letter-spacing: 0.02em; }
#oversight .panel p { color: #c3c7ce; }
#oversight .panel .warn { color: var(--accent); }
#oversight .close { display: inline-flex; margin-top: 16px; color: var(--muted); }
#oversight .close:hover { color: var(--text); }
.bullets { list-style: none; padding: 0; margin: 0; }
.bullets li { position: relative; padding-left: 16px; color: #c7cbd2; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; opacity: 0.7; }

/* Grids - now always single column */
.grid-2 { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 20px; 
}

/* Specs (definition list) - vertical layout for better readability */
.specs { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 16px; 
  margin: 0; 
}
.specs dt { 
  color: var(--muted);
  font-weight: 600;
}
.specs dd { 
  margin: 0 0 12px 0; 
  color: var(--text); 
}

/* Badges */
.badges { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-bottom: 16px;
}
.badge { 
  display: inline-flex; 
  align-items: center; 
  padding: 6px 12px; 
  border-radius: 16px; 
  border: 1px solid var(--line); 
  background: #0b0c10; 
  color: #cdd1d8; 
  font-size: 12px; 
  font-weight: 500;
  letter-spacing: 0.02em; 
}
.badge.warn { 
  border-color: rgba(255,45,85,0.35); 
  color: var(--accent); 
  background: rgba(255,45,85,0.08);
}

/* Banner/Note */
.banner { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #090a0c; color: #c6cad1; }
.banner.warn { border-color: rgba(255,45,85,0.35); background: #0b0a0c; }
.note { color: #9aa0a8; }

/* Forms */
.form { 
  display: grid; 
  gap: 16px; 
  max-width: 600px; 
  margin: 0 auto;
}
.input, .textarea { 
  width: 100%; 
  background: var(--bg-elev); 
  border: 1px solid var(--line); 
  border-radius: 8px; 
  padding: 14px 16px; 
  color: var(--text);
  font-size: 16px; /* Prevents zoom on iOS */
}
.input::placeholder, .textarea::placeholder { 
  color: #8a8f97; 
}
.input:focus, .textarea:focus { 
  outline: none; 
  border-color: #ffffff33; 
  background: var(--bg-soft);
}
.textarea { 
  min-height: 120px; 
  resize: vertical; 
  font-family: inherit;
}
.form .actions { 
  display: flex; 
  gap: 12px; 
  align-items: flex-start;
  flex-direction: column;
}
.form .hint { 
  color: #8a8f97; 
  font-size: 13px;
  line-height: 1.4;
}

@media (min-width: 480px) {
  .form .actions {
    flex-direction: row;
    align-items: center;
  }
}

/* Applications Page Styles */
.applications-list {
  display: grid;
  gap: 24px;
  margin-top: 32px;
}

.application-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset, 0 8px 24px rgba(0,0,0,0.2);
}

.application-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.application-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.application-details {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.detail-row .label {
  color: var(--muted);
  font-size: 14px;
}

.detail-row .value {
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff6b85);
  border-radius: 3px;
  transition: width 300ms ease;
}

.progress-fill.complete {
  background: linear-gradient(90deg, #00c851, #007e33);
}

/* Progress width classes */
.progress-23 { width: 23%; }
.progress-54 { width: 54%; }
.progress-100 { width: 100%; }

.application-notes {
  margin-top: 12px;
}

.application-notes .note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
}

/* Status Badges */
.status-processing {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.status-review {
  background: rgba(0, 123, 255, 0.1);
  border-color: rgba(0, 123, 255, 0.3);
  color: #007bff;
}

.status-approved {
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.3);
  color: #28a745;
}

@media (max-width: 768px) {
  .application-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}