/* ============================================================
   Hibyte Graphics — main.css

   Brand: bg=#FAF2F2, red=#DE0707, dark=#1a1a1a
   Fonts: Playfair Display (display/serif), Inter (UI/sans)
   Accessibility: focus-visible on inputs, buttons, nav links; prefers-reduced-motion guard
                  Hamburger → X animation; contact-page navbar contrast fix

   Sections:
   - :root           CSS custom properties
   - Reset           Box model, base elements
   - Typography      .serif helper
   - Navbar          Fixed top nav, .scrolled state
   - Hero            Full-viewport hero, grain + glow overlays
   - Intro           Pinned intro statement panel
   - Panels          Size-contrast service panels (KEY FEATURE)
                     .panel__service--xxl/xl/lg/md/xs scale classes
   - About           Two-column about section
   - Buttons         .btn--outline, .btn--primary
   - Footer          Rounded-top card footer
   - Contact Page    Dark hero, form, info cards
   - Responsive      Mobile (≤768px) overrides
   ============================================================ */

/* ============================
   CSS Custom Properties
   ============================ */
:root {
  --bg: #FAF2F2;
  --red: #DE0707;
  --dark: #1a1a1a;
  --muted: #555555;
  --card: #F0E8E8;
  --white: #ffffff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui: 'Inter', -apple-system, sans-serif;

  --nav-h: 72px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================
   Reset
   ============================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Disable bounce animation for users with vestibular sensitivities */
  .hero__scroll-cue svg {
    animation: none;
  }
}

body {
  background-color: var(--bg);
  color: var(--dark);
  font-family: var(--font-ui);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ============================
   Typography Helpers
   ============================ */
.serif { font-family: var(--font-display); }

/* Note: Google Fonts loaded with display=swap in HTML <head>.
   This ensures body text falls back to system font until Playfair Display
   and Inter are loaded, preventing invisible text (FOIT). */

/* ============================
   Navbar
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: var(--nav-h);
  transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

/* Navbar becomes opaque + shadowed after 80px scroll (class added by JS) */
.navbar.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* Navbar goes dark when over the services section (class added by JS) */
.navbar.over-dark {
  background: var(--dark);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}
.navbar.over-dark .navbar__links a {
  color: rgba(255,255,255,0.75);
}
.navbar.over-dark .navbar__links a:hover,
.navbar.over-dark .navbar__links a.active {
  color: var(--white);
}
.navbar.over-dark .navbar__hamburger span {
  background: var(--white);
}

.navbar__logo img {
  height: 36px;
  width: auto;
}

.navbar__links {
  display: flex;
  gap: 2.5rem;
}

.navbar__links a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dark);
  transition: color 0.2s;
}

.navbar__links a:hover,
.navbar__links a.active {
  color: var(--red);
}

.navbar__links a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hamburger — hidden on desktop, shown on mobile */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--dark);
  transition: transform 0.3s, opacity 0.3s;
}
/* Hamburger → X when nav is open (JS adds .open class to button) */
.navbar__hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.navbar__hamburger.open span:nth-child(2) {
  opacity: 0;
}
.navbar__hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ============================
   Hero
   ============================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

/* SVG noise grain overlay — subtle texture like setaprint.ch */
.hero__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 1;
}

/* Soft radial red/blush glow — aurora borealis style, warm on light bg */
.hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, rgba(222,7,7,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 20% 70%, rgba(222,7,7,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1rem;
}

.hero__heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Second line of hero heading — italic red (GSAP animates .hero__line elements) */
.hero__line--italic {
  font-style: italic;
  color: var(--red);
}

.hero__sub {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Animated scroll cue at hero bottom */
.hero__scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__scroll-cue svg {
  width: 20px;
  height: 20px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================
   Intro Statement
   ============================ */
/* Full-viewport section pinned by GSAP ScrollTrigger */
.intro-statement {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(1.5rem, 8vw, 10rem);
}

.intro-statement__text {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--dark);
  text-align: center;
}

.intro-statement__text em {
  font-style: italic;
  color: var(--red);
}

/* ============================
   Size-Contrast Panels — THE KEY FEATURE

   Each panel is a full-viewport section pinned by GSAP ScrollTrigger.
   The service name (.panel__service) is displayed at dramatically
   different font sizes across panels to create the size-contrast
   scroll experience replicating setaprint.ch.

   Scale hierarchy (large → small → large...):
   --xxl: Binding (bleeds off screen, red)
   --xl:  Posters (nearly full viewport width)
   --lg:  Invitations (large italic)
   --md:  Books & Pamphlets (medium)
   --xs:  office stationery (tiny, deliberate contrast)
   ============================ */
.panels-wrapper {
  position: relative;
  scroll-margin-top: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--dark);
  height: 100vh;
  min-height: 500px;
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #242424;
  border-radius: 10px;
  position: relative;
}

/* Each card: text content area below the image */
.panel__content {
  flex: 1;
  padding: clamp(0.75rem, 1.2vw, 1.25rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

/* Small uppercase counter: 01, 02, 03... */
.panel__label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1.5rem;
  font-family: var(--font-ui);
}

/* Base styles shared by all scale classes */
.panel__service {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.95;
  color: rgba(255,255,255,0.95);
  display: block;
}

/* All service names — uniform size, weight and style across all cards */
.panel__service--xxl,
.panel__service--xl,
.panel__service--lg,
.panel__service--md,
.panel__service--xs {
  font-size: clamp(1.2rem, 1.6vw, 1.9rem);
  font-weight: 900;
  font-style: normal;
  color: rgba(255,255,255,0.95);
}

/* Binding keeps its red accent colour */
.panel__service--xxl {
  color: var(--red);
}

/* Short descriptor line below service name */
.panel__desc {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.4);
  max-width: 28ch;
  line-height: 1.6;
}

/* Binding panel sub-type labels: Spiral · Wire-O · Perfect */
.panel__binding-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* Top portion of each card: image fills ~65% of card height */
.panel__visual {
  order: -1;
  flex: 0 0 65%;
  width: 100%;
  position: relative;
}

/* Real photo: fills the visual column, cropped to cover */
.panel__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Grain overlay on all panel visuals */
.panel__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Posters — bold red gradient */
.panel__visual--red {
  background: linear-gradient(135deg, #DE0707 0%, #8B0000 100%);
}

/* Stationery — warm wheat tones */
.panel__visual--warm {
  background: linear-gradient(135deg, #F5DEB3 0%, #DEB887 100%);
}

/* Invitations — soft blush */
.panel__visual--blush {
  background: linear-gradient(135deg, #FAD4D4 0%, #F0A0A0 100%);
}

/* Books & Pamphlets — near-black editorial */
.panel__visual--dark {
  background: linear-gradient(135deg, #2C2C2C 0%, #1a1a1a 100%);
}

/* Binding — dark grain matching card theme */
.panel__visual--grain {
  background: linear-gradient(135deg, #2e2e2e 0%, #1e1e1e 100%);
}

/* ============================
   About
   ============================ */
.about {
  padding: clamp(5rem, 12vw, 10rem) clamp(1.5rem, 8vw, 8rem);
  scroll-margin-top: var(--nav-h); /* offset for fixed navbar when linking to #about */
}

/* Two-column: left = large serif statement, right = body + CTA */
.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.about__heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--dark);
}

.about__heading em {
  font-style: italic;
  color: var(--red);
}

.about__body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 40ch;
  margin-bottom: 2rem;
}

/* ============================
   Buttons
   ============================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: background-color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out),
              color 0.3s var(--ease-out);
  cursor: pointer;
  border: none;
}

/* Ghost/outline button — dark border, fills on hover */
.btn--outline {
  border: 1.5px solid var(--dark);
  color: var(--dark);
  background: transparent;
}

.btn--outline:hover {
  background: var(--dark);
  color: var(--bg);
}

/* Primary filled button — red, darkens on hover */
.btn--primary {
  background: var(--red);
  color: var(--white);
  border: 1.5px solid var(--red);
}

.btn--primary:hover {
  background: #b30000;    /* --red darkened ~30% for hover depth */
  border-color: #b30000;
}

/* Keyboard focus ring for all button variants — WCAG 2.4.7 */
.btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ============================
   Footer
   ============================ */
/* Footer has horizontal padding to show the card floating above page edge */
.footer {
  padding: 0 clamp(1rem, 4vw, 3rem);
  padding-bottom: clamp(1rem, 4vw, 3rem);
}

/* Rounded-top card — mirrors setaprint.ch footer treatment */
.footer__card {
  background: var(--card);
  border-radius: 24px 24px 12px 12px;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem) 2rem;
}

/* Large italic serif contact details */
.footer__contact {
  margin-bottom: 3rem;
}

.footer__phone,
.footer__email {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  line-height: 1.2;
  color: var(--dark);
}

/* Footer phone and email are <a> tags — match parent styles */
.footer__phone a,
.footer__email a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.footer__phone a:hover,
.footer__email a:hover {
  color: var(--red);
}

/* Meta row: address | nav links | logo */
.footer__meta {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.footer__address p,
.footer__nav a {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.8;
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.footer__logo {
  height: 28px;
  width: auto;
  opacity: 0.6;
  align-self: end;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.07);
}

/* ============================
   Contact Page
   ============================ */
/* Contact page: navbar links and hamburger must be white over the dark hero.
   .scrolled class (added by JS after 80px scroll) restores dark-on-light. */
.contact-page .navbar:not(.scrolled) .navbar__links a {
  color: var(--white);
}
.contact-page .navbar:not(.scrolled) .navbar__hamburger span {
  background: var(--white);
}

/* Dark background hero for contrast with form section below */
.contact-hero {
  padding: calc(var(--nav-h) + 4rem) clamp(1.5rem, 8vw, 8rem) 5rem;
  background: var(--dark);
}

.contact-hero__heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.05;
}

.contact-hero__heading em {
  color: var(--red);
  font-style: italic;
}

/* Light form section below dark hero */
.contact-body {
  background: var(--bg);
  padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 8vw, 8rem);
}

/* Two columns: form (wider) | contact info cards */
.contact-body__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

/* Form layout — stacked fields */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Borderless inputs — only bottom border, underline style */
.form-group input,
.form-group select,
.form-group textarea {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(0,0,0,0.15);
  padding: 0.75rem 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--dark);
  outline: none; /* removed; keyboard ring provided via :focus-visible below */
  transition: border-color 0.2s;
  width: 100%;
}

/* Red underline on focus — brand accent */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-bottom-color: var(--red);
}

/* Explicit keyboard focus ring — WCAG 2.4.11 */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.form-group textarea {
  resize: none;
}

/* Info cards column */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.5rem;
}

.contact-info__card {
  padding: 1.5rem;
  background: var(--card);
  border-radius: 8px;
}

/* Small uppercase label */
.contact-info__card h3 {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Serif display text for address/hours */
.contact-info__card p {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--dark);
}

/* ============================================================
   Gestalt Principle Enhancements
   1. Proximity      — panel label tightened to service name
   2. Similarity     — red top border unifies all panel counters
   3. Continuity     — red left spine through all panel columns
   4. Figure-Ground  — subtle divider: content col / visual col
   5. Closure        — concentric partial rings in hero bg
   6. Common Region  — tinted about__statement column
   7. Symmetry/Order — red rule framing marks on intro text
   8. Prägnanz       — simplified binding panel visual
   (9. Common Fate   — already handled: GSAP animates panel
       children together as a single motion unit)
   ============================================================ */

/* 1. PROXIMITY — label and service name belong together;
   desc is a separate group, so gap is wider after service */
.panel__label {
  margin-bottom: 0.5rem;
}
.panel__desc {
  margin-top: 1rem;
}
.panel__binding-types {
  margin-top: 0.5rem;
}

/* 2. SIMILARITY — red top rule on every counter so all
   panel labels read as the same repeating element */
.panel__label {
  border-top: 1.5px solid var(--red);
  padding-top: 0.75rem;
}

/* 3. CONTINUITY — subtle top rule separates image from card text area */
.panel__content {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* 5. CLOSURE — two concentric partial rings suggest a full
   circle the eye completes; clipped by hero overflow:hidden */
.hero::before {
  content: '';
  position: absolute;
  width: min(75vw, 680px);
  height: min(75vw, 680px);
  border-radius: 50%;
  border: 1px solid rgba(222, 7, 7, 0.07);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: min(130vw, 1100px);
  height: min(130vw, 1100px);
  border-radius: 50%;
  border: 1px solid rgba(222, 7, 7, 0.035);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}

/* 6. COMMON REGION — light tint encloses the about statement
   column in its own perceptual region, distinct from the body */
.about__statement {
  background: rgba(222, 7, 7, 0.025);
  border-radius: 8px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* 7. SYMMETRY & ORDER — symmetric red rules above and below
   the intro text create visual balance and frame the message */
.intro-statement__text::before,
.intro-statement__text::after {
  content: '';
  display: block;
  width: 48px;
  height: 1.5px;
  background: var(--red);
  margin: 1.5rem auto;
  opacity: 0.4;
}
/* Hairline section boundary reinforces grid order */
.hero {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* 8. PRÄGNANZ — binding panel visual uses a dark textured background */
.panel--binding .panel__visual {
  background: linear-gradient(135deg, #2e2e2e 0%, #1e1e1e 100%);
}

/* ============================
   Responsive — Mobile ≤768px
   ============================ */
@media (max-width: 768px) {
  /* Mobile nav: fullscreen overlay, links stacked center */
  .navbar__links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    z-index: 99;
  }

  .navbar__links.open {
    display: flex;
  }

  .navbar__links a {
    font-size: 1.5rem;
  }

  .navbar__hamburger {
    display: flex;
  }

  /* Panels: stack vertically on mobile */
  .panels-wrapper {
    grid-template-columns: 1fr 1fr;
    height: auto;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .panel {
    height: 50vh;
    min-height: 260px;
  }

  .panel__visual {
    display: none;
  }

  .panel__content {
    height: 100%;
    flex: none;
    justify-content: center;
  }

  /* Stack all two-column layouts */
  .about__inner,
  .footer__meta,
  .contact-body__inner {
    grid-template-columns: 1fr;
  }
}
