/* ============================================================
   Blue Bucket Studio — styles.css

   Structure:
     1. Design tokens (colors, type, spacing)  <- edit here first
     2. Reset & base
     3. Layout helpers
     4. Header & nav
     5. Hero
     6. Sections
     7. App cards
     8. Buttons
     9. Contact & footer
    10. Responsive tweaks

   Everything visual is driven by the variables in section 1.
   Change a color there and it updates across the whole site.
   ============================================================ */


/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
  /* --- Brand colors ---
     Sampled directly from the logo PNGs (most common opaque pixel in
     both bbs-logo-full.png and bbs-icon-square-512.png). These two are
     the brand. Don't add a third. */
  --navy:        #001965;   /* deep navy — headings, header, footer */
  --blue:        #0075FF;   /* bright blue — links, buttons, accents */

  /* Tints/shades derived from the two brand colors above. Not new brand
     colors — just lighter/darker versions used for hovers and washes. */
  --navy-deep:   #00113F;   /* pressed / darker navy */
  --blue-deep:   #005FD1;   /* button hover */
  --blue-tint:   #E6F0FF;   /* very light blue wash behind the hero */

  /* --- Neutrals --- */
  --ink:         #16181D;   /* body text */
  --ink-soft:    #565C69;   /* secondary text */
  --line:        #E4E7EF;   /* hairline borders */
  --bg:          #FFFFFF;
  --bg-alt:      #F7F9FC;   /* subtle off-white section background */

  /* --- Type ---
     Manrope is self-hosted (fonts/manrope-latin.woff2) — a rounded
     geometric sans that echoes the logo wordmark. System fonts are the
     fallback while it loads or if it fails. */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Fluid sizes: min at ~360px viewport, max at ~1200px */
  --fs-h1:   clamp(2.4rem, 1.45rem + 4.2vw, 4.25rem);
  --fs-h2:   clamp(1.5rem, 1.20rem + 1.3vw, 2.25rem);
  --fs-h3:   clamp(1.25rem, 1.13rem + 0.5vw, 1.5rem);
  --fs-lede: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  --fs-body: 1rem;

  /* --- Layout --- */
  --measure:     68rem;   /* max content width */
  --gutter:      1.5rem;  /* side padding on mobile */
  --radius:      14px;
  --section-y:   clamp(3.5rem, 2rem + 6vw, 7rem);  /* vertical rhythm */

  --shadow-sm: 0 1px 2px rgba(0, 25, 101, 0.06);
  --shadow-md: 0 8px 28px rgba(0, 25, 101, 0.08);
}


/* ------------------------------------------------------------
   1b. WEB FONT
   Variable font: one file covers weights 200–800.
   ------------------------------------------------------------ */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
                 U+FFFD;
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

/* Anchor links land below the sticky header instead of under it. */
:target { scroll-margin-top: 6rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;     /* Manrope extrabold — matches the wordmark's weight */
  margin: 0;
  text-wrap: balance;   /* keeps headline line-breaks tidy */
}

p { margin: 0; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible focus ring for keyboard users. */
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respect "reduce motion" OS setting. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }


/* ------------------------------------------------------------
   3. LAYOUT HELPERS
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


/* ------------------------------------------------------------
   4. HEADER & NAV
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

/* Header logo — sized by height so the aspect ratio is preserved.
   flex-shrink:0 stops the nav from squeezing it at mid-range widths. */
.logo { flex-shrink: 0; }

.logo img {
  height: 2rem;
  width: auto;
  max-width: none;   /* overrides the global img{max-width:100%} */
}

.site-nav ul {
  display: flex;
  gap: clamp(1rem, 0.5rem + 1.6vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  padding-block: 0.5rem;   /* bigger tap target on mobile */
  text-decoration: none;
}
.site-nav a:hover { color: var(--blue); }

/* Current page marker */
.site-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}


/* ------------------------------------------------------------
   5. HERO
   ------------------------------------------------------------ */
.hero {
  /* Soft wash of brand blue fading into white. */
  background:
    radial-gradient(80rem 40rem at 50% -10rem, var(--blue-tint), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  text-align: center;
  padding-block: clamp(4rem, 2rem + 8vw, 8rem);
}

/* Small uppercase label above the headline. */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: var(--fs-h1);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.hero-lede {
  font-size: var(--fs-lede);
  color: var(--ink-soft);
  max-width: 34rem;
  margin-inline: auto;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 2.25rem;
}


/* ------------------------------------------------------------
   6. SECTIONS
   ------------------------------------------------------------ */
.section { padding-block: var(--section-y); }

/* Alternate background — use on every other section for rhythm. */
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

/* Two-tone accent bar — echoes the navy/blue split in the bucket logo.
   Sits above section titles. */
.brand-rule {
  width: 3.5rem;
  height: 0.3rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--navy) 0 50%, var(--blue) 50% 100%);
  margin-bottom: 1.25rem;
}
.brand-rule-center { margin-inline: auto; }   /* for centered sections */

.section-title {
  font-size: var(--fs-h2);
  margin-bottom: 0.75rem;
}

/* --- "How we build" values strip --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: clamp(1.75rem, 1rem + 2.5vw, 3rem);
  margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: var(--blue-tint);
  color: var(--blue);
  margin-bottom: 1rem;
}
.value-icon svg { width: 1.5rem; height: 1.5rem; }

.value-title {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.value-text {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-wrap: pretty;
}

.section-intro {
  font-size: var(--fs-lede);
  color: var(--ink-soft);
  max-width: 38rem;
  margin-bottom: clamp(2rem, 1.25rem + 2.5vw, 3rem);
}


/* ------------------------------------------------------------
   7. APP CARDS
   ------------------------------------------------------------ */
.app-grid {
  display: grid;
  /* One column on phones; auto-fits to 2+ columns when there's room. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
}

.app-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: clamp(1.5rem, 1rem + 1.5vw, 2rem);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.app-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* flex-shrink must be on the CONTAINER, not the img. Without it the
   container gets squeezed by the text beside it, and the image squishes
   horizontally while its height stays pinned. */
.app-card-icon { flex-shrink: 0; }

.app-card-icon img {
  width: 4.5rem;
  height: 4.5rem;
  /* Belt-and-braces: never distort an app icon, even a non-square one. */
  object-fit: contain;

  /* 18.5% matches the rounded-tile corner radius baked into the SpecSilo
     icon PNG (95px of 512). A percentage scales with the box, so changing
     the icon size above keeps the corners aligned. */
  border-radius: 18.5%;

  /* Hairline ring. SpecSilo's tile is #F4F4F6 on a white card — without
     this the tile edge is invisible. If you ever add an app whose icon has
     a fully transparent background (no tile), drop this line for that card,
     or the ring will outline empty space. */
  box-shadow: 0 0 0 1px rgba(0, 25, 101, 0.12);
}

.app-card-title {
  font-size: var(--fs-h3);
  margin-bottom: 0.5rem;
}

/* Small status pill next to an app name — "Beta", "Coming soon", etc.
   Delete the <span> in index.html once SpecSilo is in the stores. */
.badge {
  display: inline-block;
  vertical-align: 0.15em;
  margin-left: 0.5rem;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--blue-deep);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-card-text {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}

.app-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}


/* ------------------------------------------------------------
   8. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }

/* Solid bright-blue button — primary action. */
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

/* Outlined navy button — secondary action. */
.btn-ghost {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn-ghost:hover {
  background: var(--navy);
  color: #fff;
}


/* ------------------------------------------------------------
   9. CONTACT & FOOTER
   ------------------------------------------------------------ */
.contact-inner { text-align: center; }
.contact-inner .section-intro { margin-inline: auto; }

.contact-email {
  display: inline-block;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--blue);
  word-break: break-word;   /* don't overflow on narrow phones */
}

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.72);
  padding-block: 2.5rem;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-inner a { color: #fff; }


/* ------------------------------------------------------------
   10. RESPONSIVE TWEAKS
   ------------------------------------------------------------ */
@media (max-width: 40em) {
  /* Header: stack logo above nav so neither gets squeezed. */
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.85rem;
  }

  .logo img { height: 1.75rem; }

  .site-nav ul { justify-content: center; }

  /* App card: icon on top, text beneath. */
  .app-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .app-card-actions { justify-content: center; }

  /* Footer: centered stack. */
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
