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

html {
  scroll-behavior: smooth;
}

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

  .reveal,
  .card-hover {
    transition: none !important;
  }
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

:focus-visible {
  outline: 2px solid #e0a23a;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: #0b1f3a;
  color: #fafafa;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}

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

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #52525b;
}

/* Content is visible by default; animations only when JS runs */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

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

noscript .reveal {
  opacity: 1 !important;
  transform: none !important;
}

.reveal.d1 {
  transition-delay: 0.07s;
}

.reveal.d2 {
  transition-delay: 0.14s;
}

.reveal.d3 {
  transition-delay: 0.21s;
}

.reveal.d4 {
  transition-delay: 0.28s;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-link[aria-current="page"] {
  font-weight: 600;
  color: #0b1f3a;
}

.dark .nav-link[aria-current="page"] {
  color: #fafafa;
}

.card-hover {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s ease, box-shadow 0.28s ease;
}

.card-hover:hover {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .card-hover:hover {
    transform: none;
  }
}

.tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.btn-primary {
  transition: background-color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover {
    transform: none;
  }
}

.diagram-grid {
  background-image: linear-gradient(#e4e4e7 1px, transparent 1px),
    linear-gradient(90deg, #e4e4e7 1px, transparent 1px);
  background-size: 24px 24px;
}

.dark .diagram-grid {
  background-image: linear-gradient(#27272a 1px, transparent 1px),
    linear-gradient(90deg, #27272a 1px, transparent 1px);
}

[x-cloak] {
  display: none !important;
}

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

.browser-frame {
  border-radius: 0.75rem;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(11, 31, 58, 0.08);
  position: relative;
}

.dark .browser-frame {
  border-color: #3f3f46;
  background: #18181b;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid #e4e4e7;
  background: #f4f4f5;
}

.dark .browser-chrome {
  border-color: #3f3f46;
  background: #27272a;
}

.browser-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #d4d4d8;
}

.dark .browser-dot {
  background: #52525b;
}

.browser-url {
  flex: 1;
  margin-left: 0.5rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .browser-url {
  background: #09090b;
  border-color: #3f3f46;
  color: #a1a1aa;
}

.browser-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}

.browser-viewport {
  position: relative;
  isolation: isolate;
}

.browser-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(11, 31, 58, 0.06) 100%
  );
}

.dark .browser-viewport::after {
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(0, 0, 0, 0.18) 100%
  );
}

.browser-frame img.thumb-amred {
  object-position: center 20%;
}

.contact-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #e4e4e7;
  margin-bottom: 0.375rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid #3f3f46;
  background: rgba(255, 255, 255, 0.06);
  color: #fafafa;
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #71717a;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #e0a23a;
  background: rgba(255, 255, 255, 0.09);
}

.contact-form textarea {
  min-height: 7rem;
  resize: vertical;
}

/* Direct line — phone pulse */
.phone-pulse {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
}

.phone-pulse-core {
  position: relative;
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: #0b1f3a;
  color: #e0a23a;
}

.dark .phone-pulse-core {
  background: #e0a23a;
  color: #0b1f3a;
}

.phone-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1.5px solid rgba(224, 162, 58, 0.55);
  animation: phone-ring 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.phone-pulse-ring.delay {
  animation-delay: 1.2s;
}

@keyframes phone-ring {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.phone-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.direct-line {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.direct-line:hover {
  border-color: rgba(224, 162, 58, 0.45);
  box-shadow: 0 12px 40px -24px rgba(11, 31, 58, 0.35);
}

.dark .direct-line:hover {
  box-shadow: 0 12px 40px -24px rgba(0, 0, 0, 0.65);
}

@media (prefers-reduced-motion: reduce) {
  .phone-pulse-ring {
    animation: none;
    opacity: 0.35;
    transform: scale(1.15);
  }

  .direct-line:hover {
    box-shadow: none;
  }
}
