/* ═══════════════════════════════════════════════════════════════════════
   AUTOMOBILITY — stylesheet
   ───────────────────────────────────────────────────────────────────────
   Contents
     1.  Design tokens  ← change colours, fonts and spacing here
     2.  Reset & base
     3.  Layout helpers
     4.  Typography
     5.  Buttons & links
     6.  Header / navigation
     7.  Hero
     8.  About
     9.  Services & cards
     10. Projects
     11. Contact & form
     12. Footer
     13. Scroll reveal animation
     14. Responsive (mobile)
   ═══════════════════════════════════════════════════════════════════ */


/* ═══ 1. DESIGN TOKENS ═════════════════════════════════════════════════
   Almost all styling decisions live here. Change a value once and it
   updates everywhere on the site.                                       */

:root {
  /* — Brand colour. This one line sets every accent on the site. — */
  --accent:          #1f4fd8;
  --accent-hover:    #1a42b6;
  --accent-soft:     #eef2ff;

  /* — Neutrals — */
  --ink:             #101114;   /* headings */
  --body:            #55585f;   /* body text */
  --muted:           #86899180; /* faint labels */
  --line:            #e6e5e1;   /* borders */
  --bg:              #fbfaf8;   /* page background */
  --surface:         #ffffff;   /* cards */
  --surface-alt:     #f4f3ef;   /* alternating sections */

  /* — Typography — */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif:   'Instrument Serif', Georgia, 'Times New Roman', serif;

  /* — Spacing & shape — */
  --container:       1180px;
  --gutter:          clamp(1.25rem, 5vw, 2.5rem);
  --section-y:       clamp(5rem, 11vw, 9rem);
  --radius:          14px;
  --radius-lg:       20px;

  /* — Elevation — */
  --shadow-sm:  0 1px 2px rgba(16, 17, 20, .04), 0 1px 3px rgba(16, 17, 20, .04);
  --shadow-md:  0 4px 12px rgba(16, 17, 20, .05), 0 12px 32px rgba(16, 17, 20, .06);
  --shadow-lg:  0 8px 20px rgba(16, 17, 20, .06), 0 24px 60px rgba(16, 17, 20, .10);

  /* — Motion — */
  --ease:   cubic-bezier(.22, 1, .36, 1);
  --fast:   .18s var(--ease);
  --slow:   .5s  var(--ease);
}

/* Optional dark mode — follows the visitor's system setting.
   Delete this whole block if you only ever want the light design. */
@media (prefers-color-scheme: dark) {
  :root {
    --accent:       #6d8dff;
    --accent-hover: #8aa4ff;
    --accent-soft:  #1a1e2e;
    --ink:          #f4f4f2;
    --body:         #a4a7ae;
    --muted:        #8a8d9580;
    --line:         #26272b;
    --bg:           #0c0d10;
    --surface:      #131418;
    --surface-alt:  #101116;
    --shadow-sm:  0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md:  0 4px 12px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .25);
    --shadow-lg:  0 8px 20px rgba(0, 0, 0, .35), 0 24px 60px rgba(0, 0, 0, .4);
  }
}


/* ═══ 2. RESET & BASE ══════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;   /* keeps anchors clear of the sticky header */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

ul { list-style: none; margin: 0; padding: 0; }

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 200;
  padding: .7rem 1.1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
}
.skip-link:focus { left: 1rem; }


/* ═══ 3. LAYOUT HELPERS ════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

.section--alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 46rem;
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
}


/* ═══ 4. TYPOGRAPHY ════════════════════════════════════════════════════ */

h1, h2, h3 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -.026em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

/* Headline words wrapped in <em> render in the serif italic —
   it's what gives the site its editorial, premium feel. */
h1 em, h2 em, h3 em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.01em;
}

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

.eyebrow {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.section__title { font-size: clamp(2rem, 4.4vw, 3.15rem); }

.section__sub {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  max-width: 38rem;
}

.lead {
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: -.011em;
}


/* ═══ 5. BUTTONS & LINKS ═══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 100px;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast),
              border-color var(--fast), transform var(--fast),
              box-shadow var(--fast);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(31, 79, 216, .22);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 22px rgba(31, 79, 216, .28);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink); background: var(--surface); }

.btn--sm    { padding: .6rem 1.15rem; font-size: .875rem; }
.btn--block { width: 100%; }

.btn__arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--fast); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--accent);
  font-size: .925rem;
  font-weight: 500;
}
.link-arrow svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--fast);
}
.link-arrow:hover svg { transform: translateX(4px); }


/* ═══ 6. HEADER / NAVIGATION ═══════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--fast), box-shadow var(--fast);
}
/* .is-scrolled is toggled by script.js once the page moves */
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  font-size: 1.075rem;
  letter-spacing: -.028em;
  color: var(--ink);
}
.logo__mark { width: 26px; height: 26px; fill: var(--accent); flex: none; }
.logo__dot  { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 2.25rem; }

.nav__list { display: flex; align-items: center; gap: 2rem; }
.nav__list a {
  position: relative;
  font-size: .95rem;
  color: var(--body);
  transition: color var(--fast);
}
.nav__list a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--slow);
}
.nav__list a:hover { color: var(--ink); }
.nav__list a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  place-items: center;
  align-content: center;
  gap: 5px;
}
.nav-toggle__bar {
  display: block;
  width: 17px; height: 1.5px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform var(--fast), opacity var(--fast);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bar:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle__bar:last-child  { transform: translateY(-3.25px) rotate(-45deg); }


/* ═══ 7. HERO ══════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  padding-block: clamp(4.5rem, 11vw, 8.5rem) clamp(4rem, 8vw, 6.5rem);
  overflow: hidden;
}

/* Soft brand-coloured glow behind the headline */
.hero__glow {
  position: absolute;
  top: -30%; left: 50%;
  width: min(1100px, 130vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 62%);
  pointer-events: none;
}

.hero__inner { position: relative; max-width: 58rem; }

.hero__title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  letter-spacing: -.035em;
  margin-bottom: 1.5rem;
}

.hero__lead {
  font-size: clamp(1.1rem, 2.1vw, 1.3rem);
  line-height: 1.6;
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

/* ═══ 8. ABOUT ═════════════════════════════════════════════════════════ */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.about__intro { position: sticky; top: 110px; }

.checklist { margin-top: 2rem; display: grid; gap: .85rem; }
.checklist li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--ink);
  font-size: 1rem;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0; top: .5em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}


/* ═══ 9. SERVICES & CARDS ═════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform var(--slow), box-shadow var(--slow), border-color var(--slow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.card--service { padding: 2rem 1.75rem 2.25rem; }
.card--service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.card__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  background: var(--accent-soft);
}
.card__icon svg {
  width: 21px; height: 21px;
  fill: none; stroke: var(--accent);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.card__title {
  font-size: 1.2rem;
  letter-spacing: -.018em;
  margin-bottom: .6rem;
}
.card__title a { transition: color var(--fast); }
.card__title a:hover { color: var(--accent); }

.card__text { font-size: .975rem; }


/* ═══ 10. PROJECTS ═════════════════════════════════════════════════════ */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 1.5rem;
}

.card--project { overflow: hidden; display: flex; flex-direction: column; }
.card--project:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card__media {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.card--project:hover .card__media img { transform: scale(1.04); }

.card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: 1.85rem 1.75rem 1.9rem;
}

.card__meta {
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--body);
  opacity: .75;
  margin-bottom: .7rem;
}

.card--project .card__text { margin-bottom: 1.35rem; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.6rem; }
.tags li {
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: .78rem;
  color: var(--body);
}

.card--project .link-arrow { margin-top: auto; }


/* ═══ 11. CONTACT & FORM ═══════════════════════════════════════════════ */

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contact__details {
  margin-top: 2.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.35rem;
}
.contact__details li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}
.contact__details li:last-child { border-bottom: 0; padding-bottom: 0; }
.contact__key {
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--body);
  opacity: .75;
}
.contact__details a {
  color: var(--ink);
  font-size: 1.05rem;
  transition: color var(--fast);
}
.contact__details a:hover { color: var(--accent); }

.contact__form { padding: clamp(1.75rem, 3vw, 2.25rem); }

.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  margin-bottom: .45rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink);
}
.field__opt { font-weight: 400; color: var(--body); }

.field input,
.field textarea {
  width: 100%;
  padding: .8rem .95rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .975rem;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.field input.is-invalid,
.field textarea.is-invalid { border-color: #d64545; }

/* Honeypot — hidden from humans, visible to bots */
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact__form .btn { margin-top: .5rem; }

.form__status {
  margin-top: .9rem;
  min-height: 1.4em;
  font-size: .9rem;
  text-align: center;
}
.form__status.is-error   { color: #d64545; }
.form__status.is-success { color: var(--accent); }


/* ═══ 12. FOOTER ═══════════════════════════════════════════════════════ */

.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.footer__tagline {
  margin-top: .9rem;
  font-size: .95rem;
  max-width: 20rem;
}

.footer__nav { display: grid; gap: .7rem; font-size: .95rem; }
.footer__nav a { transition: color var(--fast); }
.footer__nav a:hover { color: var(--accent); }

.footer__social { display: flex; gap: .6rem; }
.footer__social a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color var(--fast), color var(--fast), transform var(--fast);
}
.footer__social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.footer__social svg { width: 17px; height: 17px; fill: currentColor; }

.footer__legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--body);
  opacity: .8;
}
.footer__sep { opacity: .5; }


/* ═══ 13. SCROLL REVEAL ════════════════════════════════════════════════
   Elements with class="reveal" fade up as they enter the viewport.
   script.js adds .is-visible. Remove the class from an element in the
   HTML to opt it out.                                                   */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Stagger cards within a grid so they arrive one after another */
.cards .reveal:nth-child(2),
.projects .reveal:nth-child(2) { transition-delay: .08s; }
.cards .reveal:nth-child(3),
.projects .reveal:nth-child(3) { transition-delay: .16s; }
.cards .reveal:nth-child(4),
.projects .reveal:nth-child(4) { transition-delay: .24s; }

/* Respect visitors who've asked for less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}


/* ═══ 14. RESPONSIVE ═══════════════════════════════════════════════════ */

@media (max-width: 980px) {
  .about__grid,
  .contact__grid { grid-template-columns: 1fr; }
  .about__intro  { position: static; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__social { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: grid; }

  /* Mobile menu: slides down from the header */
  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 1.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--slow), opacity var(--slow), visibility var(--slow);
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a {
    display: block;
    padding: .95rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }
  .nav__list a::after { display: none; }

  .nav__cta { margin-top: 1.25rem; padding-block: .85rem; font-size: .95rem; }

  .contact__details li { grid-template-columns: 1fr; gap: .2rem; }
  .footer__inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 420px) {
  .hero__actions .btn { width: 100%; }
}
