/* ==========================================================================
   Marines — Static CSS Design System
   Replaces Tailwind CSS + shadcn/ui component styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Colors — derived from the original oklch palette */
  --color-bg: #ffffff;
  --color-fg: #1e293b;
  --color-card: #f8fafc;
  --color-card-fg: #334155;
  --color-muted: #64748b;
  --color-muted-fg: #64748b;
  --color-accent: #0077cc;
  --color-accent-light: rgba(0, 119, 204, 0.10);
  --color-accent-hover: #005fa3;
  --color-accent-fg: #ffffff;
  --color-primary: #1e293b;
  --color-primary-fg: #ffffff;
  --color-border: #e2e8f0;
  --color-input: #f1f5f9;
  --color-destructive: #ef4444;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 5rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.18);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Container */
  --container-px: 1rem;
}

/* --------------------------------------------------------------------------
   2. MODERN RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-fg);
  background-color: var(--color-bg);
  min-height: 100vh;
}

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

img {
  height: auto;
}

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

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-fg);
}

p {
  overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.text-accent {
  background: linear-gradient(135deg, var(--color-accent), #38b2f0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--color-muted); }
.text-balance { text-wrap: balance; }

.lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.section {
  padding-block: var(--space-4xl);
}

.section--alt {
  background-color: var(--color-card);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__header p {
  max-width: 48rem;
  margin-inline: auto;
  margin-top: var(--space-md);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--color-muted);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }
.grid--5 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  :root { --container-px: 1.5rem; }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--5 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  :root { --container-px: 2rem; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--5 { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1280px) {
  :root { --container-px: 2.5rem; }
}

/* --------------------------------------------------------------------------
   5. NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-base);
}

.nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-fg);
}

.nav__logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.nav__links {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

.nav__links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav__links a:hover,
.nav__links a:focus-visible,
.nav__links a.active {
  color: var(--color-fg);
}

.nav__links a:hover::after,
.nav__links a:focus-visible::after,
.nav__links a.active::after {
  width: 100%;
}

.nav__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-fg);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.nav__hamburger:hover {
  background-color: var(--color-card);
}

.nav__hamburger .icon-close { display: none; }
.nav__hamburger[aria-expanded="true"] .icon-menu { display: none; }
.nav__hamburger[aria-expanded="true"] .icon-close { display: block; }

/* Mobile menu */
.nav__mobile {
  display: none;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) 0 var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.nav__mobile.is-open {
  display: flex;
}

.nav__mobile a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav__mobile a:hover,
.nav__mobile a:focus-visible {
  color: var(--color-fg);
  background-color: var(--color-card);
}

@media (min-width: 768px) {
  .nav__links { display: flex; }
  .nav__hamburger { display: none; }
  .nav__mobile { display: none !important; }
}

/* --------------------------------------------------------------------------
   6. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-card) 100%);
  padding-block: var(--space-4xl) var(--space-4xl);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.hero__title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hero h1 {
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.hero__certs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-md);
  max-width: 28rem;
}

.hero__cert {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.hero__cert svg {
  flex-shrink: 0;
  color: var(--color-accent);
}

.hero__image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 119, 204, 0.12), rgba(30, 41, 59, 0.08));
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  aspect-ratio: 1;
}

.hero__image-wrapper img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  width: 92%;
  height: 92%;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .hero { padding-block: 5rem 5rem; }
  .hero__grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* --------------------------------------------------------------------------
   7. SERVICES SECTION
   -------------------------------------------------------------------------- */
.service-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.service-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--color-accent-light);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
  flex-shrink: 0;
}

.service-card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.service-card p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   8. PROJECTS / PORTFOLIO SECTION
   -------------------------------------------------------------------------- */
.project-card {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  aspect-ratio: 3/2;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover img,
.project-card:focus-within img {
  transform: scale(1.05);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.project-card:hover .project-card__overlay,
.project-card:focus-within .project-card__overlay {
  opacity: 1;
}

.project-card__info {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-base);
}

.project-card:hover .project-card__info,
.project-card:focus-within .project-card__info {
  opacity: 1;
  transform: translateY(0);
}

.project-card__info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.project-card__info p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.project-card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 48rem;
  margin-inline: auto;
  margin-top: var(--space-3xl);
  text-align: center;
}

.stat__value {
  font-size: clamp(1.75rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-accent);
}

.stat__label {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   9. TECHNOLOGY SECTION
   -------------------------------------------------------------------------- */
.tech__grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.tech__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.tech__content > p {
  font-size: 1.125rem;
  color: var(--color-muted);
  line-height: 1.75;
}

.tech__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.tech__feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tech__feature-dot {
  width: 0.5rem;
  height: 0.5rem;
  min-width: 0.5rem;
  background: var(--color-accent);
  border-radius: 50%;
  margin-top: 0.55rem;
}

.tech__feature h3 {
  font-weight: 600;
  color: var(--color-fg);
  font-size: 1rem;
}

.tech__feature p {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-top: 0.125rem;
}

.tech__image {
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  height: 600px;
  object-fit: cover;
}

@media (min-width: 1024px) {
  .tech__grid { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   10. CLIENTS SECTION
   -------------------------------------------------------------------------- */
.clients-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.client-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-xs);
  text-align: center;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 220px;
}

.client-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.client-card__logo {
  width: 8rem;
  height: 8rem;
  object-fit: contain;
  object-position: center;
  mix-blend-multiply: multiply;
}

.client-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   11. CONTACT SECTION
   -------------------------------------------------------------------------- */
.contact__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.contact__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact__intro p {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--color-muted);
}

.contact__methods {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xl);
}

.contact__method {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.contact__method-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--color-accent-light);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
  flex-shrink: 0;
}

.contact__method-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.contact__method h3 {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-fg);
}

.contact__method p {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin-top: 0.125rem;
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  background: var(--color-primary);
  color: var(--color-primary-fg);
  padding-block: var(--space-3xl);
}

.footer__grid {
  display: grid;
  gap: var(--space-xl);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer__brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.125rem;
  font-weight: 700;
}

.footer__brand p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}

.footer h3 {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-primary-fg);
  margin-bottom: var(--space-md);
}

.footer ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer li,
.footer__contact-info p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
}

.footer__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

.footer__contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   13. COMPONENTS
   -------------------------------------------------------------------------- */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
  box-shadow: var(--shadow-xs);
}

.btn--primary:hover {
  background: #0f172a;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--outline {
  background: var(--color-bg);
  color: var(--color-fg);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}

.btn--outline:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  white-space: nowrap;
  line-height: 1.5;
  width: fit-content;
}

.badge--secondary {
  background: rgba(0, 119, 204, 0.10);
  color: var(--color-accent);
  border: 1px solid rgba(0, 119, 204, 0.25);
}

.badge--accent {
  background: var(--color-accent);
  color: var(--color-accent-fg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   14. SCROLL ANIMATIONS
   -------------------------------------------------------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.animate-on-scroll:nth-child(5) { transition-delay: 320ms; }

/* Counter animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 1.25rem;
  height: 1.25rem;
}

.icon--lg {
  width: 2rem;
  height: 2rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  border-radius: var(--radius-md);
  z-index: 100;
  font-weight: 500;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0.5rem;
}

/* --------------------------------------------------------------------------
   16. PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
  .nav,
  .hero__actions,
  .nav__hamburger {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .section { padding-block: 1rem; }
  .footer { background: #eee; color: #000; }
}

/* --------------------------------------------------------------------------
   17. REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
