/*
  TKOO styles
  ------------------------------------------------------------
  Mobile first: base styles are for phones. Larger screens
  are adjusted in the "Larger screens" block near the bottom.

  Sections in this file follow the order they appear on the page:
    Settings (colors, fonts, spacing)
    Base
    Shared pieces (container, buttons, headings, lists)
    Header
    Hero
    Mission and vision
    The basics
    Gallery
    Press
    Sign-up form
    Footer
    Larger screens
    Reduced motion
*/


/* ============================================================
   Settings
   Change colors and fonts here. Everything else uses these.
   ============================================================ */

:root {
  --color-background: #F3F4F1;  /* chalk white */
  --color-grey:       #DADDD6;  /* ring canvas grey */
  --color-text:       #12171E;  /* near black */
  --color-red:        #B8201B;  /* red corner */
  --color-red-dark:   #8F1814;  /* button hover */
  --color-blue:       #1C3A63;  /* blue corner */
  --color-white:      #FFFFFF;
  --color-line:       rgba(18, 23, 30, 0.3);
  --color-input-border: #8A9099;

  --font-heading: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  --font-body:    "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --page-width: 68rem;                        /* max content width */
  --section-padding: clamp(3.5rem, 10vw, 6.5rem); /* space above and below each section */
  --radius: 4px;
}


/* ============================================================
   Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: inherit;
}

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

p {
  margin: 0 0 1em;
  max-width: 62ch;  /* keeps lines short enough to read comfortably */
}

section {
  padding-block: var(--section-padding);
}

[hidden] {
  display: none !important;
}


/* ============================================================
   Shared pieces
   ============================================================ */

/* Centers content and keeps a gap from the screen edge */
.container {
  width: min(100% - 2.5rem, var(--page-width));
  margin-inline: auto;
}

/* Visible only when tabbed to with a keyboard */
.skip-link {
  position: absolute;
  top: 0;
  left: -999px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--color-text);
  color: var(--color-white);
}

.skip-link:focus {
  left: 0;
}

/* Headings */
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 0.95;
}

h2 {
  margin-bottom: 2rem;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  font-weight: 800;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
}

/* Grey background band */
.section--grey {
  background: var(--color-grey);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover {
  background: var(--color-red-dark);
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.button--small {
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem;
  font-size: 1.1rem;
}

.button--full {
  width: 100%;
}

/* A list with a heavy top rule and thin lines between items.
   Used for "What we do". */
.ruled-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--color-text);
}

.ruled-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-line);
}

.ruled-list p {
  margin: 0;
}


/* ============================================================
   Header
   ============================================================ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
}


/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding-block: clamp(2rem, 6vw, 4rem) 0;
}

.hero h1 {
  font-size: clamp(3.75rem, 17vw, 10rem);
  font-weight: 900;
  text-transform: uppercase;
}

.hero__lede {
  max-width: 36ch;
  margin: 1.5rem 0 2rem;
  font-size: clamp(1.15rem, 3.4vw, 1.4rem);
}

.hero__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Ring ropes: three bars that draw in from the left once, on page load */
.ropes {
  display: grid;
  gap: 9px;
  margin-block: clamp(2.5rem, 7vw, 4rem);
}

.rope {
  height: 8px;
  border-radius: 4px;
  transform-origin: left center;
  animation: rope-draw 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rope--red {
  background: var(--color-red);
}

.rope--white {
  background: var(--color-white);
  box-shadow: inset 0 0 0 1px rgba(18, 23, 30, 0.25);
  animation-delay: 0.12s;
}

.rope--blue {
  background: var(--color-blue);
  animation-delay: 0.24s;
}

@keyframes rope-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}


/* ============================================================
   Mission and vision
   Mission takes the red corner, vision takes the blue corner.
   ============================================================ */

.mission-vision {
  display: grid;
  gap: 3rem;
}

.mission-vision h2 {
  margin-bottom: 1rem;
}

.mission-vision p {
  font-size: 1.2rem;
}

.mission-vision__item--red h2 {
  color: var(--color-red);
}

.mission-vision__item--blue h2 {
  color: var(--color-blue);
}


/* ============================================================
   The basics
   ============================================================ */

.facts {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

.facts div {
  padding-left: 1rem;
  border-left: 6px solid var(--color-blue);
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  margin: 0.15rem 0 0;
}


/* ============================================================
   Gallery
   Two columns on phones, three on larger screens.
   ============================================================ */

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.gallery__item {
  margin: 0;
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.gallery__item figcaption {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.gallery__item--wide {
  grid-column: span 2;
}

.gallery__item--wide img {
  aspect-ratio: 16 / 9;
}


/* ============================================================
   Press
   ============================================================ */

.press-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--color-text);
}

.press-list li {
  border-bottom: 1px solid var(--color-line);
}

.press-list a {
  display: block;
  padding: 1.1rem 0;
  text-decoration: none;
}

.press-list a:hover .press-list__title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.press-list__title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.press-list__meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
}


/* ============================================================
   Sign-up form
   ============================================================ */

.signup {
  background: var(--color-blue);
  color: var(--color-white);
}

.signup__layout {
  display: grid;
  gap: 2.5rem;
}

.signup__intro h2 {
  margin-bottom: 1rem;
}

.signup__intro p {
  font-size: 1.15rem;
}

.signup__perk {
  max-width: 34rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-white);
  border-radius: var(--radius);
  font-weight: 600;
}

.signup__form {
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius);
  background: var(--color-background);
  color: var(--color-text);
}

.signup__fine-print {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

/* One label and its input */
.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.field__hint {
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--color-input-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;  /* 16px or larger stops iPhones zooming in on tap */
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--color-text);
  outline-offset: 1px;
}

/* Success and error messages shown after submitting */
.message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.message--success {
  margin: 0;
  border-left: 8px solid var(--color-red);
  background: var(--color-white);
  color: var(--color-text);
}

.message--error {
  margin: 1rem 0 0;
  background: #FBE3E1;
  color: #6B0F0C;
}


/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  padding-block: 3rem;
}

.site-footer__columns {
  display: grid;
  gap: 1.5rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 0.4rem;
}

.site-footer__name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.site-footer__legal {
  margin-top: 2rem;
  font-size: 0.875rem;
}


/* ============================================================
   Larger screens (tablets and up, 768px+)
   ============================================================ */

@media (min-width: 48rem) {
  .hero__photo {
    aspect-ratio: 21 / 9;
  }

  .mission-vision {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
  }

  .gallery__item--wide img {
    aspect-ratio: 2 / 1;
  }

  .signup__layout {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
  }

  .site-footer__columns {
    grid-template-columns: 2fr 1fr 1fr;
  }
}


/* ============================================================
   Reduced motion
   Respects visitors who turn off animations in their device settings.
   ============================================================ */

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

  .rope {
    animation: none;
  }
}
