:root {
  --body: #0a101e;
  --panel: #070d1b;
  --panel-soft: #101624;
  --border: #232935;
  --line: #3f4551;
  --text: #fdfeff;
  --muted: #a9adb8;
  --accent: #fec544;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--body);
  color: var(--muted);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 16% 18%, rgba(254, 197, 68, 0.1), transparent 24%),
    radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.08), transparent 20%),
    radial-gradient(circle at 72% 82%, rgba(254, 197, 68, 0.08), transparent 25%);
  content: "";
  opacity: 0.85;
  animation: ambientShift 14s ease-in-out infinite alternate;
}

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

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 18, 30, 0.7);
  padding: 0 clamp(18px, 5vw, 70px);
  backdrop-filter: blur(12px);
  animation: slideDown 0.7s ease both;
  transition: min-height 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.topbar.is-scrolled {
  min-height: 66px;
  background: rgba(13, 18, 30, 0.88);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.logo {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

nav {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  overflow-x: auto;
  text-transform: uppercase;
}

nav a {
  position: relative;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease;
}

nav a::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

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

nav a:hover::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--panel);
  padding-top: 78px;
  text-align: center;
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: url("assets/farley-hero.jpg") center / cover;
  pointer-events: none;
}

.hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.78vh);
  height: max(56.25vw, 100vh);
  border: 0;
  transform: translate(-50%, calc(-50% + var(--hero-drift, 0px))) scale(1.08);
  transition: transform 0.18s linear;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(254, 197, 68, 0.15), transparent 34%),
    linear-gradient(rgba(7, 13, 27, 0.38), rgba(7, 13, 27, 0.76));
  animation: overlayPulse 9s ease-in-out infinite alternate;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100% - 36px));
  padding: 70px 0 125px;
  animation: fadeRise 0.9s ease 0.15s both;
  transform: translateY(var(--hero-copy-drift, 0px));
  transition: transform 0.18s linear;
}

.image-panel {
  position: relative;
}

.image-panel::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(254, 197, 68, 0.18), transparent 80%);
  content: "";
  transform: translateX(-120%);
  transition: transform 0.95s ease;
  pointer-events: none;
}

.image-panel.is-visible::after {
  transform: translateX(120%);
}

.image-panel img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 1.2s ease;
}

.image-panel.is-visible img {
  filter: saturate(1.04);
  transform: scale(1);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 28px;
  color: var(--text);
  font-size: clamp(42px, 6vw, 60px);
  font-weight: 600;
  line-height: 1.15;
}

h1 span {
  display: inline-block;
  animation: accentGlow 4s ease-in-out infinite;
}

h1 span,
.text-block h4,
aside span {
  color: var(--accent);
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.65;
}

.hero-copy p {
  margin: 0;
}

.hero-copy p + p {
  margin-top: 4px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.btn,
button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 50px;
  background: var(--accent);
  color: var(--panel);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 0 28px;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn::before,
button::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -55%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: left 0.45s ease;
}

.btn:hover::before,
button:hover::before {
  left: 120%;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

.btn:hover,
button:hover,
.btn-outline:hover {
  background: transparent;
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--panel);
}

.wave {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  z-index: 1;
  width: 100%;
  fill: var(--body);
  animation: waveFloat 6s ease-in-out infinite alternate;
}

.section {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0 0;
}

.reveal,
.reveal-item {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.75s ease,
    transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.75s ease;
  transition-delay: var(--reveal-delay, 0ms);
  filter: blur(4px);
  will-change: opacity, transform;
}

.reveal.is-visible,
.reveal-item.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.gallery-grid .reveal-item:nth-child(3n + 1) {
  transform: translate(-22px, 34px);
}

.gallery-grid .reveal-item:nth-child(3n + 3) {
  transform: translate(22px, 34px);
}

.gallery-grid .reveal-item.is-visible {
  transform: translate(0, 0);
}

.section-heading {
  position: relative;
  margin-bottom: 58px;
  text-align: center;
}

.section-heading span {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 100%;
  color: rgba(21, 27, 41, 0.62);
  font-size: clamp(54px, 8vw, 90px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible .section-heading span {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.section-heading h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--accent);
  font-size: 24px;
  font-weight: 500;
  text-transform: uppercase;
}

.section-heading h2::before,
.section-heading h2::after {
  position: absolute;
  bottom: -16px;
  left: 50%;
  height: 2px;
  content: "";
  transform: translateX(-50%);
}

.section-heading h2::before {
  width: 170px;
  background: var(--line);
}

.section-heading h2::after {
  width: 70px;
  background: var(--accent);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.65s ease 0.16s;
}

.reveal.is-visible .section-heading h2::after {
  transform: translateX(-50%) scaleX(1);
}

.about-grid,
.timeline-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  align-items: center;
}

.image-panel {
  min-height: 550px;
  overflow: hidden;
  background: var(--panel);
}

.text-block h3,
.timeline h3,
form h3,
aside h3 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.25;
}

.text-block h4 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 300;
}

.text-block p,
.timeline p,
.gallery-grid p,
aside p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.text-block p {
  margin: 0 0 16px;
}

.details {
  display: grid;
  gap: 14px;
  margin: 26px 0 0;
}

.details div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.text-block.is-visible .details div,
.reveal.is-visible .details div {
  opacity: 1;
  transform: translateX(0);
}

.details div:nth-child(2) {
  transition-delay: 90ms;
}

.details div:nth-child(3) {
  transition-delay: 180ms;
}

.details div:nth-child(4) {
  transition-delay: 270ms;
}

.details dt {
  color: var(--text);
}

.details dd {
  margin: 0;
}

.gallery-carousel {
  position: relative;
}

.gallery-grid {
  display: grid;
  grid-auto-columns: minmax(280px, 32%);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-grid::-webkit-scrollbar {
  display: none;
}

.services-intro {
  width: min(860px, 100%);
  margin: -16px auto 34px;
  text-align: center;
}

.services-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.timeline,
.gallery-card,
form,
aside {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel-soft);
}

.partner-network {
  width: min(900px, 100%);
  margin: 26px auto 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(16, 22, 36, 0.68);
  padding: 24px 28px;
}

.partner-network h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
  font-weight: 400;
}

.partner-network > p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.partner-network a {
  color: var(--text);
  text-decoration-color: rgba(254, 197, 68, 0.55);
  text-underline-offset: 4px;
}

.services-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(0, 1.14fr);
  gap: 22px;
  width: min(980px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 3px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 34%),
    var(--panel-soft);
  padding: clamp(18px, 3vw, 28px);
}

.service-tabs {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.service-tab {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(7, 13, 27, 0.58);
  color: var(--muted);
  font-size: 13px;
  padding: 0 16px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.service-tab::before {
  display: none;
}

.service-tab:hover,
.service-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--panel);
  transform: translateY(-1px);
}

.service-description {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(254, 197, 68, 0.22);
  border-radius: 3px;
  background:
    linear-gradient(rgba(7, 13, 27, 0.76), rgba(7, 13, 27, 0.92)),
    url("assets/farley-hero.jpg") center / cover;
  padding: clamp(28px, 4vw, 42px);
}

.service-description::after {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--accent);
  content: "";
}

.service-description span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.service-description h3 {
  margin: 18px 0 14px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.15;
}

.service-description p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.service-description.is-changing {
  animation: serviceSwap 0.36s ease;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-card:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  transform: translateY(-3px);
}

.gallery-card figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  aspect-ratio: 4 / 5;
  background: var(--panel);
}

.gallery-card figure::after {
  display: none;
}

.gallery-card img,
.gallery-card video {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.gallery-card video {
  background: #000;
}

.gallery-card:hover img,
.gallery-card:hover video {
  filter: saturate(1.08);
  transform: scale(1.04);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(7, 13, 27, 0.84);
  color: var(--text);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  transform: translateY(-50%);
}

.gallery-arrow::before {
  display: none;
}

.gallery-arrow:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--panel);
}

.gallery-arrow span {
  display: block;
  margin-top: -3px;
  font-size: 42px;
  line-height: 1;
}

.gallery-arrow-prev {
  left: -24px;
}

.gallery-arrow-next {
  right: -24px;
}

.timeline {
  align-self: stretch;
  padding: 36px;
}

.timeline-item {
  position: relative;
  padding: 0 0 30px 28px;
  border-left: 1px solid var(--border);
}

.timeline-item::before {
  position: absolute;
  top: 4px;
  left: -7px;
  height: 13px;
  width: 13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--panel-soft);
  content: "";
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  font-weight: 400;
}

.timeline small {
  display: block;
  margin: 8px 0 12px;
  color: var(--accent);
}

.resume-showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
  gap: 44px;
  align-items: center;
}

.resume-showcase + .gallery-grid {
  margin-top: 48px;
}

.resume-intro {
  border: 1px solid var(--border);
  border-radius: 3px;
  background:
    linear-gradient(rgba(16, 22, 36, 0.88), rgba(16, 22, 36, 0.96)),
    url("assets/farley-hero.jpg") center / cover;
  padding: 38px;
}

.resume-intro h3,
.video-scroll h3 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
}

.resume-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.video-device {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(254, 197, 68, 0.24);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 20%),
    #050915;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  padding: 14px;
  transform: perspective(900px) rotateX(0deg) rotateY(0deg);
  transition: transform 0.7s ease, box-shadow 0.7s ease;
}

.video-device.is-visible {
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
}

.video-device::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  content: "";
  pointer-events: none;
}

.device-top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px 14px;
}

.device-top span {
  display: block;
  height: 6px;
  width: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.device-top strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.device-top small {
  color: var(--accent);
  font-size: 12px;
}

.video-scroll {
  position: relative;
  z-index: 1;
  display: grid;
  max-height: min(680px, 76vh);
  gap: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 10px 12px;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.video-scroll h3 {
  position: sticky;
  top: -22px;
  z-index: 3;
  margin: 0;
  border-bottom: 1px solid rgba(254, 197, 68, 0.18);
  background: rgba(5, 9, 21, 0.92);
  color: var(--accent);
  font-size: 18px;
  padding: 12px 4px;
  backdrop-filter: blur(10px);
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.video-card iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px 14px;
}

.contact {
  padding-bottom: 90px;
}

.contact-grid {
  align-items: start;
}

form,
aside {
  padding: 34px;
}

form {
  display: grid;
  gap: 16px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 14px 18px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
}

button {
  width: max-content;
}

aside p {
  margin: 0 0 18px;
}

aside a {
  color: var(--text);
  text-decoration-color: rgba(254, 197, 68, 0.55);
  text-underline-offset: 4px;
}

aside span {
  display: block;
  margin-bottom: 5px;
}

footer {
  border-top: 1px solid var(--border);
  padding: 30px 24px;
  text-align: center;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.05) translate3d(-1%, -1%, 0);
  }
  to {
    transform: scale(1.1) translate3d(1%, 1%, 0);
  }
}

@keyframes overlayPulse {
  from {
    opacity: 0.82;
  }
  to {
    opacity: 0.92;
  }
}

@keyframes ambientShift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -24px, 0);
  }
}

@keyframes accentGlow {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(254, 197, 68, 0);
  }
  50% {
    text-shadow: 0 0 24px rgba(254, 197, 68, 0.34);
  }
}

@keyframes waveFloat {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(10px);
  }
}

@keyframes serviceSwap {
  0% {
    opacity: 0.72;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal-item {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  nav {
    width: 100%;
  }

  .hero {
    padding-top: 112px;
  }

  .about-grid,
  .timeline-grid,
  .resume-showcase,
  .contact-grid,
  .services-panel {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-auto-columns: minmax(260px, 72%);
  }

  .video-scroll {
    max-height: 620px;
  }

  .section-heading span {
    display: none;
  }

  .image-panel {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .section {
    width: calc(100% - 32px);
  }

  .hero-copy {
    font-size: 16px;
  }

  .text-block h3,
  .timeline h3,
  .resume-intro h3,
  form h3,
  aside h3 {
    font-size: 28px;
  }

  .resume-intro {
    padding: 28px;
  }

  .video-device {
    border-radius: 20px;
    padding: 10px;
  }

  .device-top {
    grid-template-columns: 38px 1fr;
  }

  .device-top small {
    display: none;
  }

  .video-scroll {
    max-height: 560px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .gallery-grid {
    grid-auto-columns: 86%;
    padding-bottom: 14px;
  }

  .gallery-arrow {
    width: 42px;
    height: 42px;
  }

  .gallery-arrow-prev {
    left: -10px;
  }

  .gallery-arrow-next {
    right: -10px;
  }
}
