/* ButterflyX Customs website. Dark and bold like the logo: near-black, white and the logo red.
   Headings are Saira ExtraBold Italic, the font CUSTOMS is set in on the logo. */

@font-face {
  font-family: "Saira";
  src: url("/fonts/saira-extrabold-italic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --black: #0b0b0c;
  --ink: #111113;
  --panel: #18181b;
  --line: #2c2c31;
  --white: #ffffff;
  --text: #ececef;
  --muted: #a9a9b2;
  --red: #d22027;
  --red-dark: #a8191f;
  /* The logo red is too dark for small text on near-black, so text accents use this lighter red (6.2:1 or more). */
  --red-text: #ff5a60;
  --tile: #f0f0f0;
  --radius: 6px;
  --wrap: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Saira", "Arial Black", var(--font);
}

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

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

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

  .to-top {
    transition: none;
  }
}

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

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

a {
  color: inherit;
}

a:hover {
  color: var(--red-text);
}

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

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--white);
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  letter-spacing: 0.005em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 760px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 10px 16px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
}

.skip:focus {
  left: 16px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--red-text);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  max-width: 38em;
  color: var(--muted);
  font-size: 1.1875rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9375rem;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 13px 24px;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
  color: var(--white);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-ghost {
  border-color: var(--white);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
}

.btn-small {
  padding: 9px 16px;
  font-size: 0.875rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo img {
  width: auto;
  height: 30px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--red-text);
}

/* Sections */

.section {
  padding: 88px 0;
}

.section-alt {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

/* Hero */

.hero {
  padding: 72px 0 88px;
  /* The slanted bar behind the photo reaches past the edge on narrow screens. */
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-photo {
  margin: 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.875rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
}

.breadcrumb a {
  color: var(--text);
}

.hero-frame {
  position: relative;
  z-index: 0;
}

/* A slanted red bar behind the photo, leaning like the logo's letters. */
.hero-frame::before {
  content: "";
  position: absolute;
  inset: 18px -14px -14px 18px;
  z-index: -1;
  background: var(--red);
  transform: skewX(-12deg);
}

.hero-photo img {
  position: relative;
  border-radius: var(--radius);
}

.hero-photo figcaption {
  margin-top: 30px;
}

.hero-photo figcaption,
.product figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 56px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  list-style: none;
  overflow: hidden;
}

.facts li {
  padding: 18px 20px;
  background: var(--ink);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.facts strong {
  display: block;
  color: var(--white);
  font-family: var(--display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

/* Products */

.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.product {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.product figure {
  margin: 0;
  background: var(--tile);
}

.product figcaption {
  margin: 0;
  padding: 8px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 18px 22px;
}

.product-body p {
  color: var(--muted);
  font-size: 0.96875rem;
}

.product h3 a {
  color: inherit;
  text-decoration: none;
}

.product h3 a:hover {
  color: var(--red-text);
}

.product .from {
  margin-top: auto;
  color: var(--white);
  font-weight: 700;
}

.product .from span {
  color: var(--red-text);
}

/* Custom designs: mockups from img/work/ on the home page and the rash guard and shorts pages. */

.gallery-head {
  max-width: 720px;
  margin: 64px 0 22px;
  scroll-margin-top: 24px;
}

.gallery-head p,
.gallery-more {
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.gallery-more {
  margin: 22px 0 0;
}

/* Why us */

.reasons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reasons li {
  padding-left: 22px;
  border-left: 4px solid var(--red);
}

.reasons h3 {
  font-size: 1.375rem;
}

.reasons p {
  margin: 0;
  color: var(--muted);
}

/* Pricing */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.price-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--panel);
}

/* A product page's table, with one or two price columns, fits a phone without scrolling. */
.narrow-table {
  max-width: 640px;
}

.narrow-table .price-table {
  min-width: 0;
}

.price-table th,
.price-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.price-table thead th {
  background: var(--black);
  color: var(--white);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-table tbody th {
  color: var(--muted);
  font-weight: 600;
}

.price-table td {
  color: var(--white);
  font-size: 1.125rem;
  font-weight: 700;
}

.price-table tbody tr:last-child th,
.price-table tbody tr:last-child td {
  border-bottom: 0;
}

.price-notes {
  margin: 22px 0 0;
  padding-left: 1.2em;
  color: var(--muted);
}

.price-notes li + li {
  margin-top: 6px;
}

/* How it works */

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  color: var(--red-text);
  font-family: var(--display);
  font-size: 2.25rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}

.steps h3 {
  font-size: 1.25rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96875rem;
}

/* FAQ */

.faq {
  max-width: 860px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 40px 20px 0;
  color: var(--white);
  font-size: 1.125rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  color: var(--red-text);
  font-size: 1.75rem;
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  margin: 0 0 20px;
  color: var(--muted);
}

/* Added by js/site.js after the first 5 questions. */
.faq-more {
  margin-top: 28px;
}

/* Closing call to action */

.cta {
  padding: 0;
  background: var(--red);
  overflow: hidden;
}

.cta .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
}

.cta-text {
  padding: 72px 0;
}

.cta h2 {
  color: var(--white);
}

.cta p {
  color: var(--white);
  font-size: 1.1875rem;
}

.cta .btn {
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
}

.cta .btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.cta figure {
  align-self: stretch;
  margin: 0;
}

.cta figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Quote form */

.quote-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}

.form {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.field {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  color: var(--white);
  font-weight: 700;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

.hint {
  display: block;
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* A hint under its input, so the inputs in a row stay level. */
.hint-below {
  margin: 6px 0 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #45454c;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red-text);
}

[aria-invalid="true"] {
  border-color: var(--red-text);
  box-shadow: 0 0 0 1px var(--red-text);
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.checks label {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.checks input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--red);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--red-text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

.form-status {
  margin: 0 0 22px;
  padding: 12px 16px;
  border-left: 4px solid var(--red-text);
  background: #2a1214;
  color: var(--white);
  font-weight: 600;
}

/* The honeypot field for bots. People never see it. */
.hp {
  position: absolute;
  left: -9999px;
}

.aside {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
}

.aside h2 {
  font-size: 1.5rem;
}

.aside ol {
  margin: 0 0 24px;
  padding-left: 1.2em;
  color: var(--muted);
}

.aside li + li {
  margin-top: 8px;
}

.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li + li {
  margin-top: 6px;
}

/* Footer */

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}

.site-footer img {
  width: auto;
  height: 24px;
  margin-bottom: 14px;
}

.site-footer h2 {
  margin-bottom: 12px;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.875rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

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

.site-footer li + li {
  margin-top: 6px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* The shop (public/shop/): personalized rash guards. */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  text-decoration: none;
}

.shop-card a:hover .shop-card-name {
  color: var(--red-text);
}

.shop-card img {
  background: var(--tile);
}

.shop-card-body {
  display: grid;
  gap: 6px;
  padding: 16px 18px 20px;
}

.shop-card-name {
  color: var(--white);
  font-family: var(--display);
  font-size: 1.375rem;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.design-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.shop-preview {
  border-radius: var(--radius);
  background: var(--tile);
  overflow: hidden;
}

.shop-preview svg,
.shop-preview img {
  display: block;
  width: 100%;
  height: auto;
}

/* Matches the renderer's text fitting, which uses each letter's own width. */
.shop-preview text {
  font-kerning: none;
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.view-switch [aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
}

.item-price strong {
  color: var(--white);
  font-size: 1.5rem;
}

.shop-form {
  margin: 24px 0;
}

.checks-stacked {
  grid-template-columns: 1fr;
}

.swatch {
  display: inline-block;
  width: 22px;
  height: 14px;
  border: 1px solid #6b6b73;
  border-radius: 3px;
}

.logo-upload {
  margin-top: 14px;
}

.logo-upload label {
  display: block;
  margin-bottom: 6px;
  color: var(--white);
  font-weight: 700;
}

input[type="file"] {
  width: 100%;
  color: var(--text);
  font: inherit;
}

.form-done {
  margin: 18px 0 0;
  border-left-color: var(--white);
  background: var(--ink);
}

.shop-notes {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
}

.shop-notes li + li {
  margin-top: 6px;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 24px;
}

.cart-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:first-child {
  padding-top: 0;
}

.cart-item p {
  margin-bottom: 6px;
}

.cart-item-name {
  font-size: 1.375rem;
}

.cart-item-price {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
  color: var(--white);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--red-text);
}

.totals {
  margin: 0 0 20px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.totals dt {
  color: var(--white);
  font-weight: 700;
}

.totals dd {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.accept {
  margin-bottom: 18px;
}

.thanks-steps {
  margin: 0 0 24px;
  padding-left: 1.2em;
}

/* Back to top, added by js/site.js. Only on phones and small tablets, once the page has scrolled. */

.to-top {
  display: none;
}

/* Smaller screens */

@media (max-width: 1000px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .reasons {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .section {
    padding: 64px 0;
  }

  .to-top {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 2px solid var(--white);
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .to-top.is-shown {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .to-top:hover {
    background: var(--red-dark);
    color: var(--white);
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero-grid,
  .cta .wrap,
  .quote-layout,
  .design-layout {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    margin-right: 14px;
  }

  .facts {
    margin-top: 40px;
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-text {
    padding: 56px 0 8px;
  }

  .cta figure {
    margin: 0 -24px;
  }

  .site-footer .wrap {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 16px;
  }

  .logo img {
    height: 24px;
  }

  .site-nav {
    gap: 6px 16px;
    font-size: 0.875rem;
  }

  .products,
  .steps,
  .reasons,
  .form .row,
  .checks {
    grid-template-columns: 1fr;
  }

  .form {
    padding: 20px;
  }

  .cta figure {
    margin: 0 -16px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
  }

  .cart-item-price {
    grid-column: 2;
    justify-items: start;
  }
}
