/* Skunkworks Group - site.css
   Replaces normalize.css, main.css, type.css, htmlItems.css and design.css.
   Mobile first: base styles are for phones, min-width queries add the wider layouts. */

/* ---------- Fonts ---------- */
/* Same files as before: they live in css/fonts/ */
@font-face {
  font-family: 'crackhousemedium';
  src: url('./fonts/ufonts.com_crackhouse_1_-webfont.eot');
  src: url('./fonts/ufonts.com_crackhouse_1_-webfont.eot?#iefix') format('embedded-opentype'),
       url('./fonts/ufonts.com_crackhouse_1_-webfont.woff') format('woff'),
       url('./fonts/ufonts.com_crackhouse_1_-webfont.ttf') format('truetype'),
       url('./fonts/ufonts.com_crackhouse_1_-webfont.svg#crackhousemedium') format('svg');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --purple: #51066f;
  --purple-deep: #3a044f;
  --green: #009736;
  --green-text: #007a2c;      /* darker green for small text, passes contrast on white */
  --paper: #f4f2f6;
  --card: #ffffff;
  --ink: #2e2e33;
  --ink-soft: #5a5a62;

  --display: 'crackhousemedium', 'Lato', sans-serif;
  --body: 'Lato', verdana, arial, helvetica, sans-serif;

  --radius: 0.9rem;
  --gap: clamp(1rem, 4vw, 2rem);
  --shadow: 0 0.6rem 1.6rem rgba(58, 4, 79, 0.12);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 90%;
}

body {
  margin: 0;
  font: 1.0625rem/1.65 var(--body);
  color: var(--ink);
  background: var(--paper);
}

[hidden] { display: none !important; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, p, figure, ul { margin: 0; }

a { color: var(--purple); }
a:hover { color: var(--purple-deep); }

:focus-visible {
  outline: 0.2rem solid var(--green);
  outline-offset: 0.2rem;
  border-radius: 0.2rem;
}

/* ---------- Shared headings ---------- */
h1, h2 {
  font-family: var(--display);
  font-weight: normal;        /* crackhouse is already a heavy face */
  color: var(--purple);
  line-height: 1.1;
}

.hl { color: var(--green); }  /* the green highlight words */

/* ---------- Layout wrappers ---------- */
.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 0.3rem solid var(--purple);
  position: relative;
}

/* thin green stripe under the purple one */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.65rem;
  height: 0.3rem;
  background: var(--green);
}

.site-header .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-block: 1.25rem;
}

.logo img {
  width: min(18rem, 70vw);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1.4rem;
  border-radius: 99rem;
  font-weight: 700;
  text-decoration: none;
  border: 0.15rem solid var(--purple);
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}

.btn-solid { background: var(--purple); color: #fff; }
.btn-solid:hover { background: var(--purple-deep); color: #fff; }

.btn-line { background: transparent; color: var(--purple); }
.btn-line:hover { background: var(--green); border-color: var(--green); color: #fff; }

.btn:active { transform: translateY(0.1rem); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(2.5rem, 9vw, 5.5rem) clamp(2rem, 6vw, 3.5rem);
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 3.25rem);
  margin-bottom: 1rem;
  animation: rise 0.7s ease-out both;   /* the one bit of motion on the page */
}

.hero p {
  max-width: 46rem;
  color: var(--ink-soft);
}

.hero p + p { margin-top: 0.8rem; }

.hero .lead {
  font-size: 1.2rem;
  color: var(--ink);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Services ---------- */
.services {
  display: grid;
  gap: var(--gap);
  padding-bottom: clamp(2.5rem, 8vw, 5rem);
}

.service {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.25rem, 5vw, 2.25rem);
  background: var(--card);
  border-radius: var(--radius);
  border-top: 0.3rem solid var(--green);
  box-shadow: var(--shadow);
}

.service h2 {
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  margin-bottom: 0.6rem;
}

.shots {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

/* Photos look like they've been taped to the workshop wall */
.shot {
  position: relative;
  padding: 0.6rem 0.6rem 0.9rem;
  background: var(--paper);
  border-radius: 0.3rem;
  box-shadow: 0 0.3rem 0.9rem rgba(0, 0, 0, 0.14);
  transform: rotate(-1.2deg);
}

.shot:nth-child(even) { transform: rotate(1deg); }

.shot::before {                 /* the bit of tape */
  content: "";
  position: absolute;
  top: -0.7rem;
  left: 50%;
  width: 4rem;
  height: 1.3rem;
  margin-left: -2rem;
  background: rgba(0, 151, 54, 0.55);
  transform: rotate(2deg);
}

.shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.15rem;
}

.shot figcaption {
  margin-top: 0.7rem;
  font-size: 0.92rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 1.75rem 2.5rem;
  background: var(--purple);
  color: #e9d9f0;
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a { color: #fff; }

/* ---------- Wider screens ---------- */
@media (min-width: 40em) {
  .site-header .wrap {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* tablets: photos sit side by side under the text */
@media (min-width: 40em) and (max-width: 55.99em) {
  .shots { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
}

/* desktop: photos become a fixed-width column beside the text */
@media (min-width: 56em) {
  body { font-size: 1rem; }

  .service {
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 2.5rem;
    align-items: start;
  }

  .service .text { max-width: 40rem; }

  /* every second service puts its photos on the left */
  .service:nth-child(even) { grid-template-columns: 17rem minmax(0, 1fr); }
  .service:nth-child(even) .shots { order: -1; }
  .service:nth-child(even) .text { justify-self: end; }

  /* a service with no photos uses the full width */
  .service:not(:has(.shots)) { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero h1 { animation: none; }
  .btn { transition: none; }
}

@media print {
  body { background: #fff; }
  .site-header::after { display: none; }
  .service { box-shadow: none; break-inside: avoid; }
}
