*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0b0f;
  --bg-2: #121521;
  --panel: #111521;
  --panel-soft: #171d2c;
  --line: #2a3147;
  --text: #f3f6ff;
  --muted: #a5b0cc;
  --accent: #d7b073;
  --accent-soft: #b9945f;
  --cold: #7fa0d6;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(950px 500px at 8% -10%, rgba(127,160,214,0.14), transparent 66%),
    radial-gradient(800px 500px at 95% 10%, rgba(215,176,115,0.12), transparent 70%),
    linear-gradient(180deg, #090a0e 0%, #0d1018 45%, #08090d 100%);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(127,160,214,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,160,214,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 95%);
}

.topbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, 92vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(215,176,115,0.22);
  background: rgba(9,11,16,0.72);
  backdrop-filter: blur(14px);
  z-index: 30;
}

.topbar.is-scrolled {
  background: rgba(9,11,16,0.9);
  border-color: rgba(215,176,115,0.34);
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(215,176,115,0.5);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 0.7rem;
}

.brand-text {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.topbar nav {
  display: flex;
  gap: 1.5rem;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.25s;
}

.topbar nav a:hover {
  color: var(--accent);
}

.chip-btn {
  background: linear-gradient(135deg, rgba(215,176,115,0.2), rgba(215,176,115,0.04));
  color: var(--accent);
  border: 1px solid rgba(215,176,115,0.5);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding-top: 7rem;
}

.panel {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: linear-gradient(145deg, rgba(17,21,33,0.96), rgba(10,11,15,0.96));
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.2rem;
  padding: 3rem;
}

.hero-copy h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 1.04;
  margin-bottom: 1.2rem;
}

.hero-copy h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-copy p {
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.8;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.main-btn {
  background: linear-gradient(135deg, #4f6f9f, #38547f);
  color: #f5f8ff;
  border: 1px solid rgba(127,160,214,0.45);
  border-radius: 0.8rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ghost-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.85rem 1.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-matrix {
  background: linear-gradient(160deg, rgba(23,29,44,0.85), rgba(11,13,18,0.88));
  border: 1px solid rgba(127,160,214,0.26);
  border-radius: 1rem;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  align-content: center;
}

.hero-matrix div {
  border: 1px solid rgba(127,160,214,0.22);
  border-radius: 0.8rem;
  padding: 0.9rem;
}

.hero-matrix small {
  display: block;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.hero-matrix strong {
  display: block;
  margin-top: 0.35rem;
  font-family: 'Fraunces', serif;
  font-weight: 400;
}

.block {
  padding: 4.8rem 0 1.2rem;
}

.heading h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 0.8rem;
}

.cards {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.4rem;
  background: linear-gradient(160deg, rgba(17,21,33,0.95), rgba(11,13,19,0.95));
  min-height: 210px;
}

.card span {
  display: inline-block;
  font-family: 'Fraunces', serif;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.card h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  margin-bottom: 0.8rem;
}

.card p {
  color: var(--muted);
  line-height: 1.7;
}

.timeline {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.step {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(17,21,33,0.95), rgba(11,13,19,0.95));
  padding: 1.1rem;
}

.step b {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(215,176,115,0.55);
  border-radius: 50%;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.step h4 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  margin-bottom: 0.45rem;
}

.step p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

.promise {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.4;
  color: var(--pale);
}

.note {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(17,21,33,0.95), rgba(11,13,19,0.95));
  padding: 1.3rem;
}

.note h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  margin-bottom: 0.7rem;
}

.note ul {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.note li {
  color: var(--muted);
  line-height: 1.6;
  position: relative;
  padding-left: 1rem;
}

.note li::before {
  content: '•';
  color: var(--accent);
  position: absolute;
  left: 0;
}

.contact-box {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(17,21,33,0.95), rgba(11,13,19,0.95));
  padding: 1.3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.contact-box h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.contact-box p {
  color: var(--muted);
  line-height: 1.75;
}

.form {
  display: grid;
  gap: 0.8rem;
}

.form input,
.form select,
.form textarea {
  background: rgba(20,25,38,0.85);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.7rem;
  padding: 0.8rem;
  font-family: 'Space Grotesk', sans-serif;
}

.form textarea {
  min-height: 100px;
  resize: vertical;
}

footer {
  width: min(1180px, 92vw);
  margin: 3rem auto 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

footer div {
  display: flex;
  gap: 1rem;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 14ch;
  }

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

  .contact-box,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  /* ===== RESET BASE ===== */
  * {
    max-width: 100%;
  }

  body {
    overflow-x: hidden;
  }

  /* ===== TOPBAR & NAVIGATION ===== */
  .topbar {
    width: 100%;
    padding: 0.75rem 1rem;
    height: auto;
    min-height: 60px;
  }

  .topbar nav {
    display: none !important;
  }

  .chip-btn {
    display: none !important;
  }

  #mobileToggle {
    display: block !important;
    min-height: 44px;
    min-width: 44px;
  }

  /* ===== MOBILE MENU IMPROVEMENTS ===== */
  .mobile-menu {
    width: 100% !important;
    max-width: 100vw;
    right: 0 !important;
    top: 0 !important;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.98) !important;
    backdrop-filter: blur(12px);
  }

  .mobile-menu.open {
    transform: translateX(0);
  }

  .mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-size: 1rem;
    word-break: break-word;
  }

  #mobileOverlay {
    display: block !important;
  }

  #mobileOverlay.hidden {
    display: none !important;
  }

  /* ===== MAIN CONTENT ===== */
  main {
    width: 100%;
    padding: 6.2rem 1rem 2rem 1rem;
    margin: 0;
  }

  /* ===== TYPOGRAPHY FOR MOBILE ===== */
  h1 {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    line-height: 1.2;
    margin: 1rem 0;
  }

  h2 {
    font-size: clamp(1.25rem, 5vw, 2rem);
    margin: 1rem 0 0.75rem 0;
  }

  h3 {
    font-size: clamp(1rem, 4vw, 1.5rem);
    margin: 0.75rem 0;
  }

  h4, h5, h6 {
    font-size: clamp(0.95rem, 3vw, 1.25rem);
  }

  p, span, li {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    line-height: 1.6;
  }

  small {
    font-size: 0.75rem;
  }

  /* ===== BUTTONS & INTERACTIVE ===== */
  button, a.btn-gold, .btn-gold, input[type="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    font-size: clamp(0.875rem, 2vw, 1rem);
    border-radius: 0.5rem;
    touch-action: manipulation;
  }

  button:active, a.btn-gold:active, .btn-gold:active {
    transform: scale(0.98);
  }

  /* ===== HERO SECTION ===== */
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
  }

  .hero-copy {
    order: 2;
    text-align: center;
  }

  .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .hero-copy p {
    margin: 1rem 0;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  }

  .hero-visual {
    order: 1;
    max-width: 100%;
    width: 100%;
  }

  .hero-visual img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 300px;
  }

  /* ===== CARDS & GRIDS ===== */
  .cards,
  .timeline,
  .services-grid,
  .team-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card, .service-card, .team-card, .blog-card {
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
  }

  .card img, .service-card img, .team-card img, .blog-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
  }

  /* ===== CONTACT BOXES & FORMS ===== */
  .contact-box,
  .two-col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  input, textarea, select {
    min-height: 44px;
    font-size: 16px;
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  textarea {
    min-height: 120px;
    resize: vertical;
  }

  /* ===== FOOTER ===== */
  footer {
    width: 100%;
    padding: 2rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  footer > div {
    width: 100%;
  }

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

  /* ===== IMAGES & MEDIA ===== */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  picture {
    max-width: 100%;
  }

  video, iframe {
    max-width: 100%;
    height: auto;
  }

  /* ===== LISTS & ITEMS ===== */
  ul, ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
  }

  li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
  }

  /* ===== SPACING IMPROVEMENTS ===== */
  section {
    padding: 2rem 0;
    margin: 1rem 0;
  }

  /* ===== TOUCH OPTIMIZATION ===== */
  a, button, input[type="button"], input[type="submit"] {
    -webkit-tap-highlight-color: rgba(201, 168, 76, 0.2);
    -webkit-user-select: none;
    user-select: none;
  }

  /* Hover states para touch */
  @media (hover: none) {
    a:hover, button:hover {
      opacity: 0.9;
    }
  }

  /* ===== TEXT & SELECTION ===== */
  ::selection {
    background-color: rgba(201, 168, 76, 0.4);
    color: white;
  }

  ::-moz-selection {
    background-color: rgba(201, 168, 76, 0.4);
    color: white;
  }

  /* ===== VISIBILITY CLASSES ===== */
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }

  /* ===== FLEX & GRID HELPERS ===== */
  .flex {
    flex-wrap: wrap;
  }

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

  /* ===== TABLE RESPONSIVE ===== */
  table {
    width: 100%;
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
    text-align: left;
  }

  /* ===== CODE BLOCKS ===== */
  code, pre {
    overflow-x: auto;
    font-size: 0.85rem;
  }

  /* ===== ANIMATIONS (Smooth) ===== */
  @media (prefers-reduced-motion: no-preference) {
    * {
      scroll-behavior: smooth;
    }
  }

  /* ===== LOADING & TRANSITIONS ===== */
  .loader-logo img {
    width: 100%;
    height: auto;
  }

  /* ===== BREAKPOINT SPECIFIC: SMALL PHONES (320px) ===== */
}

@media (max-width: 480px) {
  /* Extra small screens */
  main {
    padding: 5.5rem 0.75rem 1.5rem 0.75rem;
  }

  h1 {
    font-size: clamp(1.25rem, 6vw, 2rem);
  }

  h2 {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  p {
    font-size: clamp(0.8rem, 2vw, 0.95rem);
  }

  .topbar {
    padding: 0.5rem 0.75rem;
  }

  .mobile-menu {
    width: 100vw;
  }

  button, a.btn-gold, .btn-gold {
    padding: 0.65rem 1.2rem;
    font-size: 0.9rem;
  }

  .hero {
    gap: 1rem;
  }

  .card, .service-card, .team-card, .blog-card {
    padding: 1rem;
  }

  input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  footer {
    padding: 1.5rem 0.75rem;
    gap: 1.5rem;
  }
}

@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;
  }
}
