/* ==========================================================================
   Kodiyo — components.css
   Shared components used by EVERY page: header/nav, buttons, form controls,
   footer. Build these once, never re-implement them per page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Buttons
   Two variants only:
     .btn--outline  → "Contact Us" in the nav
     .btn--primary  → "Get in Touch" section CTA / "Submit"
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  font-family: var(--font-sub);
  font-weight: var(--weight-sub);
  line-height: 1;
  text-align: center;
  border-radius: var(--radius-btn);
  border: var(--border-hairline) solid var(--color-line-strong);
  color: var(--color-fg);
  background-color: transparent;
  cursor: pointer;
  transition: background-color var(--dur-mid) var(--ease-out),
              color var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.btn:hover {
  background-color: var(--color-fg);
  border-color: var(--color-fg);
  color: var(--color-on-accent);
}

.btn:active {
  transform: translateY(1px);
}

/* Nav CTA — compact, sentence case. */
.btn--outline {
  font-size: var(--fs-sm);
  padding: 0.75rem 1.5rem;
}

/* Section CTA — larger, uppercase, tracked out. */
.btn--primary {
  font-size: var(--fs-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 1.125rem 2.25rem;
  border-width: var(--border-cta);
  border-color: var(--color-fg);
}

/* Wider set of shoulders — used on the form's Submit. Must follow
   .btn--primary, whose `padding` shorthand would otherwise override this. */
.btn--wide {
  padding-inline: 3.5rem;
}

/* --------------------------------------------------------------------------
   2. Site header
   Simple always-visible sticky bar with a translucent dark background, so the
   white logo and nav stay legible over image-heavy sections.
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background-color: var(--color-header-bg);
  border-bottom: var(--border-hairline) solid transparent;
  transition: background-color var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .site-header {
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
}

/* Once the page has scrolled, firm the bar up so it reads as a surface. */
.site-header.is-scrolled {
  background-color: rgba(30, 30, 30, 0.94);
  border-bottom-color: var(--color-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: 100%;
}

/* Logo — wordmark + "EMAIL DESIGN" descriptor, as one SVG. */
.site-logo {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.site-logo img {
  width: 168px;
  height: auto;
}

/* Primary nav ------------------------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-md), 3.2vw, var(--space-2xl));
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-md), 3vw, var(--space-2xl));
}

.site-nav__link {
  position: relative;
  font-family: var(--font-sub);
  font-weight: var(--weight-sub);
  font-size: var(--fs-sm);
  color: var(--color-fg);
  padding-block: var(--space-2xs);
  transition: color var(--dur-fast) var(--ease-out);
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-mid) var(--ease-out);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current='page']::after {
  transform: scaleX(1);
}

.site-nav__link:not([aria-current='page']) {
  color: var(--color-muted);
}

.site-nav__link:not([aria-current='page']):hover {
  color: var(--color-fg);
}

/* Mobile toggle ----------------------------------------------------------- */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  place-items: center;
  border-radius: var(--radius-btn);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-fg);
  border-radius: 2px;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background-color: var(--color-fg);
  border-radius: 2px;
  transition: transform var(--dur-mid) var(--ease-out);
}

.nav-toggle__bars::before { transform: translateY(-7px); }
.nav-toggle__bars::after  { transform: translateY(7px); }

.nav-toggle[aria-expanded='true'] .nav-toggle__bars {
  background-color: transparent;
}

.nav-toggle[aria-expanded='true'] .nav-toggle__bars::before {
  transform: translateY(0) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle__bars::after {
  transform: translateY(0) rotate(-45deg);
}

/* Mobile / tablet layout -------------------------------------------------- */
@media (max-width: 900px) {
  .nav-toggle {
    display: grid;
  }

  .site-logo img {
    width: 132px;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: var(--z-nav-panel);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-md) var(--container-pad) var(--space-xl);
    background-color: rgba(30, 30, 30, 0.98);
    border-bottom: var(--border-hairline) solid var(--color-line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-mid) var(--ease-out),
                transform var(--dur-mid) var(--ease-out),
                visibility var(--dur-mid) linear;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__link {
    display: block;
    font-size: 1.125rem;
    padding-block: var(--space-sm);
    border-bottom: var(--border-hairline) solid var(--color-line);
    color: var(--color-fg);
  }

  .site-nav__link::after {
    display: none;
  }

  .site-nav__cta {
    margin-top: var(--space-lg);
    width: 100%;
    padding-block: 0.9375rem;
  }
}

/* --------------------------------------------------------------------------
   3. Page shell
   The header is fixed, so main is offset by its height.
   -------------------------------------------------------------------------- */
.site-main {
  padding-top: var(--header-h);
}

/* --------------------------------------------------------------------------
   4. Form controls
   -------------------------------------------------------------------------- */
.form-field {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-md);
}

.form-field__label {
  font-family: var(--font-sub);
  font-weight: var(--weight-sub);
  font-size: var(--fs-body);
  color: var(--color-fg);
}

.form-field__required {
  color: var(--color-faint);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1.125rem;
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  font-size: var(--fs-body);
  color: var(--color-fg);
  background-color: transparent;
  border: var(--border-hairline) solid var(--color-line-strong);
  border-radius: var(--radius-input);
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.form-control:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-fg);
  background-color: rgba(255, 255, 255, 0.04);
}

textarea.form-control {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}

/* Native select, restyled to match the inputs. */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.125rem center;
  background-size: 12px 8px;
  cursor: pointer;
}

select.form-control option {
  background-color: var(--color-surface);
  color: var(--color-fg);
}

/* Placeholder option reads as muted until a real choice is made. */
select.form-control:invalid,
select.form-control option[value=''] {
  color: rgba(255, 255, 255, 0.32);
}

@media (max-width: 700px) {
  .form-field {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2xs);
  }
}

/* --------------------------------------------------------------------------
   5. Shared page blocks
   Centred furniture the inner pages reuse: the page hero, a standalone
   statement, and the closing call to action. Build once, reuse per page.
   -------------------------------------------------------------------------- */

/* Page hero — centred title + lead. Shorter than the homepage hero, which is
   a two-column composition of its own. */
.page-hero {
  /* A screen of its own, with the copy centred in it — the mockup treats each
     of these beats as a full frame, and without the min-height two of them
     land in view together on load. */
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(2rem, 6vh, 4.5rem);
  text-align: center;
}

.page-hero__title {
  font-size: var(--fs-h1);
  /* Wide enough for the mockup's two-line break; `text-wrap: balance`
     (base.css) evens the lines out. */
  max-width: 29ch;
  margin-inline: auto;
}

.page-hero__lead {
  margin-top: var(--space-lg);
  margin-inline: auto;
  max-width: 46ch;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--color-muted);
}

/* Statement — a centred heading with a paragraph, optionally closing on an
   emphasised line. Used for the "positioning" beats between richer sections. */
/* Same treatment as the page hero: one statement to a screen, centred. */
.statement {
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(2rem, 6vh, 4.5rem);
  text-align: center;
}

.statement__title {
  font-size: var(--fs-h2);
  max-width: 30ch;
  margin-inline: auto;
}

.statement__body {
  margin-top: var(--space-xl);
  margin-inline: auto;
  max-width: 52ch;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--color-muted);
}

.statement__emphasis {
  margin-top: var(--space-xl);
  margin-inline: auto;
  max-width: 38ch;
  font-family: var(--font-sub);
  font-weight: var(--weight-mid);
  font-style: italic;
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--color-fg);
}

/* Closing call to action. */
.page-cta {
  text-align: center;
}

.page-cta__title {
  font-size: var(--fs-h2);
  max-width: 24ch;
  margin-inline: auto;
}

/* Stacks a button with an optional small link beneath it. */
.page-cta__action {
  margin-top: var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: var(--border-hairline) solid var(--color-line);
  padding-block: var(--space-3xl) var(--space-xl);
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--space-2xl) var(--space-xl);
}

.site-footer__brand {
  max-width: 34ch;
}

.site-footer__logo img {
  width: 128px;
  height: auto;
}

.site-footer__tagline {
  margin-top: var(--space-md);
  font-size: var(--fs-sm);
  color: var(--color-muted);
  line-height: 1.55;
}

.site-footer__email {
  display: inline-block;
  margin-top: var(--space-md);
  font-family: var(--font-sub);
  font-weight: var(--weight-sub);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--color-line-strong);
  padding-bottom: 2px;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.site-footer__email:hover {
  border-bottom-color: var(--color-fg);
}

.site-footer__heading {
  font-family: var(--font-sub);
  font-weight: var(--weight-sub);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-faint);
  margin-bottom: var(--space-md);
}

.site-footer__links li + li {
  margin-top: var(--space-xs);
}

.site-footer__links a {
  font-size: var(--fs-sm);
  color: var(--color-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.site-footer__links a:hover {
  color: var(--color-fg);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-3xl);
  padding-top: var(--space-lg);
  border-top: var(--border-hairline) solid var(--color-line);
  font-size: var(--fs-xs);
  color: var(--color-faint);
}

.site-footer__bottom a {
  color: var(--color-faint);
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.site-footer__bottom a:hover {
  color: var(--color-fg);
  border-bottom-color: var(--color-line-strong);
}

@media (max-width: 860px) {
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
  }

  .site-footer__bottom {
    margin-top: var(--space-2xl);
  }
}
