@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --accent: #48B9D1;
  --bg: #090909;
  --card: #171616;
  --muted: #C4C4C4;
  --space: 40px; /* vertical padding of every section; doubles up between sections */
}

*, *::before, *::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: #fff;
  background: var(--bg);
}

h1, h2, h3, p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 90%;
  margin: 0 auto;
}

main > section {
  padding-block: var(--space);
}

h2 {
  margin-bottom: 32px;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
  text-align: center;
}

/* White text stays above 4.5:1 contrast across the whole gradient */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border: 1px solid #000;
  border-radius: 36px;
  background: linear-gradient(260deg, #0B506C 0%, #1B7A93 100%);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover, .hero .btn {
  border-color: #fff;
}

/* Header: logo and a one-line menu of in-page links */
.site-header {
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}

.logo-link {
  display: block;
}

.logo {
  display: block;
  width: 220px;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav a:focus-visible {
  color: #fff;
}

/* Hero: full width; the background image fades into the page at the top and bottom */
main > .hero {
  padding: 120px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  text-align: center;
  background: linear-gradient(var(--bg), transparent 15%, transparent 65%, var(--bg)),
              var(--bg) url('/img/hero.webp') center / cover no-repeat;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: 0.68px;
  line-height: 1.1;
}

.hero p {
  max-width: 60ch;
  font-size: 1.5rem;
}

/* Client projects: three then two on desktop, two per row on tablets, one on phones */
.projects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.project {
  flex: 0 1 calc((100% - 40px) / 3);
  display: flex;
  flex-direction: column;
}

.project img {
  width: auto;
  height: 40px;
  align-self: flex-start;
  margin-bottom: 20px;
}

.card.project h3 {
  min-height: 0;
  margin-bottom: 8px;
}

.project .role {
  margin-top: auto;
  padding-top: 16px;
  color: #fff;
}

.project .role::before {
  content: "";
  display: block;
  margin-bottom: 16px;
  border-top: 1px solid #333;
}

/* Services: three across (the Practical AI card spans two), two on tablets, one on phones */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  padding: 24px;
  background: var(--card);
  border: 1px solid #444;
  border-radius: 10px;
}

.card h3 {
  min-height: 2.6em; /* two lines, so the text in every card starts at the same height */
  margin-bottom: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent);
}

.card p {
  color: var(--muted);
}

.icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  padding: 11px;
  border-radius: 10px;
  background: rgba(72, 185, 209, 0.12);
  fill: var(--accent);
}

/* Practical AI card: twice the width of a service card, with a faint accent border and tint
   so it reads as slightly more prominent without changing the page's look */
.ai-card {
  grid-column: span 2;
  border-color: rgba(72, 185, 209, 0.35);
  background: linear-gradient(rgba(72, 185, 209, 0.04), rgba(72, 185, 209, 0.04)), var(--card);
}

.more {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.more:hover, .more:focus-visible {
  text-decoration: underline;
}

.more svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
}

/* Practical AI page */
.narrow {
  max-width: 65ch;
  margin-inline: auto;
}

.narrow p + p {
  margin-top: 12px;
}

p.narrow {
  margin-bottom: 32px;
}

.ai-points, .steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.ai-points {
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
}

.ai-points li {
  display: flex;
  gap: 16px;
}

.ai-points .icon {
  flex-shrink: 0;
  margin: 0;
}

.ai-points strong, .steps strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.125rem;
  font-weight: 600;
}

.ai-points p, .steps p {
  color: var(--muted);
}

/* Steps read left to right along an accent rule; the numbers come from the ordered list */
.steps {
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}

.steps li {
  padding-top: 16px;
  border-top: 2px solid rgba(72, 185, 209, 0.5);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--accent);
}

/* Call to action: full width; the background image fades into the page at the top and bottom */
main > .cta {
  padding: calc(var(--space) * 2) 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  background: linear-gradient(var(--bg), transparent 30%, transparent 70%, var(--bg)),
              url('/img/cta.webp') center / cover no-repeat;
}

.cta p {
  font-size: 1.5rem;
}

/* Contact */
.contact {
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  gap: 50px;
}

.contact > div {
  flex: 0 1 40%;
}

.contact form {
  flex: 0 1 55%;
  max-width: 600px;
}

.contact h2 {
  margin-bottom: 16px;
  text-align: left;
}

.details {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.details li + li {
  margin-top: 8px;
}

.details span {
  display: inline-block;
  min-width: 5.5em;
  color: var(--muted);
}

.details a {
  color: var(--accent);
}

.contact label {
  display: block;
  margin: 16px 0 6px;
}

.contact label:first-child {
  margin-top: 0;
}

.contact label::after {
  content: "*";
  color: red;
  margin-left: 5px;
}

/* The #666 border keeps each field's edge above 3:1 contrast against the page */
.contact input, .contact textarea {
  display: block;
  width: 100%;
  height: 52px;
  padding: 12px 14px;
  border: 1px solid #666;
  border-radius: 10px;
  background: var(--card);
  color: #fff;
  font: inherit;
}

.contact textarea {
  height: 140px;
  resize: vertical;
}

.contact input:focus-visible, .contact textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact .btn {
  margin-top: 24px;
}

/* Footer */
.site-footer {
  padding-block: var(--space);
  border-top: 1px solid #222;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
}

.site-footer span, .site-footer a {
  white-space: nowrap; /* on phones, break between items, not inside them */
}

.site-footer img {
  display: block;
  margin-bottom: 12px;
}

@media (max-width: 1200px) {
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.25rem; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .ai-card h3 { min-height: 0; } /* alone on its row here, so no title to line up with */
  .project { flex-basis: calc((100% - 20px) / 2); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --space: 28px; }
  main > .hero { padding: 72px 20px; }
  .hero h1 { font-size: 2rem; }
  .hero p, .cta p { font-size: 1.125rem; }
  h2 { font-size: 2rem; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .card h3 { min-height: 0; }
  .project { flex-basis: 100%; }
  .logo { width: min(200px, 55vw); }
  .site-header { padding-inline: 0; }
  .site-nav { width: 100%; flex-wrap: wrap; gap: 8px 18px; }
  .ai-card { grid-column: auto; }
  .ai-points, .steps { grid-template-columns: 1fr; }
  .ai-points li { flex-direction: column; gap: 12px; }
  .contact { flex-direction: column; gap: 30px; }
  .contact > div, .contact form { flex-basis: auto; max-width: none; }
}
