/* =============================================
   EvoTechTool — Shared Design System
   "The Evolution Of Everyday Tools"
   ============================================= */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg:        #F8FAFC;
  --surface:   #FFFFFF;
  --primary:   #2563EB;
  --secondary: #7C3AED;
  --gradient:  linear-gradient(135deg, #2563EB, #7C3AED);
  --text:      #0F172A;
  --muted:     #64748B;
  --border:    #E2E8F0;
  --ad-bg:     #F1F5F9;
  --success:   #10B981;
  --danger:    #EF4444;
  --warning:   #F59E0B;
  --radius:    12px;
  --shadow:    0 2px 16px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.10);
  --nav-h:     68px;
  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }

/* ── TYPOGRAPHY ── */
h1 { font-size: clamp(28px, 5vw, 52px); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(22px, 3.5vw, 36px); font-weight: 700; line-height: 1.2; }
h3 { font-size: clamp(16px, 2.5vw, 22px); font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }
p  { color: var(--muted); font-size: 15px; }

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 72px 0;
}
.section-sm { padding: 48px 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px;
  border-radius: 10px; border: none;
  font-size: 15px; font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,0.4); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: 12px; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
  background: #EFF6FF; color: var(--primary);
  border: 1px solid #BFDBFE;
}

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; font-family: var(--font);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-textarea { resize: vertical; min-height: 90px; }

/* ── DIVIDER ── */
.divider {
  height: 1px; background: var(--border);
  margin: 32px 0;
}

/* ── TAG / CHIP ── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--muted);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s;
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
.navbar.hidden { transform: translateY(-100%); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: var(--text);
  flex-shrink: 0;
}
.nav-logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 800;
}
.nav-logo-text span { color: var(--primary); }

/* Desktop nav links */
.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}
.nav-links a {
  padding: 7px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg); }
.nav-links a.active { color: var(--primary); background: #EFF6FF; font-weight: 600; }

.nav-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Hamburger */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 6px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px; z-index: 999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  transform: translateY(-10px); opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-drawer.open {
  display: block; transform: translateY(0); opacity: 1;
}
.nav-drawer ul { list-style: none; }
.nav-drawer ul li { border-bottom: 1px solid var(--border); }
.nav-drawer ul li:last-child { border-bottom: none; }
.nav-drawer ul a {
  display: block; padding: 13px 4px;
  font-size: 15px; font-weight: 500; color: var(--text);
  transition: color 0.15s;
}
.nav-drawer ul a:hover, .nav-drawer ul a.active { color: var(--primary); }
.nav-drawer-cta { margin-top: 16px; }
.nav-drawer-cta .btn { width: 100%; justify-content: center; }

/* Page body offset */
body { padding-top: var(--nav-h); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: #0F172A;
  color: #94A3B8;
  padding: 56px 0 28px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #1E293B;
}
.footer-brand .nav-logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 260px; }
.footer-brand .slogan {
  font-size: 12px; font-style: italic;
  color: #475569; margin-top: 8px;
}
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 14px; letter-spacing: 0.05em; text-transform: uppercase; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { font-size: 13px; color: #94A3B8; transition: color 0.15s; }
.footer-col ul a:hover { color: #fff; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 12px; color: #475569; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 8px;
  background: #1E293B; color: #94A3B8;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: background 0.15s, color 0.15s;
}
.footer-social a:hover { background: var(--primary); color: #fff; }

/* =============================================
   AD SLOTS
   ============================================= */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  overflow: hidden;
}
.ad-leaderboard { width: 100%; height: 90px; margin: 24px 0; }
.ad-rectangle { width: 300px; min-height: 250px; }
.ad-rectangle-full { width: 100%; min-height: 120px; margin: 32px 0; }

/* =============================================
   PAGE HEADER (tool pages)
   ============================================= */
.page-header {
  background: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 100%);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
  text-align: center;
}
.page-header .badge { margin-bottom: 12px; }
.page-header h1 { font-size: clamp(24px, 4vw, 38px); margin-bottom: 8px; }
.page-header p { font-size: 15px; max-width: 520px; margin: 0 auto; }

/* =============================================
   TOOL LAYOUT (2-col on desktop)
   ============================================= */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
  padding: 36px 0;
}
.tool-main { min-width: 0; }
.tool-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* =============================================
   TOAST
   ============================================= */
#evo-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #0F172A; color: #fff;
  padding: 12px 24px; border-radius: 30px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  opacity: 0; z-index: 9999; white-space: nowrap;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
#evo-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#evo-toast.success { background: #064E3B; }
#evo-toast.error { background: #7F1D1D; }

/* =============================================
   SECTION TITLES
   ============================================= */
.section-title { text-align: center; margin-bottom: 48px; }
.section-title .badge { margin-bottom: 10px; }
.section-title h2 { margin-bottom: 10px; }
.section-title p { max-width: 540px; margin: 0 auto; }

/* =============================================
   GRID UTILITIES
   ============================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; }

/* =============================================
   DESIGN TIER 1: DESKTOP & LAPTOP (≥1025px)
   Base styles above apply to desktop screens.
   ============================================= */

/* =============================================
   DESIGN TIER 2: TABLET (641px–1024px)
   ============================================= */
@media (max-width: 1024px) {
  .nav-links, .nav-cta .btn-outline { display: none; }
  .nav-toggle { display: flex; min-height: 44px; min-width: 44px; align-items: center; justify-content: center; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .tool-layout { grid-template-columns: 1fr; gap: 24px; }
  .tool-sidebar { flex-direction: row; flex-wrap: wrap; }
  .tool-sidebar > * { flex: 1 1 300px; }
  .ad-rectangle { width: 100%; min-height: 100px; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}

/* =============================================
   DESIGN TIER 3: MOBILE ANDROID & IOS (≤640px)
   ============================================= */
@media (max-width: 640px) {
  :root { --nav-h: 60px; }
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }

  .nav-logo-text { display: none; }
  .nav-cta { gap: 6px; }

  .nav-drawer ul a { padding: 14px 8px; min-height: 44px; display: flex; align-items: center; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { grid-column: auto; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 16px; }
  .footer-social { justify-content: center; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tool-sidebar { flex-direction: column; }
  .tool-sidebar > * { width: 100%; }

  .ad-leaderboard { height: 60px; }
  .btn { min-height: 44px; }
  .btn-lg { padding: 14px 24px; font-size: 15px; }

  .page-header { padding: 28px 0 24px; }
  .page-header h1 { font-size: 24px; }

  .form-input, .form-select, .form-textarea { font-size: 16px; min-height: 44px; } /* Prevents iOS auto-zoom on input focus */
}

