/* XD ORIGAMI LTD - custom styles (complements Tailwind CDN) */

html {
  scroll-behavior: smooth;
}

section[id],
main[id] {
  scroll-margin-top: 5rem;
}

main:focus {
  outline: none;
}

/* Focus states */
:focus-visible {
  outline: 3px solid #E4572E;
  outline-offset: 3px;
}

#why :focus-visible,
footer :focus-visible {
  outline-color: #F7F5F0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: #1F3A5F;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Navigation */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1F3A5F;
  transition: background-color 0.15s ease;
}

.nav-link:hover {
  background-color: rgba(31, 58, 95, 0.08);
}

.mobile-link {
  display: block;
  padding: 0.875rem 0.25rem;
  border-bottom: 1px solid rgba(20, 24, 31, 0.08);
  font-weight: 500;
  color: #1F3A5F;
}

.mobile-link:hover {
  color: #B8401C;
}

li:last-child > .mobile-link {
  border-bottom: 0;
}

.footer-link {
  color: rgba(247, 245, 240, 0.85);
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 0.25rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.footer-link:hover {
  color: #fff;
  text-decoration-color: #E4572E;
}

/* Section labels */
.eyebrow,
.eyebrow-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  color: #B8401C;
}

.eyebrow-light {
  color: #F7F5F0;
}

.eyebrow::before,
.eyebrow-light::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: #E4572E;
  transform: rotate(45deg);
}

/* Hero background: faint fold lines */
.fold-grid {
  background-image:
    linear-gradient(135deg, transparent 49.6%, rgba(31, 58, 95, 0.06) 50%, transparent 50.4%),
    linear-gradient(45deg, transparent 49.6%, rgba(31, 58, 95, 0.05) 50%, transparent 50.4%);
  background-size: 220px 220px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

/* Why section background facets */
.why-folds {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0 30%, transparent 30%),
    linear-gradient(20deg, transparent 0 70%, rgba(20, 24, 31, 0.25) 70%);
}

/* Folded corner accent */
.corner-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(225deg, #F7F5F0 0 50%, #E4572E 50% 100%);
  border-bottom-left-radius: 0.5rem;
  opacity: 0.95;
}

.corner-fold--light {
  background: linear-gradient(225deg, #ffffff 0 50%, #E4572E 50% 100%);
}

/* Service cards */
.service-card {
  position: relative;
  padding: 1.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(20, 24, 31, 0.1);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top-right-radius: 1rem;
  background: linear-gradient(225deg, #F7F5F0 0 50%, #E4572E 50% 100%);
  transition: width 0.2s ease, height 0.2s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 58, 95, 0.25);
  box-shadow: 0 12px 28px -12px rgba(31, 58, 95, 0.3);
}

.service-card:hover::after {
  width: 2.25rem;
  height: 2.25rem;
}

@media (min-width: 768px) {
  .service-card {
    padding: 2rem;
  }
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(31, 58, 95, 0.08);
  color: #1F3A5F;
}

.icon-tile svg {
  width: 1.625rem;
  height: 1.625rem;
}

.check-list {
  display: grid;
  gap: 0.625rem;
}

.check-list li {
  position: relative;
  padding-left: 1.5rem;
  color: #14181F;
  line-height: 1.55;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  background: #E4572E;
  transform: rotate(45deg);
}

/* Key facts */
.fact {
  border-left: 3px solid #E4572E;
  padding-left: 1rem;
}

.fact dt {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.fact dd {
  margin-top: 0.25rem;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
}

/* Legal dialogs */
.legal-dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  color: #14181F;
  box-shadow: 0 30px 60px -20px rgba(20, 24, 31, 0.5);
}

.legal-dialog::backdrop {
  background: rgba(20, 24, 31, 0.65);
}

.legal-dialog[open] {
  animation: dialog-in 0.2s ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.legal-dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.legal-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(20, 24, 31, 0.1);
  background: #F7F5F0;
}

.legal-dialog__body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
  line-height: 1.65;
}

.legal-dialog__body h3 {
  margin-top: 1.5rem;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1F3A5F;
}

.legal-dialog__body p {
  margin-top: 0.5rem;
}

.legal-dialog__body ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.legal-dialog__body li {
  margin-top: 0.25rem;
}

.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  color: #1F3A5F;
  background: transparent;
  border: 1px solid rgba(20, 24, 31, 0.15);
  cursor: pointer;
}

.dialog-close:hover {
  background: rgba(31, 58, 95, 0.08);
}

html.dialog-open {
  overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .service-card:hover {
    transform: none;
  }
}
