/* Busybody's — design system v2
   Aesthetic: Ann Arbor student laundry, Michigan Maize + Blue.
   Visual cues match the van + mascot: white base, navy ink, maize stripe accents,
   italic script "Busybody's" wordmark, friendly cartoon mascot.
*/

:root {
  /* Brand palette — University of Michigan colors */
  --blue: #00274C;            /* Michigan Blue, primary */
  --blue-deep: #001A33;
  --blue-soft: #1F3A5C;
  --maize: #FFCB05;           /* Michigan Maize, accent */
  --maize-deep: #E5B400;      /* decorative/border use only — fails AA on light bg */
  --maize-soft: #FFE38A;
  --maize-text: #7A5C00;      /* AA-safe maize for text on light surfaces (5.9:1 on paper, 6.25:1 on white) */

  /* Surfaces */
  --white: #FFFFFF;
  --paper: #FBF8F1;           /* very subtle off-white (cream hint, not yellow) */
  --paper-warm: #F5EFE0;
  --paper-blue: #F1F4F9;      /* faint blue tint surface */

  /* Text */
  --ink: var(--blue);
  --ink-soft: #2A3E55;
  --ink-mute: #596B7A;

  /* Status */
  --green: #3E6B39;
  --green-soft: #E5EFDF;
  --red: #A83028;
  --red-soft: #F8E2DF;

  /* Lines / shadows */
  --line: rgba(0, 39, 76, 0.14);
  --line-soft: rgba(0, 39, 76, 0.06);
  --shadow: rgba(0, 39, 76, 0.08);
  --shadow-md: rgba(0, 39, 76, 0.16);
  --shadow-lg: rgba(0, 39, 76, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(at 10% -5%, rgba(255, 203, 5, 0.10) 0%, transparent 35%),
    radial-gradient(at 95% 10%, rgba(0, 39, 76, 0.04) 0%, transparent 30%);
  background-attachment: fixed;
  min-height: 100vh;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  /* Decorative rotated badges (.postmark, .stamp) extend ~1px past their
     bounding box and can poke beyond the viewport edge on narrow screens,
     triggering a horizontal scrollbar. `clip` contains them without creating
     a scroll container, so position: sticky keeps working (unlike `hidden`). */
  overflow-x: clip;
}

/* Display type — Fraunces with extra softness, optical sizing for big sizes */
.serif {
  font-family: "Fraunces", "Times New Roman", serif;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.05;
}

/* Handwritten accent (used sparingly for warmth) */
.scrawl {
  font-family: "Caveat", "Comic Sans MS", cursive;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.01em;
}

/* Layout containers */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.shell-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* The Maize/Blue stripe — like the van */
.van-stripe {
  background:
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent calc(50% - 9px),
      var(--blue) calc(50% - 9px),
      var(--blue) calc(50% - 5px),
      var(--maize) calc(50% - 5px),
      var(--maize) calc(50% + 1px),
      var(--blue) calc(50% + 1px),
      var(--blue) calc(50% + 5px),
      transparent calc(50% + 5px),
      transparent 100%
    );
  height: 24px;
  margin: 0;
  width: 100%;
}

/* Header / nav — top stripe + content */
.topbar {
  background: var(--blue);
  color: var(--paper);
  position: relative;
  z-index: 10;
}
.topbar .stripe-bar {
  background: transparent;
  height: 0;
}
.topbar .stripe-bar.maize { background: var(--maize); height: 4px; }
.topbar .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}
.brand img { height: 56px; width: auto; }
.brand .wordmark {
  display: flex;
  flex-direction: column;
  line-height: 0.95;
}
.brand .wordmark .name {
  font-family: "Fraunces", serif;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  color: var(--maize);
  letter-spacing: -0.015em;
}
.brand .wordmark .sub {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: rgba(251, 248, 241, 0.7);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.nav { display: flex; gap: 20px; align-items: center; }
.nav a,
.nav .nav-submenu > .nav-submenu-trigger {
  color: rgba(251, 248, 241, 0.78);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.nav a:hover { color: var(--maize); }
.nav .signin {
  border: 2px solid var(--maize);
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--maize);
}
.nav .signin:hover {
  background: var(--maize);
  color: var(--blue);
}

/* Stamps & postmarks (re-skinned in maize/blue) */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px dashed var(--blue);
  color: var(--blue);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--maize-soft);
  transform: rotate(-1deg);
}
.stamp.solid {
  background: var(--blue);
  color: var(--maize);
  border-color: var(--blue);
  border-style: solid;
}
.stamp.maize {
  background: var(--maize);
  color: var(--blue);
  border-color: var(--blue);
}
.postmark {
  display: inline-block;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 8px 14px;
  border-radius: 50%;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  transform: rotate(-8deg);
  background: var(--maize-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-primary {
  background: var(--blue);
  color: var(--maize);
  border-color: var(--blue);
  box-shadow: 0 5px 0 var(--maize), 0 5px 0 1px var(--blue), 0 16px 24px var(--shadow-md);
}
.btn-primary:hover {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--maize), 0 3px 0 1px var(--blue), 0 8px 16px var(--shadow-md);
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--maize), 0 1px 0 1px var(--blue); }

.btn-maize {
  background: var(--maize);
  color: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 5px 0 var(--blue), 0 16px 24px var(--shadow-md);
}
.btn-maize:hover {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--blue), 0 8px 16px var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-secondary:hover {
  background: var(--blue);
  color: var(--maize);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 14px;
}
.btn-ghost:hover { color: var(--maize-text); }

/* Cards & surfaces */
.card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 6px 18px var(--shadow);
  position: relative;
}

.card.parcel {
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
/* Top maize/blue van-stripe accent on parcel cards */
.card.parcel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background:
    linear-gradient(
      to bottom,
      var(--blue) 0px,
      var(--blue) 3px,
      var(--maize) 3px,
      var(--maize) 5px,
      var(--blue) 5px,
      var(--blue) 8px
    );
}

/* "Address label" — skinned for U Mich */
.label-strip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  background: var(--maize-soft);
  border: 2px solid var(--blue);
  padding: 14px 22px;
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--blue);
  transform: rotate(-1deg);
  font-family: "Fraunces", serif;
}
.label-strip .from {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.label-strip .to {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.01em;
}

/* Type scale */
.h1 {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 600;
  font-size: clamp(48px, 7.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--blue);
}
.h1 em { font-style: italic; color: var(--blue); }
.h1 .maize-underline {
  position: relative;
  display: inline-block;
}
.h1 .maize-underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.18em;
  background: var(--maize);
  z-index: -1;
}

.h2 {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 96, "SOFT" 80, "WONK" 1;
  font-weight: 600;
  font-size: clamp(34px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--blue);
}
.h3 {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 36, "SOFT" 60, "WONK" 1;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: var(--blue);
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--maize-text);
}
.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 60ch;
}

/* Footer */
.foot {
  margin-top: 100px;
  background: var(--blue);
  color: var(--paper);
  position: relative;
  z-index: 1;
}
.foot .stripe-bar { background: var(--maize); height: 4px; }
.foot .inner { padding: 60px 0 40px; }
.foot .row {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
}
.foot h4 {
  font-family: "Fraunces", serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--maize);
}
.foot a { color: rgba(251, 248, 241, 0.78); text-decoration: none; display: block; padding: 4px 0; font-size: 14.5px; }
.foot a:hover { color: var(--maize); }
.foot .legal { color: rgba(251, 248, 241, 0.55); font-size: 13px; margin-top: 32px; }

/* Reusable bits */
.divider-tape {
  margin: 80px 0;
  position: relative;
}
.divider-tape::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--blue);
}
.divider-tape::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--maize);
  margin-top: 6px;
}

.dotted {
  background-image: linear-gradient(to right, var(--line) 50%, transparent 50%);
  background-size: 8px 1.5px;
  background-repeat: repeat-x;
  background-position: bottom;
  height: 1.5px;
}

/* Form inputs (clean white with navy outline) */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}
.field input,
.field select,
.field textarea {
  border: 1.5px solid var(--blue);
  background: var(--white);
  padding: 14px 16px;
  font-size: 17px;
  font-family: inherit;
  border-radius: 6px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--maize-soft);
}

/* Code input — six segments */
.code-input {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.code-input input {
  width: 56px;
  height: 68px;
  text-align: center;
  font-family: "Fraunces", serif;
  font-size: 30px;
  font-weight: 600;
  border: 1.5px solid var(--blue);
  background: var(--white);
  border-radius: 8px;
  color: var(--blue);
}
.code-input input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--maize-soft);
}

/* Page entrance — staggered reveal */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }
.rise-5 { animation-delay: 0.45s; }

/* Wiggle on hover for stamps */
@keyframes wiggle {
  0%,100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}
.wiggle:hover { animation: wiggle 0.5s ease-in-out; }

/* Bouncing mascot animation */
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-1deg); }
}
.mascot-bob { animation: mascot-bob 4s ease-in-out infinite; }

/* Status pills */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
}
.pill-paid { color: var(--green); background: var(--green-soft); }
.pill-failed { color: var(--red); background: var(--red-soft); }
.pill-active { color: var(--blue); background: var(--maize-soft); }

/* ------------------------------------------------------------------ */
/* Responsive primitives                                              */
/*                                                                    */
/* Desktop-first. Two breakpoints:                                    */
/*   - 720px: collapse two-column layouts                             */
/*   - 560px: tighten container padding, reduce decoration            */
/* ------------------------------------------------------------------ */

/* Two-column split, parameterized via custom property so per-instance
   ratios can be set inline via style="--split-cols: 1.3fr 1fr;".
   Stacks below 720px. */
.layout-split {
  display: grid;
  grid-template-columns: var(--split-cols, 1fr 1fr);
  gap: var(--split-gap, 56px);
  align-items: var(--split-align, center);
}

/* Sticky aside used on signup page (desktop only). */
.signup-aside { position: sticky; top: 30px; }
@media (max-width: 820px) {
  .signup-aside { position: static; }
}

/* Three-up grid that degrades to two then one column. */
.grid-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* Auto-fit grid for cards (tile-on-phone, multiple-on-tablet). */
.grid-fill {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(var(--fill-min, 260px), 1fr));
  gap: var(--fill-gap, 24px);
}

/* Visibility helpers driven by breakpoints. */
.mobile-only { display: none; }
.desktop-only { display: initial; }

/* ------------------------------------------------------------------ */
/* Mobile nav (hamburger drawer)                                      */
/*                                                                    */
/* On desktop, .nav stays the existing horizontal flex row.           */
/* On mobile, .nav becomes an absolutely positioned drawer below the  */
/* topbar; .nav-toggle controls open/close via Alpine.                */
/* ------------------------------------------------------------------ */

.nav-toggle {
  background: transparent;
  border: 2px solid var(--maize);
  color: var(--maize);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.nav-toggle:hover { background: rgba(255, 203, 5, 0.12); }

/* On desktop, submenu trigger inside .nav looks like a regular link. */
.nav-submenu > .nav-submenu-trigger {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Breakpoint: <= 800px — neutralise card rotations before they push  */
/* a tight 3-column grid past the viewport edge.                      */
/* ------------------------------------------------------------------ */
@media (max-width: 800px) {
  .card.parcel { transform: none !important; }
}

/* ------------------------------------------------------------------ */
/* Breakpoint: <= 1120px — topbar nav collapses to the hamburger.     */
/* The horizontal desktop nav (9 items) needs ~1120px to sit on one   */
/* line beside the brand; below that it overflows and overlaps the    */
/* wordmark, so the drawer must take over. This is intentionally      */
/* wider than the content breakpoint below.                           */
/* ------------------------------------------------------------------ */
@media (max-width: 1120px) {
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }

  /* Topbar: brand + hamburger only; nav becomes a drawer. */
  .topbar .row { padding: 10px 0; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--blue);
    border-bottom: 4px solid var(--maize);
    box-shadow: 0 8px 22px var(--shadow-md);
    padding: 8px 0;
    display: none;
    z-index: 20;
  }
  .nav.nav-open { display: flex; }

  .nav > a,
  .nav .nav-submenu > .nav-submenu-trigger,
  .nav .nav-submenu > div a {
    padding: 14px 24px;
    width: 100%;
    text-align: left;
    border-radius: 0;
    font-size: 16px;
  }
  .nav .signin {
    border: 0;
    padding: 14px 24px;
    border-radius: 0;
    color: var(--maize);
  }
  .nav .signin:hover {
    background: var(--maize);
    color: var(--blue);
  }

  .nav-submenu {
    display: flex;
    flex-direction: column;
  }
  .nav-submenu > div {
    position: static !important;
    box-shadow: none !important;
    border: 0 !important;
    background: var(--paper-blue) !important;
    padding: 0 !important;
    margin-top: 0 !important;
  }
  .nav-submenu > div > div {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 4px 0 !important;
  }
  .nav-submenu > div a {
    padding: 12px 36px !important;
  }
}

/* ------------------------------------------------------------------ */
/* Breakpoint: <= 820px (tablet portrait & phones)                    */
/* Collapses multi-column page layouts. The topbar nav is handled     */
/* separately at <= 1120px above.                                     */
/* ------------------------------------------------------------------ */
@media (max-width: 820px) {
  .layout-split {
    grid-template-columns: 1fr;
    gap: var(--split-gap-mobile, 32px);
  }
  .grid-three {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Footer tightens up. */
  .foot .inner { padding: 40px 0 28px; }
  .foot .row { gap: 28px; }
}

/* ------------------------------------------------------------------ */
/* Breakpoint: <= 560px (phones)                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 560px) {
  .grid-three { grid-template-columns: 1fr; }
  .shell { padding: 0 18px; }
  .shell-narrow { padding: 0 16px; }

  .stamp { transform: rotate(-1deg); }

  /* Form inputs at 17px font-size already prevent iOS auto-zoom. */
  /* Keep them comfortable. */
  .field input,
  .field select,
  .field textarea {
    padding: 12px 14px;
    font-size: 16px;
  }
}
