/* =============================================================================
   ADCI Website — style.css
   Phase 1: Reset, custom properties, minimal readable typography
   Phase 2: Full visual design, layout, responsive
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CSS Custom Properties
   ----------------------------------------------------------------------------- */

:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-surface: #17448c10;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-accent: #17438C;
  --color-accent-hover: #3c67ac;
  --color-border: #e8e5e0;
  --color-nav-shadow: rgba(26, 26, 26, 0.08);

  /* Typography */
  --font-heading: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --section-padding: clamp(64px, 8vw, 100px);
  --container-max: 1100px;
  --container-padding: 24px;

  /* Nav */
  --nav-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-smooth: 300ms cubic-bezier(0.25, 0, 0.1, 1);
}

/* -----------------------------------------------------------------------------
   Reset
   ----------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* -----------------------------------------------------------------------------
   Skip Link
   ----------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 8px 16px;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 14px;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

/* -----------------------------------------------------------------------------
   Container
   ----------------------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* -----------------------------------------------------------------------------
   Typography
   ----------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: .5rem;
}

h3 {
  font-size: clamp(1.0625rem, 1.75vw, 1.3125rem);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
}

a:hover {
  color: var(--color-accent-hover);
}

/* -----------------------------------------------------------------------------
   Navigation — list reset
   ----------------------------------------------------------------------------- */

.nav-links {
  list-style: none;
}

/* =============================================================================
   PHASE 2: LAYOUT & VISUAL DESIGN
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */

.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--color-accent);
  color: #d4ebee;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 5px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #edf3f4;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* -----------------------------------------------------------------------------
   Site Header / Navigation
   ----------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
}

.site-header.scrolled {
  background: var(--color-bg);
  box-shadow: 0 1px 0 var(--color-border), 0 4px 16px var(--color-nav-shadow);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  height: 36px;
  width: auto;
}

/* Mobile: hamburger toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  transform-origin: center;
}

/* Hamburger → X when open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

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

/* Mobile nav menu */
.nav-links {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 8px 24px var(--color-nav-shadow);
  padding: 8px 0 16px;
}

.nav-links.is-open {
  display: block;
}

.nav-links li {
  border-bottom: none;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px var(--container-padding);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
  min-height: 44px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
}

/* Desktop nav */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 4px;
    align-items: center;
  }

  .nav-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.9375rem;
    min-height: auto;
    position: relative;
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
  }

  .nav-link:hover::after,
  .nav-link.active::after {
    transform: scaleX(1);
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--color-text);
  }
}

/* Prevent body scroll when mobile menu is open */
body.nav-open {
  overflow: hidden;
}

/* -----------------------------------------------------------------------------
   Hero Section
   ----------------------------------------------------------------------------- */

#hero {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: var(--nav-height);
  padding-bottom: clamp(48px, 6vw, 80px);
  background-color: var(--color-bg);
}

#hero .container {
  max-width: 760px;
  padding-top: clamp(40px, 5vw, 64px);
}

#hero h1 {
  max-width: 14ch;
  margin-bottom: 1.25rem;
}

#hero .hero-sub {
  font-size: clamp(1.0625rem, 1.75vw, 1.25rem);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: 2.5rem;
  max-width: 42ch;
}

@media (max-width: 767px) {
  #hero {
    min-height: 85svh;
    align-items: flex-start;
  }

  #hero .container {
    padding-top: clamp(32px, 6vw, 48px);
  }

  #hero .btn-primary {
    display: block;
    text-align: center;
  }
}

/* -----------------------------------------------------------------------------
   Story Section
   ----------------------------------------------------------------------------- */

#story {
  padding: var(--section-padding) 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

#story .container {
  max-width: 760px;
}

#story h2 {
  margin-bottom: clamp(24px, 3vw, 40px);
}

#story p {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

#story p:last-child {
  margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
   Services Section — Tier Cards
   ----------------------------------------------------------------------------- */

#services {
  padding: var(--section-padding) 0;
}

#services h2 {
  margin-bottom: clamp(32px, 4vw, 48px);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.tier-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.06);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.tier-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26, 26, 26, 0.1);
}

/* Highlight the Standard tier */
.tier-card--recommended {
  border-color: var(--color-accent);
  position: relative;
}

.tier-card--recommended::before {
  content: 'Most Popular';
  position: absolute;
  top: -1px;
  left: 32px;
  padding: 3px 10px;
  background: var(--color-accent);
  color: #1a1a1a;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0 0 5px 5px;
}

.tier-card-name {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.625rem;
}

.tier-card-price {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.tier-card-tagline {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.tier-card-features {
  list-style: none;
  margin-bottom: 2rem;
  flex: 1;
}

.tier-card-features li {
  padding: 7px 0;
  font-size: 0.9375rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-left: 20px;
  position: relative;
}

.tier-card-features li:last-child {
  border-bottom: none;
}

.tier-card-features li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: 0.875rem;
}

.tier-card .btn-primary {
  display: block;
  text-align: center;
  margin-top: auto;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
  }
}

/* -----------------------------------------------------------------------------
   Work Section — Portfolio Projects
   ----------------------------------------------------------------------------- */

#work {
  padding: var(--section-padding) 0;
  border-top: 1px solid var(--color-border);
}

#work h2 {
  margin-bottom: clamp(40px, 5vw, 64px);
}

.project {
  margin-bottom: clamp(56px, 7vw, 88px);
}

.project:last-child {
  margin-bottom: 0;
}

/* Mobile: stacked */
.project-content {
  margin-bottom: 28px;
}

.project-name {
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-description {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.7;
  max-width: 60ch;
  margin-bottom: 1rem;
}

.project-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.project-tech {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-text-muted);
}

.project-build-time {
  font-weight: 600;
  color: var(--color-accent);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.project-link::after {
  content: '↗';
  font-size: 0.875rem;
  transition: transform var(--transition-fast);
}

.project-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.project-link:hover::after {
  transform: translate(2px, -2px);
}

.project-image {
  border-radius: 8px;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(26, 26, 26, 0.08);
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--color-surface);
}

/* Desktop: alternating image/text layout */
@media (min-width: 1024px) {
  .project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
  }

  .project:nth-of-type(even) .project-content {
    order: 2;
  }

  .project:nth-of-type(even) .project-image {
    order: 1;
  }

  .project-content {
    margin-bottom: 0;
  }
}

/* -----------------------------------------------------------------------------
   Process Section
   ----------------------------------------------------------------------------- */

#process {
  padding: var(--section-padding) 0;
  background: var(--color-surface);
}

#process h2 {
  margin-bottom: clamp(36px, 4vw, 56px);
}

.process-steps {
  list-style: none;
  counter-reset: process-counter;
}

.process-step {
  counter-increment: process-counter;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 24px;
  margin-bottom: clamp(32px, 4vw, 48px);
  position: relative;
}

.process-step:last-child {
  margin-bottom: 0;
}

/* Step number as a pseudo-element */
.process-step::before {
  content: counter(process-counter, decimal-leading-zero);
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
  padding-top: 2px;
  min-width: 60px;
  text-align: right;
}

.process-step-title {
  font-size: clamp(1rem, 1.75vw, 1.1875rem);
  font-weight: 700;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.process-step p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

/* On desktop, a subtle connector line between steps */
@media (min-width: 768px) {
  .process-steps {
    max-width: 720px;
  }

  .process-step {
    gap: 0 32px;
  }

  .process-step::before {
    min-width: 72px;
  }
}

/* -----------------------------------------------------------------------------
   Contact Section
   ----------------------------------------------------------------------------- */

#contact {
  padding: var(--section-padding) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

#contact h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  margin-bottom: 1rem;
}

#contact > .container > p:first-of-type {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  max-width: 44ch;
}

#calendly-embed {
  min-height: 600px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#calendly-embed::before {
  content: 'Scheduling widget loads here';
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-family: var(--font-body);
}

.contact-email {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.contact-email a {
  font-weight: 500;
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.site-footer p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-accent);
}

@media (min-width: 768px) {
  .site-footer .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-links {
    justify-content: flex-end;
  }
}

/* =============================================================================
   404 PAGE
   ============================================================================= */

.page-404 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100svh;
  padding: clamp(48px, 8vw, 80px) 0;
}

.page-404 .container {
  max-width: 600px;
}

.page-404-code {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.page-404 h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

.page-404 p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.page-404 .btn-primary {
  text-decoration: none;
}

/* -----------------------------------------------------------------------------
   Learn More Button
   ----------------------------------------------------------------------------- */

.btn-learn-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 24px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.btn-learn-more:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* -----------------------------------------------------------------------------
   Modal
   ----------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: 12px;
  padding: 40px;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.is-open .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-body h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-body .modal-tagline {
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 24px;
}

.modal-body h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--color-text);
}

.modal-body ul {
  list-style: none;
  margin-bottom: 8px;
}

.modal-body ul li {
  padding: 4px 0 4px 20px;
  position: relative;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.modal-body ul li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.modal-body p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.modal-cta {
  display: inline-block;
  margin-top: 24px;
  text-decoration: none;
}
