/* ═══════════════════════════════════════════════════════
   TAPASH SUTRADHAR — GLOBAL STYLES
   File: css/global.css
═══════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────── */
:root {
  --bg:    #ffffff;
  --bg2:   #fafafa;
  --bg3:   #f5f5f5;
  --b1:    #e5e5e5;
  --b2:    #d4d4d4;
  --t1:    #0a0a0a;
  --t2:    #404040;
  --t3:    #737373;
  --t4:    #a3a3a3;
  --nav-h: 64px;
}
[data-theme="dark"] {
  --bg:  #000000;
  --bg2: #0a0a0a;
  --bg3: #141414;
  --b1:  #1a1a1a;
  --b2:  #222222;
  --t1:  #fafafa;
  --t2:  #d4d4d4;
  --t3:  #737373;
  --t4:  #404040;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -0.003em;
  background: var(--bg);
  color: var(--t1);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--t1); color: var(--bg); }
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-thumb { background: var(--b2); }

/* ── Typography ─────────────────────────────────────── */
.t-display  { font-family: 'Playfair Display', serif; font-size: clamp(2.2rem, 7vw, 5rem);   line-height: 1.05; letter-spacing: -0.03em;  font-weight: 500; }
.t-headline { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 4vw, 3rem);   line-height: 1.1;  letter-spacing: -0.025em; font-weight: 500; }
.t-title    { font-size: clamp(1rem, 2.5vw, 1.375rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; }
.t-body     { font-size: clamp(0.875rem, 1.5vw, 0.9375rem); line-height: 1.75; color: var(--t2); }
.t-small    { font-size: clamp(0.75rem, 1.2vw, 0.8125rem);  line-height: 1.6;  color: var(--t3); }
.t-label    { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t3); }
.t-mono     { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; }
.serif      { font-family: 'Playfair Display', serif; }
.kicker     { display: inline-block; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t3); margin-bottom: 20px; }

/* ── Layout ─────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 480px)  { .wrap { padding: 0 24px; } }
@media (min-width: 768px)  { .wrap { padding: 0 40px; } }
@media (min-width: 1024px) { .wrap { padding: 0 56px; } }

.section { padding: 64px 0; }
@media (min-width: 768px)  { .section { padding: 96px 0; } }
@media (min-width: 1024px) { .section { padding: 120px 0; } }

/* Page header — clears fixed navbar */
.page-top {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 48px;
  border-bottom: 1px solid var(--b1);
}
@media (min-width: 768px) {
  .page-top {
    padding-top: calc(var(--nav-h) + 64px);
    padding-bottom: 64px;
  }
}

hr.rule { border: none; border-top: 1px solid var(--b1); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 10px 20px;
  border-radius: 2px;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 40px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.btn-dark    { background: var(--t1); color: var(--bg); }
.btn-dark:hover  { opacity: 0.82; }
.btn-outline { background: transparent; color: var(--t1); border: 1px solid var(--b2); }
.btn-outline:hover { border-color: var(--t1); }
.btn:active  { transform: scale(0.98); }

/* ── Chip ───────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid var(--b2);
  border-radius: 2px;
  color: var(--t3);
  white-space: nowrap;
}

/* ── Scroll Progress Bar ────────────────────────────── */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 1px;
  background: var(--t1);
  z-index: 9999;
  width: 0;
  transition: width 0.08s linear;
}

/* ── Navbar ─────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s ease, border-color 0.3s ease;
}
#navbar.scrolled {
  background: var(--bg);
  border-bottom: 1px solid var(--b1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#navbar.menu-open { background: var(--bg); }

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.9rem, 1.8vw, 1.125rem);
  font-weight: 500;
  color: var(--t1);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-links {
  display: none;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  overflow: visible;
}
.nav-links.show { display: flex; }
.nav-link {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--t3);
  padding: 6px 10px;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.15s ease;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-link:hover,
.nav-link.active { color: var(--t1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--t3);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  min-width: 36px;
  min-height: 36px;
  transition: color 0.15s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { color: var(--t1); }

/* ── Mobile Menu ────────────────────────────────────── */
#mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  flex-direction: column;
  padding: calc(var(--nav-h) + 16px) 24px 48px;
  overflow-y: auto;
}
#mobile-menu.open { display: flex; }
.mobile-link {
  display: block;
  padding: 18px 0;
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-family: 'Playfair Display', serif;
  color: var(--t2);
  border-bottom: 1px solid var(--b1);
  text-decoration: none;
  transition: color 0.15s ease;
}
.mobile-link:hover,
.mobile-link.active { color: var(--t1); }

/* ── Footer ─────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--b1);
  padding-top: clamp(48px, 7vw, 80px);
  padding-bottom: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px 48px;
  margin-bottom: 56px;
}
.social-row  { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 20px; }
.social-btn  {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 2px;
  border: 1px solid var(--b1);
  color: var(--t4);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.social-btn:hover { color: var(--t1); border-color: var(--b2); background: var(--bg2); }
.footer-link {
  display: block;
  font-size: 0.8125rem;
  color: var(--t3);
  margin-bottom: 8px;
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--t1); }
.footer-bottom {
  border-top: 1px solid var(--b1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Reveal Animation ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Toast ──────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-msg {
  padding: 12px 18px;
  background: var(--bg2);
  border: 1px solid var(--b2);
  border-radius: 2px;
  font-size: 0.875rem;
  max-width: 320px;
  animation: slideUp 0.3s ease;
}
.toast-msg.err { border-color: rgba(239,68,68,.4); color: #ef4444; }
.toast-msg.ok  { border-color: rgba(34,197,94,.4);  color: #22c55e; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Utilities ──────────────────────────────────────── */
.flex       { display: flex; }
.flex-wrap  { flex-wrap: wrap; }
.gap-xs     { gap: 4px; }
.gap-sm     { gap: 6px; }
.gap-md     { gap: 10px; }
.gap-lg     { gap: 12px; }
.gap-xl     { gap: 16px; }
.mt-sm      { margin-top: 8px; }
.mt-md      { margin-top: 16px; }
.mt-lg      { margin-top: 24px; }
.mt-xl      { margin-top: 32px; }
.mb-xs      { margin-bottom: 4px; }
.mb-sm      { margin-bottom: 8px; }
.mb-md      { margin-bottom: 16px; }
.mb-lg      { margin-bottom: 24px; }
.text-center { text-align: center; }
.items-center { align-items: center; }

/* ── Shared Form Input ──────────────────────────────── */

/*
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--b1);
  color: var(--t1);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  outline: none;
  border-radius: 2px;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
}
*/

.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--b1);
  color: var(--t1);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  outline: none;
  border-radius: 2px;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;  /* Added for standard compatibility across browsers */
}

.input:focus { border-color: var(--b2); }
.input::placeholder { color: var(--t4); }

/* ── Keyframes ──────────────────────────────────────── */
@keyframes fadeUp  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes blink   { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes spin    { to { transform: rotate(360deg); } }
