/* ==========================================================================
   KALEB• Creative Studio
   ========================================================================== */

/* Design tokens
   ========================================================================== */
:root {
  /* Colours */
  --color-base: #e2e2e2;        /* page background */
  --color-contrast: #00c4b3;    /* body text / brand teal */
  --color-accent: #e84b37;      /* buttons / brand red */
  --color-ink: #191919;         /* headings, dark section */
  --color-grey: #5f5f5f;

  /* Typography */
  --font-sans: "Ysabeau Office", system-ui, sans-serif;
  --font-serif: "Literata", Georgia, serif;

  --text-sm: 0.875rem;
  --text-md: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.196), 1.125rem);
  --text-lg: clamp(1.125rem, 1.125rem + ((1vw - 0.2rem) * 0.392), 1.375rem);
  --text-xl: clamp(1.75rem, 1.75rem + ((1vw - 0.2rem) * 0.392), 2rem);
  --text-2xl: clamp(1.4rem, 1.4rem + ((1vw - 0.2rem) * 1.882), 2.6rem);
  --text-hero: clamp(3.037rem, 3.037rem + ((1vw - 0.2rem) * 4.648), 6rem);

  /* Spacing */
  --space-30: 20px;
  --space-40: 30px;
  --space-50: clamp(30px, 5vw, 50px);
  --space-60: clamp(30px, 7vw, 70px);
  --space-80: clamp(70px, 10vw, 140px);

  /* Layout */
  --wide-size: 1340px;
  --gutter: var(--space-50);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-base);
  color: var(--color-contrast);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 300;
  letter-spacing: -0.24px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-serif);
  font-weight: 900;
  letter-spacing: -0.1px;
  line-height: 1.2;
}

h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p {
  margin: 0;
}

a {
  color: var(--color-ink);
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  background: var(--color-ink);
  color: var(--color-base);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

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

/* Button
   ========================================================================== */
.button {
  display: inline-block;
  padding: 24px 48px;
  background-color: var(--color-accent);
  color: var(--color-base);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

.button:hover {
  background-color: color-mix(in srgb, var(--color-accent) 85%, transparent);
}

/* Hero
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 66vh;
  padding: 48px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 49% 100%;
}

/* Light wash over the photo so the heading stays legible */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--color-base);
  opacity: 0.3;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-inline: var(--gutter);
}

.hero__title {
  max-width: 75%;
  margin-bottom: 120px; /* 48px block gap + 72px spacer */
  font-family: var(--font-sans);
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.hero__title strong {
  font-weight: 900;
}

/* Services
   ========================================================================== */
.services {
  padding: var(--space-50) var(--gutter);
}

.services h2 {
  margin-bottom: var(--space-50);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2em;
}

.service h3 {
  margin-bottom: 0.75em;
}

/* Slideshow (website portfolio)
   ========================================================================== */
.slideshow {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: 24px;
  overflow: hidden;
  touch-action: pan-y;
}

.slideshow__track {
  position: absolute;
  inset: 0;
}

/* Slides are stacked and cross-faded. Images are shown whole by default
   and the space around them is filled with --slide-bg (set per slide to
   match the image's own background) so they sit seamlessly in the 4:3
   frame. .slide--cover fills the frame instead; .slide--logo adds room
   around a logo. */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  margin: 0;
  background-color: var(--slide-bg, var(--color-ink));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide--cover img {
  object-fit: cover;
}

/* Extra bottom room keeps tall logos clear of the dots */
.slide--logo img {
  padding: 9% 14% 13%;
}

.slideshow--light .slide {
  background-color: var(--slide-bg, #fff);
}

.slideshow__btn {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgb(25 25 25 / 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.slideshow__btn--prev { left: 10px; }
.slideshow__btn--next { right: 10px; }

.slideshow__btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.slideshow:hover .slideshow__btn,
.slideshow:focus-within .slideshow__btn {
  opacity: 1;
}

.slideshow__btn:hover {
  background-color: var(--color-accent);
}

/* Dots sit on a translucent pill so they read on light and dark slides */
.slideshow__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 999px;
  background-color: rgb(25 25 25 / 0.4);
  transform: translateX(-50%);
}

.slideshow__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgb(255 255 255 / 0.5);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.slideshow__dot:hover {
  background-color: #fff;
}

.slideshow__dot[aria-current="true"] {
  background-color: #fff;
  transform: scale(1.3);
}

/* Controls need JS; without it the first slide simply shows */
html:not(.js) .slideshow__btn,
html:not(.js) .slideshow__dots {
  display: none;
}

/* Touch screens have no hover, so keep the arrows visible */
@media (hover: none) {
  .slideshow__btn {
    opacity: 1;
  }
}

.service p {
  font-size: var(--text-md);
}

/* Featured talk
   ========================================================================== */
.feature {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-80);
  background-color: var(--color-ink);
  color: var(--color-base);
}

.feature h2,
.feature a {
  color: currentColor;
}

.feature__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-60);
  width: 100%;
  max-width: var(--wide-size);
  margin-inline: auto;
}

.feature__video {
  position: relative;
  aspect-ratio: 16 / 9;
}

.feature__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.feature__text {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.feature__role {
  font-weight: 700;
}

.feature__quote {
  margin: 0;
}

/* Footer
   ========================================================================== */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-40);
  min-height: 40vh;
  padding: var(--space-60) var(--space-50);
  color: var(--color-contrast);
  text-align: center;
}

.footer__logo img {
  width: 120px;
}

.footer__tagline {
  font-size: var(--text-md);
}

.social {
  display: flex;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: block;
  padding: 0.25em;
  color: currentColor;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social a:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.social svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.footer__copy {
  color: var(--color-grey);
  font-size: var(--text-sm);
}

/* Scroll reveal (only active when JS has loaded)
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal,
  .slide,
  .slide.is-active {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .slide:not(.is-active) {
    opacity: 0;
  }
}

/* Responsive
   ========================================================================== */
@media (max-width: 781px) {
  .hero {
    padding: 48px 16px;
  }

  .hero__inner {
    padding-inline: 0;
  }

  .hero__title {
    max-width: 100%;
    margin-bottom: 72px;
  }

  .services__grid,
  .feature__grid {
    grid-template-columns: 1fr;
  }

  .feature {
    padding: var(--space-80) 16px;
  }
}
