/* ==========================================================
   Lewis Web Studio - stylesheet
   Edit colours and fonts here; everything else uses these.
   ========================================================== */
:root {
  /* Colours (checked for contrast: ink on bg is about 16:1, accent on bg about 8:1) */
  --color-bg: #fbfaf7;
  --color-surface: #ffffff;
  --color-ink: #14181f;
  --color-muted: #4a5260;
  --color-line: #d9d6cf;
  --color-accent: #1e40af;
  --color-accent-ink: #ffffff;
  --color-accent-hover: #172f80;
  --color-focus: #b45309;
  --color-dark: #14181f;
  --color-dark-ink: #f3f1ec;

  /* Fonts: system stacks, so nothing is downloaded */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Spacing and layout */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --max-width: 68rem;
  --radius: 6px;
  --tap: 2.75rem; /* 44px minimum tap target */

  /* Motion (all switched off for visitors who prefer reduced motion) */
  --header-duration: 300ms;
  --reveal-duration: 600ms;
  --reveal-distance: 20px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
}

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

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 var(--space-2); }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.125rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--space-2); }
ul, ol { margin: 0 0 var(--space-2); padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

a { color: var(--color-accent); text-underline-offset: 0.2em; }
a:hover { color: var(--color-accent-hover); }

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

.wrap { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-2); }

.section { padding: var(--space-5) 0; }
.section--alt { background: var(--color-surface); border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.section__intro { color: var(--color-muted); max-width: 40rem; }

.eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-ink);
  color: var(--color-bg);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-1); color: var(--color-bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  cursor: pointer;
}
.btn:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: var(--color-accent-ink); }
.btn--outline { background: transparent; color: var(--color-accent); }
.btn--outline:hover { background: var(--color-accent); color: var(--color-accent-ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-ink);
  text-decoration: none;
}
.brand:hover { color: var(--color-ink); }

.nav-toggle {
  display: none;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--color-ink);
  background: transparent;
  border: 2px solid var(--color-ink);
  border-radius: var(--radius);
  cursor: pointer;
}

.site-nav { width: 100%; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.site-nav li { margin: 0; }
.site-nav a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:not(.btn):hover { text-decoration: underline; }
.site-nav .btn { margin: var(--space-1) 0 var(--space-2); width: 100%; }

/* Only hide the nav behind the toggle when JavaScript is running */
.js .nav-toggle { display: inline-flex; align-items: center; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

/* ---------- Hero ---------- */
.hero { padding: var(--space-5) 0 var(--space-5); }
.hero p.lead { font-size: 1.25rem; color: var(--color-muted); max-width: 36rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------- Services ---------- */
.grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; margin-top: var(--space-3); }
.item { border-top: 3px solid var(--color-ink); padding-top: var(--space-2); }
.item p { color: var(--color-muted); margin: 0; }

/* ---------- Work ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__shot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: #e8e5de;
  color: var(--color-muted);
  font-size: 0.9375rem;
  text-align: center;
  padding: var(--space-2);
}
.card__body { padding: var(--space-3); display: flex; flex-direction: column; flex: 1; align-items: flex-start; }
.card__body p { color: var(--color-muted); }
.card__body .btn { margin-top: auto; }
.label {
  display: inline-block;
  margin-bottom: var(--space-1);
  padding: 0.15rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink);
  border: 2px solid var(--color-ink);
  border-radius: 999px;
}

/* ---------- How it works ---------- */
.steps { list-style: none; padding: 0; margin: var(--space-3) 0 0; counter-reset: step; max-width: 40rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 var(--space-3) 3.25rem;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-bg);
  background: var(--color-ink);
  border-radius: 50%;
}
.steps strong { display: block; }
.steps span { color: var(--color-muted); }

/* ---------- Pricing ---------- */
.price { font-size: clamp(2.25rem, 8vw, 3.25rem); font-weight: 700; line-height: 1.1; margin-bottom: 0.25rem; }
.price small { font-size: 1rem; font-weight: 500; color: var(--color-muted); }
.pricing-box { max-width: 32rem; margin-top: var(--space-3); padding: var(--space-3); background: var(--color-bg); border: 1px solid var(--color-line); border-radius: var(--radius); }

/* ---------- About ---------- */
.prose { max-width: 40rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; margin-top: var(--space-3); }
.form label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form .field { margin-bottom: var(--space-2); }
.form input, .form textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 2px solid var(--color-muted);
  border-radius: var(--radius);
}
.form textarea { min-height: 9rem; resize: vertical; }
.form .hint { font-size: 0.9375rem; color: var(--color-muted); }
/* Honeypot field: hidden from people and screen readers, visible to simple bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-details p { margin-bottom: var(--space-1); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: var(--color-dark-ink); padding: var(--space-4) 0; font-size: 0.9375rem; }
.site-footer a { color: var(--color-dark-ink); }
.site-footer a:hover { color: #ffffff; }
.site-footer p { margin-bottom: var(--space-1); }
.site-footer address { font-style: normal; margin-bottom: var(--space-2); }
.site-footer :focus-visible { outline-color: #fbbf24; }
.footer-links a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- Privacy page ---------- */
.legal { padding: var(--space-4) 0 var(--space-5); }
.legal .prose h2 { margin-top: var(--space-4); font-size: 1.375rem; }

/* ---------- Larger screens ---------- */
@media (min-width: 44rem) {
  .wrap { padding: 0 var(--space-3); }
  .section { padding: var(--space-6) 0; }
  .hero { padding: var(--space-6) 0; }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 3fr 2fr; }
}

@media (min-width: 60rem) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }

  /* Desktop nav: always visible, toggle hidden */
  .js .nav-toggle { display: none; }
  .js .site-nav, .site-nav { display: block; width: auto; }
  .site-nav ul { flex-direction: row; align-items: center; gap: var(--space-3); }
  .site-nav .btn { margin: 0; width: auto; }
}

/* ---------- Scroll and typing effects ----------
   Content is only hidden under html.anim, which JavaScript adds when it is safe to
   animate. Without JavaScript, or with reduced motion, everything shows normally. */

/* Header slides away when scrolling down and returns when scrolling up */
.js .site-header { transition: transform var(--header-duration) ease; }
.site-header--hidden { transform: translateY(-100%); }

/* Sections fade in and slide up slightly */
.anim .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--reveal-duration) ease, transform var(--reveal-duration) ease;
}
.anim .reveal.is-visible { opacity: 1; transform: none; }

/* Hero headline typewriter: the untyped part keeps its space but is invisible */
.tw-rest { visibility: hidden; }
.tw-typed::after {
  content: "";
  border-right: 2px solid currentColor;
  margin: 0 -3px 0 1px; /* net zero width, so the cursor never moves the text */
  animation: tw-blink 1s step-end infinite;
}
.tw-typed.is-done::after { animation: tw-fade 600ms ease 800ms forwards; }
@keyframes tw-blink { 50% { opacity: 0; } }
@keyframes tw-fade { to { opacity: 0; } }

@media print {
  .anim .reveal { opacity: 1 !important; transform: none !important; }
  .site-header--hidden { transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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