/* Shared styles for geessite.xyz.
   Order: tokens, base, layout helpers, components, page sections, scene.
   Every page links this one file. Change a token and the whole site follows. */

:root {
  /* Colour (light is the default). All text pairs pass WCAG AA; most pass AAA. */
  --bg: #eef3f6;
  --surface: #ffffff;
  --border: #c9d5de;
  --text: #13212b;
  --muted: #44566a;
  --accent: #0a5c8f;          /* links and focus rings */
  --btn-bg: #f5b323;          /* tape-measure yellow */
  --btn-bg-hover: #ffc43d;
  --btn-text: #13212b;
  --btn-edge: #13212b;
  --home: #f5b323;            /* handyman side */
  --it: #1f7fb8;              /* IT side */
  color-scheme: light;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.5rem;
  --space-7: 4rem;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-base: 1.125rem;
  --leading: 1.65;
  --measure: 62ch;
  --h1: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  --h2: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
  --h3: 1.3125rem;

  /* Layout */
  --wrap: 72rem;
  --gutter: 1.25rem;
  --radius: 0.75rem;
  --focus: 3px solid var(--accent);
}

/* Dark: follows the system unless the visitor chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e161c;
    --surface: #162129;
    --border: #26343f;
    --text: #e9eff3;
    --muted: #a6b4bf;
    --accent: #73c5f2;
    --btn-bg: #f5b323;
    --btn-bg-hover: #ffc43d;
    --btn-text: #13212b;
    --btn-edge: #f5b323;
    --it: #4aa8de;
    color-scheme: dark;
  }
}

/* Dark: chosen with the toggle */
:root[data-theme="dark"] {
  --bg: #0e161c;
  --surface: #162129;
  --border: #26343f;
  --text: #e9eff3;
  --muted: #a6b4bf;
  --accent: #73c5f2;
  --btn-bg: #f5b323;
  --btn-bg-hover: #ffc43d;
  --btn-text: #13212b;
  --btn-edge: #f5b323;
  --it: #4aa8de;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--space-5);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading);
}

main { flex: 1; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--space-3); text-wrap: balance; }
h1 { font-size: var(--h1); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--h2); font-weight: 750; letter-spacing: -0.01em; }
h3 { font-size: var(--h3); font-weight: 700; }

p { margin: 0 0 var(--space-4); }
main p, main ul, main ol { max-width: var(--measure); }
li + li { margin-top: var(--space-1); }

img, svg { max-width: 100%; }

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

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

[hidden] { display: none !important; }

/* ---------- Layout helpers ---------- */

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

.section { padding-block: var(--space-6); }
@media (min-width: 48rem) { .section { padding-block: var(--space-7); } }

main > .section + .section { border-top: 1px solid var(--border); }

.stack > * + * { margin-top: var(--space-4); }
.stack > * + h2 { margin-top: var(--space-6); }

.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.muted { color: var(--muted); }

.lead { font-size: 1.25rem; }

.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;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -5rem;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-2); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.4rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  color: var(--btn-text);
  background: var(--btn-bg);
  border: 2px solid var(--btn-edge);
  border-radius: var(--radius);
}
.btn:hover { background: var(--btn-bg-hover); text-decoration: underline; text-underline-offset: 0.2em; }

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

/* WhatsApp button: brand green, dark text (contrast checked) */
.btn--whatsapp { background: #25d366; color: #0b1f13; border-color: #0b1f13; }
.btn--whatsapp:hover { background: #3be37b; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; text-decoration: none; }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  font-size: 1.3125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand::before {
  content: "";
  width: 1.25rem;
  height: 1.25rem;
  background: var(--btn-bg);
  border: 2px solid var(--text);
  border-radius: 0.3rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
}
.site-nav li + li { margin-top: 0; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-inline: var(--space-1);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--muted); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--btn-bg); }

.nav-toggle { display: none; }

.theme-toggle::after { content: "(off)"; margin-left: 0.4em; font-weight: 400; }
.theme-toggle[aria-pressed="true"]::after { content: "(on)"; }

/* The menu only collapses when JavaScript can reopen it */
@media (max-width: 48rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; }
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card ul { margin: 0; padding-left: 1.25rem; }

/* Service cards: the coloured top edge says which side of the business it is,
   and the small label says it in words as well. */
.service { border-top: 8px solid var(--home); }
.service--it { border-top-color: var(--it); }
.service__label {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
}

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

.hero__grid { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 56rem) { .hero__grid { grid-template-columns: 1.5fr 1fr; } }

.hero h1 { max-width: 16ch; }
.hero .muted { margin-bottom: var(--space-3); font-weight: 600; }

.facts, .card .facts { margin: 0; padding: 0; list-style: none; max-width: none; }
.facts li { display: flex; gap: var(--space-3); align-items: flex-start; font-weight: 600; }
.facts li + li { margin-top: var(--space-4); }
.facts li::before {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
  background: var(--btn-bg);
  border: 2px solid var(--text);
  border-radius: 50%;
}
/* the tick is drawn with borders, so there is no icon font or image to load */
.facts li::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.35rem;
  width: 0.4rem;
  height: 0.75rem;
  border: solid var(--btn-text);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0.75);
}
.facts li { position: relative; }

/* One memorable element: a tape measure between the hero and the rest */
.tape {
  height: 22px;
  border-block: 2px solid var(--text);
  background:
    repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 10px) bottom / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 50px) bottom / 100% 13px no-repeat,
    #f5b323;
}

/* ---------- Steps (a real sequence, so numbered) ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0 0;
  display: grid;
  gap: var(--space-4);
  max-width: none;
}
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; margin: 0; }
.steps li + li { margin-top: 0; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-3);
  font-weight: 800;
  color: var(--btn-text);
  background: var(--btn-bg);
  border: 2px solid var(--text);
  border-radius: 50%;
}
.steps h3 { margin-bottom: var(--space-1); }
.steps p { margin: 0; color: var(--muted); }

/* ---------- Contact form area ---------- */

.form-area {
  max-width: 40rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.form-area iframe {
  display: block;
  width: 100%;
  height: 34rem;
  border: 0;
}

/* ---------- Notices ---------- */

.notice {
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 8px solid var(--it);
  border-radius: var(--radius);
}
.notice > :last-child { margin-bottom: 0; }
.notice > :first-child { margin-top: 0; }

.toc { margin: 0; padding-left: 1.25rem; }

/* ---------- Project links ---------- */

.project h3 { margin-bottom: var(--space-2); }
.project p { color: var(--muted); }
.project .actions { margin-top: var(--space-4); }

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: var(--space-5);
  font-size: 1rem;
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}
.site-footer p { margin: 0; max-width: none; }

/* ---------- Construction block ----------
   Scene parts (inside the SVG):
   digger:    .cn-boom > .cn-arm > .cn-bucket, plus .cn-plate-l and .cn-plate-r
   satellite: .cn-sat
   Fills: .cn-gold .cn-muted .cn-surface .cn-text. Outlines: .cn-ink */

.construction { --cn-time: 2s; }

.construction__title { margin-bottom: var(--space-2); }

.construction__sub {
  margin: 0 0 var(--space-5);
  color: var(--muted);
}

.construction__stage {
  display: block;
  width: 100%;
  max-width: 32rem;
  margin: 0;
  padding: var(--space-4);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.construction__stage:hover { border-color: var(--accent); }
.construction__stage svg { display: block; width: 100%; height: auto; }

.construction--satellite .construction__stage { max-width: 20rem; }

.construction__label {
  display: block;
  margin-top: var(--space-3);
  font-size: 1rem;
  font-weight: 600;
}

.cn-gold { fill: var(--btn-bg); }
.cn-muted { fill: var(--muted); }
.cn-surface { fill: var(--surface); }
.cn-text { fill: var(--text); }
.cn-ink { stroke: var(--text); stroke-linecap: round; stroke-linejoin: round; }

/* Rest pose */
.cn-boom { transform: rotate(-25deg); }
.cn-arm { transform: rotate(65deg); }
.cn-bucket { transform: rotate(-40deg); }
.cn-plate-l { transform-origin: 386px 200px; }
.cn-plate-r { transform-origin: 486px 200px; }
.cn-sat { transform-origin: 50px 50px; }

/* Plays once and holds the end state */
.is-playing .cn-boom { animation: cn-boom var(--cn-time) ease-in-out forwards; }
.is-playing .cn-arm { animation: cn-arm var(--cn-time) ease-in-out forwards; }
.is-playing .cn-bucket { animation: cn-bucket var(--cn-time) ease-in-out forwards; }
.is-playing .cn-plate-l { animation: cn-plate-l var(--cn-time) ease-in-out forwards; }
.is-playing .cn-plate-r { animation: cn-plate-r var(--cn-time) ease-in-out forwards; }
.is-playing .cn-sat { animation: cn-sat var(--cn-time) ease-out forwards; }

/* End state (also what reduced-motion visitors see) */
.is-played .cn-plate-l { transform: translate(-16px, -9px) rotate(-6deg); }
.is-played .cn-plate-r { transform: translate(32px, 12px) rotate(17deg); }
.is-played .cn-sat { transform: translate(12px, -10px) rotate(8deg); }

@keyframes cn-boom {
  0% { transform: rotate(-25deg); }
  22% { transform: rotate(-48deg); }
  36% { transform: rotate(-5deg); }
  55% { transform: rotate(-35deg); }
  100% { transform: rotate(-25deg); }
}
@keyframes cn-arm {
  0% { transform: rotate(65deg); }
  22% { transform: rotate(20deg); }
  36% { transform: rotate(85deg); }
  55% { transform: rotate(45deg); }
  100% { transform: rotate(65deg); }
}
@keyframes cn-bucket {
  0% { transform: rotate(-40deg); }
  22% { transform: rotate(-65deg); }
  36% { transform: rotate(-92deg); }
  55% { transform: rotate(15deg); }
  100% { transform: rotate(-40deg); }
}
@keyframes cn-plate-l {
  0%, 36% { transform: none; }
  55%, 100% { transform: translate(-16px, -9px) rotate(-6deg); }
}
@keyframes cn-plate-r {
  0%, 36% { transform: none; }
  55%, 100% { transform: translate(32px, 12px) rotate(17deg); }
}
@keyframes cn-sat {
  0% { transform: none; }
  100% { transform: translate(12px, -10px) rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .construction * { animation: none !important; }
}
