/* Temporary landing page. Same fonts, colours and hero shape as the main site. */
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}

/* Handwriting font, as used for the main site's hero tagline */
@font-face {
  font-family: 'Caveat';
  src: url('/fonts/caveat-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #103b60;
  --muted: #526b82;
  --body-text: #3e566c;
  --orange: #ff8a00;
  --golden: #ffb52e;
  --soft-blue: #e2eff7;
  --ice-blue: #edf7fc;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  background: var(--soft-blue);
  color: var(--ink);
  font-family: 'DM Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.main { flex: 1; }

/* The hero: header, headline and battery. It fills the first screen and the skewed panel stays inside it. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 70px;
  overflow: hidden;
}

/* The skewed light panel from the main site's home hero */
.panel {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 70px;
  left: max(120px, calc((100% - 1920px) / 2 + 235px));
  width: min(1150px, 77%);
  border-radius: 0 0 52px 52px;
  background: var(--ice-blue);
  box-shadow: 0 18px 60px #103b6010;
  transform: skewX(-12deg);
  transform-origin: top left;
  animation: panel-in 1.1s var(--ease) both;
}

.header, .layout, .footer {
  width: calc(100% - 64px);
  max-width: 1280px;
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  animation: fade .8s ease .05s both;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.mark { display: block; width: 47px; height: 43px; }

.wordmark {
  font-family: 'Manrope', sans-serif;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -1.65px;
}

.name { color: var(--ink); }
.domain { color: var(--orange); }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 540px);
  align-items: center;
  gap: 64px;
  padding: 16px 0 72px;
}

h1 {
  max-width: 660px;
  margin: 0 0 24px;
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -2.2px;
  text-wrap: balance;
}

/* Each word of "Car Battery Shopping" rises into view from behind its own line */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 .05em .16em 0;
  margin: 0 -.05em -.16em 0;
}

.w > span {
  display: inline-block;
  animation: word-up .9s var(--ease) both;
  animation-delay: calc(.15s + var(--i) * .09s);
}

/* "Made Simple": orange handwriting that appears left to right, as if being written */
.script { display: block; }

.script-ink {
  display: inline-block;
  padding: 0 .14em .06em 0;
  color: var(--orange);
  font-family: 'Caveat', cursive;
  font-size: 1.34em;
  font-weight: 600;
  line-height: .98;
  letter-spacing: 0;
  transform: rotate(-2deg);
  transform-origin: 0 100%;
  /* A soft-edged mask three times the text's width slides across it: 78% hides the words, 22% shows them */
  -webkit-mask: linear-gradient(90deg, #000 48%, transparent 52%) 22% 0 / 300% 100% no-repeat;
  mask: linear-gradient(90deg, #000 48%, transparent 52%) 22% 0 / 300% 100% no-repeat;
  animation: write 1.7s cubic-bezier(.5, .1, .4, 1) .55s both;
}

.intro {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.75;
  text-wrap: pretty;
  animation: rise .8s var(--ease) .45s both;
}

/* "Read more": scrolls down to the article */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
  animation: rise .8s var(--ease) .6s both;
}

.read-more-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 8px 20px #ff8a0045;
  color: #fff;
  transition: transform .25s var(--ease), background-color .2s;
}

.read-more-icon svg { animation: nudge 2.8s ease-in-out 2.4s infinite; }
.read-more:hover .read-more-icon { transform: translateY(3px); background: var(--golden); }

/* Moving strip of brand logos. Two copies of the list slide left by one copy's width, so the loop is seamless. */
.brands {
  max-width: 560px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid #103b6014;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  animation: fade 1s ease .8s both;
}

.brands-track {
  display: flex;
  width: max-content;
  animation: brand-glide 38s linear infinite;
}

.brands:hover .brands-track { animation-play-state: paused; }

.brands-group {
  display: flex;
  flex: none;
  align-items: center;
  gap: 48px;
  height: 44px;
  margin: 0;
  padding: 0 48px 0 0;
  list-style: none;
}

.brands-group li { display: flex; flex: none; }
.brands-group img { display: block; max-width: none; }

/* The battery sits on its rock with the card covering the lower half, like the main site's mobile hero */
.battery {
  display: block;
  width: 88%;
  height: auto;
  margin: 0 auto;
  animation: float-in 1.2s var(--ease) .25s both;
}

.card {
  position: relative;
  z-index: 1;
  /* Pulls the card up over the rock: 14% of the column width hides the lower half of the rock (the bottom ~20% of the photo) */
  margin-top: -14%;
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px #103b601a;
  animation: rise .9s var(--ease) .6s both;
}

.card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.card h2 {
  margin: 8px 0 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.8px;
  text-wrap: balance;
}

.card-text {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.emails {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.emails a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  border: 1px solid #103b6012;
  border-radius: 12px;
  background: var(--ice-blue);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s, background-color .2s;
}

.emails a:hover { border-color: var(--orange); background: #fff; }

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 12px #103b600f;
  color: var(--orange);
}

.email-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.label { color: var(--muted); font-size: 13px; font-weight: 600; }
.address { font-size: 16px; font-weight: 750; white-space: nowrap; }
.arrow { flex: none; color: var(--orange); transition: transform .2s; }
.emails a:hover .arrow { transform: translateX(3px); }

/* "What is CarBattery.co.uk?" article: each section's photo bleeds off one edge of the page, alternating sides */
.guide {
  padding: 24px 0 128px;
  scroll-margin-top: 16px;
}

.guide-section {
  display: grid;
  align-items: center;
  margin-top: 128px;
}

.guide-section:first-child { margin-top: 40px; }

/* Five columns: page gutter, text (or photo), gap, photo (or text), page gutter. The photo runs into its gutter to the screen edge. */
.photo-right { grid-template-columns: minmax(32px, 1fr) minmax(0, 560px) 88px minmax(0, 632px) minmax(32px, 1fr); }
.photo-left { grid-template-columns: minmax(32px, 1fr) minmax(0, 632px) 88px minmax(0, 560px) minmax(32px, 1fr); }
.photo-right .guide-copy { grid-column: 2; grid-row: 1; }
.photo-right .guide-photo { grid-column: 4 / 6; grid-row: 1; border-radius: 32px 0 0 32px; }
.photo-left .guide-photo { grid-column: 1 / 3; grid-row: 1; border-radius: 0 32px 32px 0; }
.photo-left .guide-copy { grid-column: 4; grid-row: 1; }

.guide-photo {
  position: relative;
  align-self: stretch;
  min-height: 460px;
  overflow: hidden;
  background: #cfe0ec;
  box-shadow: 0 30px 60px #103b6024;
}

.guide-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-copy::before {
  content: '';
  display: block;
  width: 44px;
  height: 4px;
  margin-bottom: 24px;
  border-radius: 4px;
  background: var(--orange);
}

.guide h2 {
  margin: 0 0 18px;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1.2px;
  text-wrap: balance;
}

.guide h3 {
  margin: 30px 0 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.4px;
}

.guide h2 + h3 { margin-top: 22px; }

.guide p {
  margin: 0;
  color: var(--body-text);
  font-size: 18px;
  line-height: 1.8;
  text-wrap: pretty;
}

/* Scroll reveal (only when JavaScript is running): photos slide in from their own edge, text rises */
.js .reveal { opacity: 0; transition: opacity .9s ease, transform 1.1s var(--ease); }
.js .photo-right .guide-photo.reveal { transform: translateX(90px); }
.js .photo-left .guide-photo.reveal { transform: translateX(-90px); }
.js .guide-copy.reveal { transform: translateY(36px); transition-delay: .15s; }
.js .guide-photo img { transform: scale(1.1); transition: transform 1.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .guide-photo.is-visible img { transform: none; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 24px 0 30px;
  color: var(--muted);
  font-size: 14px;
}

.logo:focus-visible, .read-more:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
  border-radius: 4px;
}

.emails a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

@keyframes panel-in {
  from { opacity: 0; transform: skewX(-12deg) translateX(-70px); }
  to { opacity: 1; transform: skewX(-12deg); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes word-up {
  from { transform: translateY(110%); }
  to { transform: none; }
}

@keyframes write {
  from { -webkit-mask-position: 78% 0; mask-position: 78% 0; }
  to { -webkit-mask-position: 22% 0; mask-position: 22% 0; }
}

@keyframes float-in {
  from { opacity: 0; transform: translateY(46px) scale(.95); }
  to { opacity: 1; transform: none; }
}

@keyframes nudge {
  0%, 55%, 100% { transform: none; }
  25% { transform: translateY(4px); }
}

@keyframes brand-glide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 8px; }
  .art { width: min(100%, 480px); margin: 0 auto; }
  .hero { padding-bottom: 40px; }
  .panel { left: -30%; width: 150%; bottom: 40px; }

  /* Sections stack: the photo still touches one screen edge, alternating, with the text underneath */
  .guide { padding-bottom: 88px; }
  .guide-section, .guide-section:first-child { margin-top: 80px; }
  .guide-section:first-child { margin-top: 24px; }
  .photo-right, .photo-left { grid-template-columns: minmax(0, 1fr); }
  .photo-right .guide-photo, .photo-left .guide-photo { grid-column: 1; grid-row: 1; min-height: 0; aspect-ratio: 3 / 2; }
  .photo-right .guide-photo { margin-left: 32px; border-radius: 26px 0 0 26px; }
  .photo-left .guide-photo { margin-right: 32px; border-radius: 0 26px 26px 0; }
  .photo-right .guide-copy, .photo-left .guide-copy { grid-column: 1; grid-row: 2; justify-self: center; width: calc(100% - 64px); max-width: 640px; margin-top: 36px; }
}

@media (max-width: 600px) {
  .header, .layout, .footer { width: calc(100% - 32px); }
  .header { flex-wrap: wrap; gap: 10px 18px; padding: 20px 0; }
  .mark { width: 38px; height: 35px; }
  .wordmark { font-size: 24px; letter-spacing: -1.35px; }
  h1 { letter-spacing: -1.4px; }
  .intro { font-size: 17px; }
  .read-more { margin-top: 24px; font-size: 16px; }
  .brands { margin-top: 28px; padding-top: 22px; }
  .brands-group { gap: 36px; padding-right: 36px; }
  .card { padding: 22px 18px; border-radius: 16px; }
  .card h2 { font-size: 23px; }
  .address { font-size: 15px; }
  .photo-right .guide-photo { margin-left: 16px; border-radius: 20px 0 0 20px; }
  .photo-left .guide-photo { margin-right: 16px; border-radius: 0 20px 20px 0; }
  .photo-right .guide-copy, .photo-left .guide-copy { width: calc(100% - 32px); margin-top: 28px; }
  .guide-copy::before { margin-bottom: 18px; }
  .guide h2 { font-size: 28px; letter-spacing: -.8px; }
  .guide h3 { margin-top: 24px; font-size: 19px; }
  .guide p { font-size: 17px; line-height: 1.75; }
}

@media (max-width: 480px) {
  .card { padding: 20px 16px; }
  .emails a { gap: 12px; padding: 12px 14px 12px 12px; }
  .icon { width: 38px; height: 38px; border-radius: 9px; }
  .icon svg { width: 18px; height: 18px; }
  .arrow { width: 16px; height: 16px; }
  /* Keeps the email on one line: it is about 13.5 times its font size wide, and the row leaves 100vw - 170px for it */
  .address { font-size: clamp(13px, calc((100vw - 170px) / 13.8), 15px); }
}

@media (max-width: 350px) {
  .icon { display: none; }
  .address { font-size: clamp(13px, calc((100vw - 120px) / 13.8), 15px); }
}

@media (prefers-reduced-motion: reduce) {
  /* Everything appears in place, with no movement */
  .panel, .header, .w > span, .script-ink, .intro, .read-more, .brands, .battery, .card, .read-more-icon svg { animation: none; }
  .script-ink { -webkit-mask: none; mask: none; }
  .js .reveal, .js .guide-photo img { opacity: 1; transform: none; transition: none; }
  .emails a, .arrow, .read-more-icon { transition: none; }
  /* Show the logos still, wrapping onto a second line if needed */
  .brands { -webkit-mask-image: none; mask-image: none; }
  .brands-track { width: auto; animation: none; }
  .brands-group { flex: 1; flex-wrap: wrap; gap: 20px 36px; height: auto; padding: 0; }
  .brands-group[aria-hidden] { display: none; }
}
