/* ═══════════════════════════════════════════════
   PadelHub — Design System
   Mobile-first · Apple-inspired · Premium
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --bg: #fafaf9;
  --bg-card: #fff;
  --bg-subtle: #f5f5f3;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #aeaeb2;
  --border: #e8e8ed;
  --accent: #0071e3;
  --accent-hover: #0060c0;
  --accent-light: #e8f1fd;
  --green: #1e944a;
  --green-light: #e6f5ec;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.1);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --max-w: 1080px;
  --transition: .25s cubic-bezier(.25,.1,.25,1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { display: block; max-width: 100%; height: auto; }

/* ─── Navigation ─── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,249,.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 24px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 19px; font-weight: 700; color: var(--text);
  letter-spacing: -.03em;
}
.nav-brand::before {
  content: '';
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: url('/assets/padelhub-logo.png') center / contain no-repeat;
}
[data-theme="dark"] .nav-brand::before {
  filter: invert(1) brightness(1.08);
}
.nav-links {
  display: flex; align-items: center; gap: 28px; list-style: none;
}
.nav-links a {
  font-size: 14px; color: var(--text-secondary); font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-lang {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: var(--bg-subtle); color: var(--text-secondary);
  font-weight: 600; letter-spacing: .02em;
}

/* Hamburger */
.nav-hamburger {
  display: none; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; z-index: 110;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  position: relative; transition: all .3s;
}
.nav-hamburger span::before, .nav-hamburger span::after {
  content: ''; display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  position: absolute; left: 0; transition: all .3s;
}
.nav-hamburger span::before { top: -6px; }
.nav-hamburger span::after { top: 6px; }
.nav-hamburger.active span { background: transparent; }
.nav-hamburger.active span::before { top: 0; transform: rotate(45deg); }
.nav-hamburger.active span::after { top: 0; transform: rotate(-45deg); }
.nav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); backdrop-filter: blur(6px);
  z-index: 99; opacity: 0; transition: opacity .3s;
}
.nav-overlay.active { display: block; opacity: 1; }

/* ─── Hero ─── */
.hero-wrap {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 540px;
}

/* 3-D Tennis ball (Three.js canvas) */
.hero-ball {
  position: absolute;
  width: 100%;
  max-width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.85; /* Vivid enough but respects reading text */
  pointer-events: none;
  z-index: 0;
}
.hero-ball canvas { display: block; width: 100%; height: 100%; }

.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 100px 24px 80px;
  max-width: 740px;
  margin: 0 auto;
}

/* ─── Bento Grid ─── */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.bento-3d-card {
  grid-column: 1;
  grid-row: 1 / 3;
  border-radius: 20px;
  overflow: hidden;
  background: #2a2a2c; /* The desired dark grey background */
  background: radial-gradient(circle at center, #353538 0%, #1e1e20 100%);
  border: 1px solid var(--border);
  min-height: 380px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cat cards fill 2 columns, 2 rows */
.bento-grid .cat-card:nth-child(2) { grid-column: 2; grid-row: 1; }
.bento-grid .cat-card:nth-child(3) { grid-column: 3; grid-row: 1; }
.bento-grid .cat-card:nth-child(4) { grid-column: 2; grid-row: 2; }
.bento-grid .cat-card:nth-child(5) { grid-column: 3; grid-row: 2; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px); font-weight: 800;
  letter-spacing: -.04em; line-height: 1.06; margin-bottom: 16px;
}
.hero p {
  font-size: clamp(16px, 2.5vw, 20px); color: var(--text-secondary);
  line-height: 1.5; max-width: 520px; margin: 0 auto 32px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 980px; font-size: 15px;
  font-weight: 600; font-family: var(--font); border: none;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; min-height: 48px;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--bg-subtle); }
.btn svg { width: 16px; height: 16px; }

@media (hover: none) {
  .btn:hover { transform: none; }
}

/* ─── Section ─── */
.section {
  padding: 72px 24px; max-width: var(--max-w); margin: 0 auto;
}
.section-header {
  margin-bottom: 40px;
}
.section-header h2 {
  font-size: clamp(26px, 4vw, 36px); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.15; margin-bottom: 10px;
}
.section-header p {
  font-size: 16px; color: var(--text-secondary); max-width: 520px;
}
.section-label {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.section-alt { background: var(--bg-subtle); }
.section-alt .section-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0;
}

/* ─── Card Grid ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.card-grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ─── Category Cards ─── */
.cat-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 28px 24px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: all var(--transition); display: flex; flex-direction: column;
  gap: 12px;
}
.cat-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: transparent; color: var(--text);
}
.cat-card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.cat-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.cat-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.cat-card-arrow {
  font-size: 13px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 4px; margin-top: auto;
}

/* ─── Feature Cards ─── */
.feature-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: all var(--transition); display: flex; flex-direction: column;
}
.feature-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: transparent; color: var(--text);
}
.feature-card-img {
  width: 100%; height: 200px; object-fit: cover; background: var(--bg-subtle);
}
.feature-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.feature-card-tag {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
.feature-card-body h3 {
  font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px;
}
.feature-card-body p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.55; flex: 1;
}
.feature-card-cta {
  margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 4px;
}

/* ─── Product Cards ─── */
.product-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); transition: all var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-md); }
.product-card-img {
  width: 100%; height: 220px; object-fit: cover; background: var(--bg-subtle);
}
.product-card-body { padding: 24px; }
.product-card-body h3 {
  font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px;
}
.product-card-target {
  font-size: 12px; font-weight: 600; color: var(--accent);
  margin-bottom: 10px; display: inline-block;
  padding: 3px 10px; border-radius: 20px; background: var(--accent-light);
}
.product-card-body p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px;
}
.product-card-pros {
  list-style: none; margin-bottom: 18px;
}
.product-card-pros li {
  font-size: 13px; color: var(--green); font-weight: 500;
  padding: 3px 0; display: flex; align-items: center; gap: 6px;
}
.product-card-pros li::before {
  content: '✓'; font-weight: 700; font-size: 12px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-light); color: var(--green);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── Camp Cards ─── */
.camp-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); transition: all var(--transition);
  text-decoration: none; color: var(--text);
}
.camp-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: transparent; color: var(--text);
}
.camp-card-img {
  width: 100%; height: 200px; object-fit: cover; background: var(--bg-subtle);
  position: relative;
}
.camp-card-level {
  position: absolute; top: 14px; left: 14px;
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px); color: var(--text);
  text-transform: uppercase; letter-spacing: .04em;
}
.camp-card-body { padding: 22px; }
.camp-card-location {
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.camp-card-body h3 {
  font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px;
}
.camp-card-body p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}

/* ─── Article Cards (News/Guides list) ─── */
.article-card {
  display: flex; gap: 20px; padding: 24px 0;
  border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: opacity var(--transition);
}
.article-card:last-child { border-bottom: none; }
.article-card:hover { opacity: .75; color: var(--text); }
.article-card-body { flex: 1; }
.article-card-tag {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
.article-card-body h3 {
  font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px;
}
.article-card-body p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}
.article-card-date {
  font-size: 12px; color: var(--text-tertiary); margin-top: 6px;
}

/* ─── Newsletter ─── */
.newsletter {
  background: var(--text); color: #fff; border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center; max-width: 600px; margin: 0 auto;
}
.newsletter h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px;
}
.newsletter p {
  font-size: 15px; color: rgba(255,255,255,.6); margin-bottom: 24px;
}
.newsletter-form {
  display: flex; gap: 10px; max-width: 400px; margin: 0 auto;
}
.newsletter-form input {
  flex: 1; padding: 12px 16px; border-radius: 12px; border: none;
  font-size: 15px; font-family: var(--font); background: rgba(255,255,255,.12);
  color: #fff; outline: none; min-width: 0;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.4); }
.newsletter-form input:focus { background: rgba(255,255,255,.18); }
.newsletter-form button {
  padding: 12px 22px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; font-family: var(--font);
  background: #fff; color: var(--text); transition: opacity var(--transition);
  white-space: nowrap;
}
.newsletter-form button:hover { opacity: .85; }

/* ─── Article / Guide Page ─── */
.article-page {
  max-width: 680px; margin: 0 auto; padding: 48px 24px 80px;
}
.article-page-header { margin-bottom: 40px; }
.article-page-header .breadcrumb {
  font-size: 13px; color: var(--text-tertiary); margin-bottom: 16px;
}
.article-page-header .breadcrumb a { color: var(--accent); }
.article-page-header h1 {
  font-size: clamp(28px, 5vw, 40px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.1; margin-bottom: 12px;
}
.article-page-header p {
  font-size: 17px; color: var(--text-secondary); line-height: 1.55;
}
.article-content h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  margin: 40px 0 12px;
}
.article-content h3 {
  font-size: 18px; font-weight: 600; margin: 28px 0 8px;
}
.article-content p {
  font-size: 16px; line-height: 1.7; color: var(--text-secondary);
  margin-bottom: 18px;
}
.article-content ul, .article-content ol {
  margin: 0 0 18px 20px; color: var(--text-secondary);
  font-size: 16px; line-height: 1.7;
}
.article-content li { margin-bottom: 6px; }
.callout {
  background: var(--accent-light); border-radius: var(--radius);
  padding: 20px 24px; margin: 24px 0; font-size: 15px;
  line-height: 1.55; color: var(--accent);
}
.callout strong { font-weight: 700; }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border); padding: 40px 24px;
  text-align: center;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
}
.footer-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 24px; list-style: none; margin-bottom: 16px;
}
.footer-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: var(--text); }
.footer-legal {
  font-size: 12px; color: var(--text-tertiary); margin-top: 8px;
}
.footer-access {
  font-size: 11px; color: var(--text-tertiary); margin-top: 16px;
  opacity: .5; transition: opacity var(--transition);
}
.footer-access:hover { opacity: 1; }
.footer-access a { color: var(--text-tertiary); }

/* ═══ Responsive ═══ */
@supports (padding: env(safe-area-inset-top)) {
  .nav { padding-top: env(safe-area-inset-top); }
  .footer { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

@media (max-width: 768px) {
  .nav-inner { height: 48px; padding: 0 16px; }
  .nav-hamburger {
    display: flex;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }
  .nav-links {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(88vw, 340px); max-width: none; flex-direction: column;
    align-items: stretch; gap: 10px; background: var(--bg-card);
    padding: 76px 18px 24px; transform: translateX(100%);
    transition: transform .35s cubic-bezier(.32,.72,0,1);
    z-index: 105; box-shadow: -18px 0 48px rgba(0,0,0,.12);
    border-left: 1px solid var(--border);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { border-bottom: none; }
  .nav-links li:last-child { margin-top: auto; padding-top: 10px; }
  .nav-links a {
    display: flex; align-items: center; font-size: 16px !important;
    padding: 14px 16px; min-height: 52px; color: var(--text);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-weight: 600;
  }
  .nav-links a.active {
    color: var(--accent);
    font-weight: 700;
    background: var(--accent-light);
    border-color: transparent;
  }
  .nav-links .theme-toggle {
    width: 100%;
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
  }

  .hero { padding: 72px 24px 56px; }

  /* Bento: 3D card top full-width, cards 2-col below */
  .bento-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .bento-3d-card {
    grid-column: 1 / 3;
    grid-row: 1;
    min-height: 280px;
  }
  .bento-grid .cat-card:nth-child(2) { grid-column: 1; grid-row: 2; }
  .bento-grid .cat-card:nth-child(3) { grid-column: 2; grid-row: 2; }
  .bento-grid .cat-card:nth-child(4) { grid-column: 1; grid-row: 3; }
  .bento-grid .cat-card:nth-child(5) { grid-column: 2; grid-row: 3; }

  .section { padding: 48px 20px; }
  .section-header { margin-bottom: 28px; }
  .section-header h2 { font-size: 26px; }

  .card-grid, .card-grid-3 { grid-template-columns: 1fr; gap: 14px; }

  .btn { width: 100%; justify-content: center; }

  .feature-card-img { height: 180px; }
  .product-card-img { height: 180px; }
  .camp-card-img { height: 170px; }

  .newsletter { padding: 36px 24px; border-radius: var(--radius); }
  .newsletter h2 { font-size: 20px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; padding: 14px; }

  .article-page { padding: 32px 20px 60px; }

  .footer { padding: 32px 20px; }
  .footer-links { gap: 16px; }
}

@media (max-width: 375px) {
  .hero h1 { font-size: 28px; }
  .section-header h2 { font-size: 24px; }
}

html[data-theme="dark"] {
  --bg: #000000;
  --bg-card: #1c1c1e;
  --bg-subtle: #2c2c2e;
  --text: #f5f5f7;
  --text-secondary: #aeaeb2;
  --text-tertiary: #6e6e73;
  --border: #38383a;
  --accent: #2997ff;
  --accent-hover: #5dacff;
  --accent-light: rgba(41, 151, 255, 0.15);
  --green: #30d158;
  --green-light: rgba(48, 209, 88, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.6);
  --shadow-md: 0 4px 16px rgba(0,0,0,.8);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.9);
}

html[data-theme="dark"] .nav { 
  background: rgba(0,0,0,.85); 
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .newsletter { 
  background: var(--bg-card); 
  color: var(--text);
  border: 1px solid var(--border);
}
html[data-theme="dark"] .newsletter p { color: var(--text-secondary); }
html[data-theme="dark"] .newsletter-form input { 
  background: var(--bg-subtle); 
  color: var(--text); 
}
html[data-theme="dark"] .newsletter-form input::placeholder { color: var(--text-tertiary); }
html[data-theme="dark"] .newsletter-form input:focus { background: #38383a; }
html[data-theme="dark"] .newsletter-form button { 
  background: var(--text); 
  color: var(--bg); 
}

html[data-theme="dark"] .cat-card-icon,
html[data-theme="dark"] .feature-card-img[style*="gradient"],
html[data-theme="dark"] .product-card-img,
html[data-theme="dark"] .camp-card-img[style*="gradient"] { 
  filter: brightness(0.85) contrast(1.1); 
}

html[data-theme="dark"] .camp-card-level {
  background: rgba(28,28,30,.8);
  color: var(--text);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); display: flex; align-items: center;
  justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; transition: all var(--transition);
}
.theme-toggle:hover {
  background: var(--bg-subtle); color: var(--text);
}
.theme-toggle svg {
  width: 18px; height: 18px;
}
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
