/* EditBuddy Global Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  /* ── Legacy tokens (DO NOT REMOVE — used across existing pages) ─────── */
  --bg: #06070b;
  --surface: #121621;
  --surface-2: #191f2b;
  --surface-3: #212838;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f6fb;
  --muted: #9aa3b7;
  --soft: #667086;
  --brand: #ff6a1a;
  --brand2: #ffb347;
  --glow: rgba(255, 106, 26, 0.18);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.26);
  --radius: 26px;
  --radius-sm: 18px;
  --max: 1160px;

  /* ── Design system v2 — use these for all new components ─────────────
     Reasoning: the legacy tokens above work for the dark theme but lack
     accessible-contrast pairs (raw #ff6a1a fails AA on white) and have no
     systematic spacing/type scale. Everything below is additive. */

  /* Brand scale — darker shades pass WCAG AA on white; lighter shades for
     soft backgrounds and chips */
  --brand-50:  #fff5ee;
  --brand-100: #ffe1cc;
  --brand-200: #ffc599;
  --brand-300: #ffa566;
  --brand-400: #ff8633;
  --brand-500: #ff6a1a;   /* primary — same as legacy --brand */
  --brand-600: #e85700;   /* AA-compliant text-on-white (4.62:1) */
  --brand-700: #b34300;   /* AAA-compliant text-on-white (7.1:1) */
  --brand-800: #803000;
  --brand-900: #4d1d00;

  /* Neutral scale — semantic, used for text and surfaces */
  --neutral-50:  #f4f6fb;
  --neutral-100: #cdd3e3;
  --neutral-200: #9aa3b7;
  --neutral-300: #667086;
  --neutral-400: #4a536a;
  --neutral-500: #2f3848;
  --neutral-600: #212838;
  --neutral-700: #191f2b;
  --neutral-800: #121621;
  --neutral-900: #06070b;

  /* Status colors */
  --success: #35d07f;
  --warning: #ffb347;
  --danger:  #ff4d6a;
  --info:    #4db8ff;

  /* Spacing scale — 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 / 128 */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* Type scale — fluid clamps so headlines breathe on small screens */
  --text-xs:      12px;
  --text-sm:      14px;
  --text-base:    16px;
  --text-lg:      18px;
  --text-xl:      clamp(20px, 2vw, 24px);
  --text-2xl:     clamp(24px, 2.6vw, 32px);
  --text-3xl:     clamp(32px, 3.6vw, 44px);
  --text-display: clamp(40px, 6vw, 72px);

  /* Line heights */
  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.6;
  --leading-relaxed: 1.8;

  /* Radius scale */
  --radius-xs: 6px;
  --radius-sm-2: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadow scale */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.26);
  --shadow-xl: 0 28px 90px rgba(0, 0, 0, 0.30);
  --shadow-glow: 0 0 32px rgba(255, 106, 26, 0.28);

  /* Motion */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:   cubic-bezier(0.5, 0, 0.75, 0);
  --ease-bezier: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:    120ms;
  --dur-base:    200ms;
  --dur-slow:    320ms;
  --dur-slower:  500ms;

  /* Layout */
  --container-sm: 720px;
  --container-md: 960px;
  --container-lg: 1160px;
  --container-xl: 1280px;
}

/* Respect user's reduced-motion preference for everything that animates. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 106, 26, 0.18), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(255, 179, 71, 0.08), transparent 22%),
    linear-gradient(180deg, #090b10 0%, #06070b 100%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 78%);
  opacity: 0.5;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: -20% -10% auto;
  height: 360px;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 106, 26, 0.18), transparent 34%),
    radial-gradient(circle at 78% 8%, rgba(255, 179, 71, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 72%);
  filter: blur(14px);
  pointer-events: none;
  z-index: -1;
}

::selection { background: rgba(255, 126, 43, 0.28); color: #ffffff; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.w { width: min(var(--max), 100% - 48px); margin: 0 auto; }
.sec { padding: 100px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-p {
  color: #ffffff;
  background: linear-gradient(135deg, #ff7b27 0%, #ff9c2d 55%, #ffb84d 100%);
  box-shadow: 0 16px 36px rgba(255, 106, 26, 0.24);
}

.btn-p:hover {
  box-shadow: 0 20px 44px rgba(255, 106, 26, 0.3);
}

.btn-s {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn-s:hover {
  border-color: rgba(255, 126, 43, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 126, 43, 0.06));
}

.btn-full { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 14px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 126, 43, 0.18);
  background: rgba(255, 106, 26, 0.08);
  color: #ffd8bd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(255, 106, 26, 0.65);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6, 7, 11, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(22px) saturate(140%);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-nav.scrolled {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(6, 7, 11, 0.84);
}

.nav-bar {
  width: min(var(--max), 100% - 40px);
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.04em;
  cursor: pointer;
}

.logo img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(255, 106, 26, 0.15);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav-links a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-avatar-btn:hover,
.nav-avatar-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 126, 43, 0.16);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7b27, #ffb347);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  background-size: cover;
  background-position: center;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 270px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(18, 22, 31, 0.98), rgba(10, 12, 18, 1));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  display: none;
  z-index: 999;
}

.nav-dropdown.open { display: block; }

.nav-dd-head {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 6px;
}

.nav-dd-avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.nav-dd-name {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dd-email {
  display: block;
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dd-divider {
  height: 1px;
  margin: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: none;
  border-radius: 12px;
  background: none;
  color: #d6dceb;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-dd-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-dd-kicker {
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
}

.nav-dd-signout { color: #f59191; }

.nav-dd-signout:hover {
  color: #ffb2b2;
  background: rgba(248, 113, 113, 0.1);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.mob-menu {
  display: none;
  width: min(var(--max), 100% - 40px);
  margin: 0 auto 18px;
  padding: 10px 0 0;
}

.mob-menu.open { display: block; }

.mob-menu a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.mob-menu .btn {
  width: 100%;
  margin-top: 16px;
}

.site-footer {
  position: relative;
  margin-top: 52px;
  padding: 38px 0 44px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.01));
}

.site-footer .w {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
}

.site-footer a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.site-footer a:hover {
  color: var(--text);
  border-color: rgba(255, 126, 43, 0.16);
  background: rgba(255, 126, 43, 0.08);
}

.site-footer a + a::before {
  content: none;
}

@media (max-width: 768px) {
  .w { width: min(100% - 28px, 100% - 28px); }
  .sec { padding: 68px 0; }
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .nav-bar { width: min(100% - 28px, 100% - 28px); height: 74px; }
}
