/* ============================================================
   GIWU CONSTRUCTION — Shared Design System
   styles.css · Production v1.0
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
  --bg: #f4efe7;
  --paper: #fffdf8;
  --ink: #101411;
  --muted: #5d665f;
  --line: rgba(16, 20, 17, .12);
  --green: #102417;
  --green2: #254a31;
  --gold: #d1aa5d;
  --gold2: #e3c785;
  --white: #fff;
  --max: 1280px;
  --r: 28px;
  --shadow: 0 24px 70px rgba(8, 18, 10, .14);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
  width: 100%;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, #eae4d9 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scroll */
  transition: background-color .3s ease;
}
  width: 100%;
  position: relative;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Prevent any element from causing horizontal scroll */
* {
  max-width: 100%;
}

/* ------------------------------------------------------------
   3. LAYOUT
   ------------------------------------------------------------ */
.wrap {
  width: min(100% - 64px, var(--max));
  margin-inline: auto;
}

.section {
  padding: 104px 0;
}

/* ------------------------------------------------------------
   4. TYPOGRAPHY
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green2);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 34px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 4.2vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--ink);
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 580px;
}

.splithead {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 52px;
}

/* ------------------------------------------------------------
   5. SCROLL PROGRESS BAR
   ------------------------------------------------------------ */
.topline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  transform: scaleX(0);
  transform-origin: left;
  z-index: 1000;
  pointer-events: none;
}

/* ------------------------------------------------------------
   6. NAVIGATION
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 999;
}

.navbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(16, 36, 23, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 999px;
  padding: 10px 10px 10px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand .bname {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: .92rem;
  color: var(--white);
}

.brand .btag {
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navlinks a {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
  padding: 8px 16px;
  border-radius: 999px;
  transition: color .3s var(--ease), background .3s var(--ease);
}

.navlinks a:hover,
.navlinks a.active {
  color: var(--white);
  background: rgba(255, 255, 255, .08);
}

.navcta {
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 26px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--gold);
  border-radius: 999px;
  transition: background .3s var(--ease), transform .3s var(--ease);
}

.pill:hover {
  background: var(--gold2);
  transform: scale(1.04);
}

.toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  border: none;
  position: relative;
}

.toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--white);
  transition: all .25s var(--ease);
  border-radius: 1px;
}

.toggle span:nth-child(1) {
  top: 15px;
}

.toggle span:nth-child(2) {
  top: 21px;
}

.toggle span:nth-child(3) {
  top: 27px;
}

.toggle.open span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.toggle.open span:nth-child(2) {
  opacity: 0;
}

.toggle.open span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

.mobile {
  display: none;
  position: fixed;
  top: 80px;
  left: 16px;
  right: 16px;
  background: rgba(16, 36, 23, .96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--r);
  padding: 28px 24px;
  flex-direction: column;
  gap: 6px;
  z-index: 998;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.mobile.show {
  display: flex;
}

.mobile a {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
  padding: 14px 16px;
  border-radius: 16px;
  transition: color .3s var(--ease), background .3s var(--ease);
}

.mobile a:hover,
.mobile a.active {
  color: var(--white);
  background: rgba(255, 255, 255, .06);
}

.mobile .pill {
  margin-top: 10px;
  width: 100%;
  text-align: center;
}

/* ------------------------------------------------------------
   7. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 32px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background .35s var(--ease), color .35s var(--ease),
              border-color .35s var(--ease), transform .35s var(--ease);
}

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

.btn.primary {
  background: var(--gold);
  color: var(--green);
}

.btn.primary:hover {
  background: var(--gold2);
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn.secondary:hover {
  border-color: var(--gold);
  color: var(--green);
}

/* Dark section button overrides */
.dark .btn.secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, .18);
}

.dark .btn.secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ------------------------------------------------------------
   8. ANIMATIONS — REVEAL ON SCROLL
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------
   9. CARDS
   ------------------------------------------------------------ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 30px;
  box-shadow: var(--shadow);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 80px rgba(8, 18, 10, .18);
}

.icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(209, 170, 93, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

/* ------------------------------------------------------------
   10. FOOTER
   ------------------------------------------------------------ */
footer {
  background: #08130b;
  color: var(--white);
  padding: 72px 0 0;
}

.foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 52px;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.foot-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.foot-brand span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.foot p {
  color: rgba(255, 255, 255, .55);
  font-size: .92rem;
  line-height: 1.7;
  max-width: 340px;
}

.foot h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.foot-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.foot-links a {
  font-size: .9rem;
  color: rgba(255, 255, 255, .6);
  transition: color .3s var(--ease);
}

.foot-links a:hover {
  color: var(--gold);
}

.foot-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.foot-contact span {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  color: rgba(255, 255, 255, .6);
  line-height: 1.5;
}

.foot-contact a {
  color: rgba(255, 255, 255, .6);
  transition: color .3s var(--ease);
}

.foot-contact a:hover {
  color: var(--gold);
}

.copy {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 24px 0;
  text-align: center;
  font-size: .8rem;
  color: rgba(255, 255, 255, .35);
}

/* ------------------------------------------------------------
   11. PAGE HERO (Inner Pages)
   ------------------------------------------------------------ */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--green);
  overflow: hidden;
  padding: 140px 0 80px;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(37, 74, 49, .5) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(209, 170, 93, .08) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero .wrap {
  position: relative;
  z-index: 1;
}

.page-hero .eyebrow {
  color: var(--gold);
}

.page-hero .eyebrow::before {
  background: var(--gold);
}

.page-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 18px;
}

.page-hero .lede {
  color: rgba(255, 255, 255, .6);
  margin-inline: auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .78rem;
  color: rgba(255, 255, 255, .4);
  margin-top: 28px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, .5);
  transition: color .3s var(--ease);
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb .sep {
  font-size: .6rem;
}

/* ------------------------------------------------------------
   12. DARK SECTION VARIANT
   ------------------------------------------------------------ */
.dark {
  background: var(--green);
  color: var(--white);
}

.dark .eyebrow {
  color: var(--gold);
}

.dark .eyebrow::before {
  background: var(--gold);
}

.dark .headline {
  color: var(--white);
}

.dark .lede {
  color: rgba(255, 255, 255, .6);
}

.dark .card {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
}

/* ------------------------------------------------------------
   13. GRID UTILITIES
   ------------------------------------------------------------ */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* ------------------------------------------------------------
   14. RESPONSIVE — 1120px
   ------------------------------------------------------------ */
@media (max-width: 1120px) {
  .splithead {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .grid4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .foot {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------
   15. RESPONSIVE — 860px
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .wrap {
    width: min(100% - 40px, var(--max));
  }

  .section {
    padding: 64px 0;
  }

  .navlinks,
  .navcta {
    display: none;
  }

  .toggle {
    display: flex;
  }

  .headline {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .splithead {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 36px;
  }

  .grid2,
  .grid3,
  .grid4 {
    grid-template-columns: 1fr;
  }

  .foot {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .page-hero {
    min-height: 40vh;
    padding: 120px 0 60px;
  }

  .page-hero h1 {
    font-size: clamp(2rem, 7vw, 3rem);
  }

  /* Fix mobile stability - prevent horizontal scrolling */
  body {
    overflow-x: hidden;
    position: relative;
  }

  html {
    overflow-x: hidden;
  }

  /* Ensure all elements stay within viewport */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Fix navigation for mobile */
  .navbox {
    width: min(calc(100% - 32px), var(--max));
    margin: 0 auto;
  }

  /* Ensure mobile menu works properly */
  .mobile {
    transform: translateX(0);
    transition: transform .3s var(--ease);
  }

  .mobile.show {
    display: flex;
    transform: translateX(0);
  }
}

/* ------------------------------------------------------------
   16. RESPONSIVE — 480px (Small phones)
   ------------------------------------------------------------ */
@media (max-width: 480px) {
  .wrap {
    width: min(100% - 28px, var(--max));
  }

  .section {
    padding: 48px 0;
  }

  .navbox {
    padding: 8px 8px 8px 16px;
  }

  .card {
    padding: 28px 22px;
  }
}


/* ============================================================
   ENHANCED VISUAL IMPRESSIONS & BEST PRACTICES
   ============================================================ */

/* Smooth reveal animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Enhanced reveal class */
.reveal {
  animation: fadeInUp 0.8s var(--ease) forwards;
  opacity: 0;
}

.reveal.in {
  opacity: 1;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Button enhancements */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(16, 20, 17, 0.1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(16, 20, 17, 0.15);
}

.btn:active {
  transform: translateY(0);
}

/* Accessibility: Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gold);
  color: var(--green);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
  font-weight: 700;
}

.skip-link:focus {
  top: 0;
}

/* Card hover effects */
.cap-card,
.step-card,
.proj-card,
.client-card-logo {
  position: relative;
  overflow: hidden;
}

.cap-card::after,
.step-card::after,
.proj-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.cap-card:hover::after,
.step-card:hover::after,
.proj-card:hover::after {
  left: 100%;
}

/* Enhanced text effects */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

/* Link hover effects */
a {
  position: relative;
  transition: color 0.3s ease;
}

a:not(.btn):not(.navlinks a):not(.mobile a)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}

a:not(.btn):not(.navlinks a):not(.mobile a):hover::after {
  width: 100%;
}

/* Enhanced section spacing */
.section {
  transition: all 0.3s ease;
}

.section:hover {
  transform: translateY(-1px);
}

/* Improved logo display */
.client-card-logo img {
  transition: all 0.4s var(--ease);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.client-card-logo:hover img {
  filter: drop-shadow(0 8px 16px rgba(16, 20, 17, 0.15)) brightness(1.05);
  transform: scale(1.1);
}

/* Enhanced form inputs */
input, textarea, select {
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 74, 49, 0.15) !important;
}

/* Input placeholder styling */
input::placeholder,
textarea::placeholder {
  color: rgba(93, 102, 95, 0.5);
  transition: color 0.3s ease;
}

input:focus::placeholder,
textarea:focus::placeholder {
  color: rgba(93, 102, 95, 0.3);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(16, 20, 17, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 5px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

/* Enhanced navigation */
.nav {
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Improved spacing for better visual hierarchy */
.wrap {
  transition: all 0.3s ease;
}

/* Enhanced proof items */
.proof-item {
  transition: all 0.4s var(--ease);
}

.proof-item:hover {
  background: rgba(209, 170, 93, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(16, 20, 17, 0.12);
}

/* Loading state animation */
.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth color transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Disable transitions for animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
}

.whatsapp-float:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.whatsapp-float .social-icon {
  width: 40px;
  height: 40px;
}

@media (max-width: 860px) {
  .whatsapp-float {
    right: 14px;
    bottom: 14px;
    width: 70px;
    height: 70px;
  }
}

/* ============================================================
   ADDITIONAL BEST PRACTICES
   ============================================================ */

/* Improved text selection */
::selection {
  background: var(--gold);
  color: var(--green);
}

::-moz-selection {
  background: var(--gold);
  color: var(--green);
}

/* Better focus states for all interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Improved button states */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Better form validation states */
input:invalid {
  border-color: #d32f2f;
}

input:valid {
  border-color: #388e3c;
}

/* Improved card interactions */
.card {
  position: relative;
  z-index: 1;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(209, 170, 93, 0.05), transparent);
  border-radius: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.card:hover::before {
  opacity: 1;
}

/* Enhanced list styling */
ul, ol {
  list-style: none;
}

li {
  transition: transform 0.2s ease, color 0.2s ease;
}

li:hover {
  transform: translateX(4px);
}

/* Better image handling */
img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: filter 0.3s ease, transform 0.3s ease;
}

img:hover {
  filter: brightness(1.05);
}

/* Improved table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  background: rgba(16, 20, 17, 0.05);
  font-weight: 700;
  color: var(--green2);
}

tr:hover {
  background: rgba(209, 170, 93, 0.05);
}

/* Better code block styling */
code {
  background: rgba(16, 20, 17, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

pre {
  background: rgba(16, 20, 17, 0.1);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

pre code {
  background: none;
  padding: 0;
}

/* Improved blockquote styling */
blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 20px;
  margin: 20px 0;
  color: var(--muted);
  font-style: italic;
}

/* Better hr styling */
hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 32px 0;
}

/* Improved tooltip styling */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Better print styles */
@media print {
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a, a:visited {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  img {
    max-width: 100% !important;
  }

  @page {
    margin: 0.5cm;
  }

  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }
}

/* Improved dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --paper: #242424;
    --ink: #f0f0f0;
    --muted: #a0a0a0;
  }
}

/* Improved high contrast mode support */
@media (prefers-contrast: more) {
  :root {
    --gold: #b8860b;
    --green: #004d00;
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* Improved reduced transparency support */
@media (prefers-reduced-transparency: reduce) {
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
