/* ============================================================
   CorFive — Main Stylesheet
   Version: 0.2
   ============================================================ */

/* ------------------------------------------------------------
   1. Design Tokens
   ------------------------------------------------------------ */
:root {
  /* Colours */
  --bg:           #0b0b0f;
  --surface:      #17171d;
  --border:       #2a2a35;
  --text:         #ffffff;
  --muted:        #a5a5b5;
  --primary:      #7b3fe4;
  --primary-hover:#915cf7;
  --success:      #2ecc71;
  --warning:      #f39c12;
  --error:        #e74c3c;

  /* Typography */
  --font-base: Inter, sans-serif;
  --text-xs:   0.875rem;  /* 14px */
  --text-sm:   1rem;      /* 16px */
  --text-base: 1.125rem;  /* 18px */
  --text-lg:   1.25rem;   /* 20px */

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  6rem;
  --space-2xl: 8rem;

  /* Layout */
  --container-width: 1100px;
  --radius:          16px;
  --radius-sm:       10px;
}

/* ------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--text-base);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ------------------------------------------------------------
   3. Accessibility
   ------------------------------------------------------------ */

/* Skip navigation link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}

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

/* Focus indicator — applies to keyboard navigation only */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Remove focus ring for mouse/touch users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Respect reduced motion preference */
@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;
  }
}

/* ------------------------------------------------------------
   4. Layout
   ------------------------------------------------------------ */
.container {
  width: min(var(--container-width), 92%);
  margin-inline: auto;
}

/* ------------------------------------------------------------
   5. Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  max-width: 800px;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

p {
  margin-top: 0;
}

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.15em;
  margin-bottom: var(--space-sm);
}

.lead {
  max-width: 700px;
  font-size: var(--text-lg);
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.section-lead {
  max-width: 680px;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

/* ------------------------------------------------------------
   6. Header & Navigation
   ------------------------------------------------------------ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 15, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.logo__img {
  height: 56px;
  width: auto;
  display: block;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 2rem;
  font-size: var(--text-sm);
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--text);
}

nav a[aria-current="page"] {
  color: var(--primary);
}

/* Mobile toggle button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0.6rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile menu */
.mobile-menu {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-sm) 0;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu nav a {
  margin-left: 0;
  padding: 0.75rem var(--space-md);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--border);
}

.mobile-menu nav a:last-child {
  border-bottom: none;
}

/* ------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  min-height: 48px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-sm);
  font-family: var(--font-base);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--primary);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   8. Sections
   ------------------------------------------------------------ */
section {
  padding: var(--space-lg) 0;
}

/* ------------------------------------------------------------
   9. Hero
   ------------------------------------------------------------ */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero__background {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  opacity: 0.6;
}

.hero__banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

.hero__content {
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   10. Cards
   ------------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.card h3 {
  color: var(--text);
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   11. Engineering Principles
   ------------------------------------------------------------ */
.principles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.principles li {
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-sm);
}

.principles li::before {
  content: "→ ";
  color: var(--primary);
  font-weight: 700;
}

/* ------------------------------------------------------------
   12. Contact Section
   ------------------------------------------------------------ */
.contact {
  text-align: center;
}

.contact h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: var(--space-sm);
}

.contact p {
  color: var(--muted);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-md);
}

/* ------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------ */
footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0 var(--space-md);
  color: var(--muted);
  margin-top: var(--space-lg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  gap: var(--space-md) var(--space-lg);
  align-items: start;
}

.footer-brand {
  grid-column: 1;
  grid-row: 1;
}

.footer-brand .logo {
  display: inline-flex;
  margin-bottom: var(--space-sm);
}

.footer-brand .logo__img {
  height: 40px;
}

.footer-brand p {
  font-size: var(--text-xs);
  max-width: 420px;
  margin-bottom: 0;
}

.footer-nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-social {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 0;
}

.footer-social a {
  color: var(--primary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.15s ease;
}

.footer-social a:hover {
  color: var(--primary-hover);
}

.footer-meta {
  grid-column: 1 / -1;
  grid-row: 2;
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
}

.footer-meta p {
  font-size: var(--text-xs);
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   14. Alerts
   ------------------------------------------------------------ */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}

.alert--success { border-color: var(--success); background: rgba(46, 204, 113, 0.08); color: var(--success); }
.alert--warning { border-color: var(--warning); background: rgba(243, 156, 18, 0.08);  color: var(--warning); }
.alert--error   { border-color: var(--error);   background: rgba(231, 76,  60, 0.08);  color: var(--error);   }
.alert--info    { border-color: var(--primary);  background: rgba(123, 63, 228, 0.08); color: var(--primary); }

/* ------------------------------------------------------------
   15. Forms (ready for contact form implementation)
   ------------------------------------------------------------ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--space-sm);
}

label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  transition: border-color 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin: 0;
}

/* ------------------------------------------------------------
   16. Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  /* Show mobile toggle, hide desktop nav */
  .nav-toggle {
    display: flex;
  }

  header nav {
    display: none;
  }

  /* Hero */
  .hero {
    padding: 5rem 0 3rem;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem var(--space-md);
  }

  .footer-social {
    grid-column: 1;
    grid-row: 3;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem var(--space-md);
  }

  .footer-meta {
    grid-row: 4;
  }

  .footer-meta {
    grid-row: 3;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.4rem;
  }

  .buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* ------------------------------------------------------------
   17. Page hero variant (inner pages — shorter than homepage)
   ------------------------------------------------------------ */
.hero--page {
  padding: var(--space-xl) 0 var(--space-lg);
}

.hero--page h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

/* ------------------------------------------------------------
   18. Service detail sections (services page)
   ------------------------------------------------------------ */
.service-detail {
  border-top: 1px solid var(--border);
}

.service-detail--alt {
  background: var(--surface);
}

.service-detail__content {
  max-width: 720px;
}

.service-detail__content h2 {
  margin-bottom: var(--space-sm);
}

.service-detail__content p {
  color: var(--muted);
}

.service-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-list li {
  padding-left: 1.25rem;
  position: relative;
  color: var(--muted);
  font-size: var(--text-sm);
}

.service-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* ------------------------------------------------------------
   19. Narrow content column (about page prose)
   ------------------------------------------------------------ */
.content-narrow {
  max-width: 720px;
}

.content-narrow p {
  color: var(--muted);
}

/* ------------------------------------------------------------
   20. Card variants (about page)
   ------------------------------------------------------------ */
.card-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-list li {
  color: var(--muted);
  font-size: var(--text-sm);
  padding-left: 1.25rem;
  position: relative;
}

.card-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ------------------------------------------------------------
   21. Value list (about page)
   ------------------------------------------------------------ */
.value-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.value-list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.value-list li:last-child {
  border-bottom: none;
}

.value-list strong {
  color: var(--text);
  font-size: var(--text-sm);
}

.value-list span {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ------------------------------------------------------------
   22. Contact page layout
   ------------------------------------------------------------ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-xl);
  align-items: start;
  padding-bottom: var(--space-xl);
}

.contact-form-wrapper h2,
.contact-details h2 {
  margin-bottom: var(--space-sm);
}

.contact-details h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  font-size: var(--text-base);
  color: var(--text);
}

.contact-details p {
  color: var(--muted);
  font-size: var(--text-sm);
}

.contact-detail-list {
  margin: 0 0 var(--space-md);
  padding: 0;
}

.contact-detail-list dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contact-detail-list dd {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-base);
}

.contact-detail-list a {
  color: var(--primary);
  text-decoration: none;
}

.contact-detail-list a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.form-note {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.required {
  color: var(--error);
  margin-left: 2px;
}

/* ------------------------------------------------------------
   23. Responsive additions
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .contact-details {
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
  }
}

@media (max-width: 768px) {
  .value-list li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .service-detail--alt {
    background: transparent;
  }
}
