:root {
  --blue-900: #0f2d6b;
  --blue-800: #173f93;
  --blue-700: #204ba8;
  --blue-100: #eaf1ff;
  --coral-600: #ff5b5f;
  --coral-100: #fff0f0;
  --teal-600: #0d9488;
  --green-100: #e8f7ef;
  --ink: #102033;
  --muted: #607086;
  --line: #dce4ef;
  --surface: #ffffff;
  --soft: #f5f8fc;
  --dark: #071527;
  --shadow: 0 18px 50px rgba(15, 45, 107, 0.14);
  --radius: 8px;
  --shell: min(1120px, calc(100% - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  letter-spacing: 0;
}

body.nav-open {
  overflow: hidden;
}

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

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

p,
h1,
h2,
h3 {
  margin-top: 0;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  max-width: 860px;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

h3 {
  font-size: 1.15rem;
}

address {
  color: var(--muted);
  font-style: normal;
  line-height: 1.8;
}

address a {
  color: inherit;
}

input,
select,
textarea,
button {
  font: inherit;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 999;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  clip: auto;
  color: var(--surface);
  background: var(--blue-800);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 12px 32px rgba(16, 32, 51, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--blue-900);
}

.brand img,
.footer-brand img {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
}

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

.nav-links a {
  padding: 10px 14px;
  color: #2f4058;
  font-weight: 700;
  border-radius: var(--radius);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--blue-800);
  background: var(--blue-100);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle-line {
  width: 20px;
  height: 2px;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: calc(100vh - 82px);
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-items: center;
  padding: 90px 0 130px;
  background:
    linear-gradient(90deg, rgba(7, 21, 39, 0.86), rgba(7, 21, 39, 0.64)),
    url("../images/appelation-logo.png") center right 10% / min(44vw, 520px) no-repeat,
    var(--dark);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 86px;
  background: var(--surface);
  clip-path: polygon(0 48%, 100% 0, 100% 100%, 0 100%);
  z-index: -1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.hero .eyebrow,
.hero h1,
.hero-copy {
  color: var(--surface);
}

.hero-copy {
  max-width: 660px;
  font-size: 1.13rem;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--coral-600);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-actions,
.section-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.btn-primary {
  color: var(--surface);
  background: var(--coral-600);
  box-shadow: 0 14px 34px rgba(255, 91, 95, 0.28);
}

.btn-primary:hover {
  background: #ec4349;
}

.btn-ghost {
  color: var(--blue-900);
  background: var(--surface);
  border-color: var(--line);
}

.hero .btn-ghost {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.32);
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--blue-800);
  font-weight: 800;
}

.text-link::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.media-grid {
  position: absolute;
  right: max(28px, calc((100vw - 1120px) / 2));
  bottom: 88px;
  width: min(470px, 42vw);
  height: 460px;
}

.phone-frame,
.signal-panel,
.device-mock {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.phone-frame {
  position: absolute;
  width: 178px;
  height: 330px;
  padding: 18px;
  color: var(--surface);
  background: #101c2f;
  border-radius: 30px;
}

.phone-primary {
  right: 180px;
  bottom: 24px;
}

.phone-secondary {
  right: 38px;
  bottom: 88px;
  background: #122b5d;
}

.phone-bar,
.mock-status {
  width: 56px;
  height: 6px;
  margin: 0 auto 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.screen-title {
  margin-bottom: 22px;
  font-weight: 800;
}

.remote-pad {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  justify-content: center;
  gap: 9px;
}

.remote-pad span,
.screen-actions span,
.backup-stack span,
.mock-buttons span,
.mock-list span {
  display: block;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
}

.remote-pad span {
  height: 38px;
}

.remote-pad span:nth-child(2) {
  background: var(--coral-600);
}

.screen-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 28px;
}

.screen-actions span {
  height: 36px;
}

.backup-stack {
  display: grid;
  gap: 12px;
}

.backup-stack span {
  height: 52px;
}

.backup-stack span:nth-child(2) {
  background: rgba(13, 148, 136, 0.52);
}

.signal-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 210px;
  padding: 20px;
  color: var(--surface);
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
}

.signal-panel img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.signal-panel p,
.signal-panel strong {
  color: var(--surface);
}

.signal-panel p {
  margin-bottom: 8px;
}

.stats-band {
  margin-top: -62px;
  position: relative;
  z-index: 3;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats-grid div {
  padding: 26px;
  background: var(--surface);
}

.stats-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--blue-900);
  font-size: 1.35rem;
}

.stats-grid span {
  color: var(--muted);
}

.section {
  padding: 96px 0;
}

.section-soft {
  background: var(--soft);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 40px;
}

.section-heading p:last-child,
.page-hero p {
  font-size: 1.08rem;
}

.service-grid,
.app-grid,
.value-grid {
  display: grid;
  gap: 18px;
}

.service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card,
.app-card,
.story-card,
.contact-panel,
.contact-form,
.cta-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.service-card {
  padding: 28px;
}

.service-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--surface);
  background: var(--blue-800);
  border-radius: var(--radius);
  font-weight: 900;
  font-size: 0.82rem;
}

.service-card:nth-child(2n) .service-icon {
  background: var(--coral-600);
}

.service-card:nth-child(3n) .service-icon {
  background: var(--teal-600);
}

.preview-grid .service-card {
  box-shadow: 0 16px 42px rgba(16, 32, 51, 0.08);
}

.app-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-card {
  min-height: 100%;
  overflow: hidden;
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: var(--surface);
  font-weight: 900;
  font-size: 2rem;
  background: var(--blue-800);
}

.app-icon-recover {
  background: var(--coral-600);
}

.app-icon-qr {
  background: var(--teal-600);
}

.app-card-body {
  padding: 24px;
}

.app-meta {
  margin-bottom: 10px;
  color: var(--coral-600);
  font-weight: 800;
  font-size: 0.84rem;
}

.split-section,
.process-grid,
.contact-layout,
.story-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.feature-list,
.timeline {
  display: grid;
  gap: 18px;
}

.feature-list div,
.timeline div {
  padding: 24px;
  border-left: 4px solid var(--blue-800);
  background: var(--surface);
  border-radius: var(--radius);
}

.feature-list div:nth-child(2),
.timeline div:nth-child(2) {
  border-color: var(--coral-600);
}

.feature-list div:nth-child(3),
.timeline div:nth-child(3) {
  border-color: var(--teal-600);
}

.page-hero {
  padding: 92px 0 38px;
}

.page-hero h1 {
  color: var(--blue-900);
}

.page-hero .btn {
  margin-top: 16px;
}

.timeline span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue-900);
  font-weight: 900;
}

.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 36px;
}

.cta-panel p {
  margin-bottom: 0;
}

.apps-list {
  display: grid;
  gap: 28px;
}

.portfolio-app {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 34px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(16, 32, 51, 0.08);
}

.portfolio-app-reverse {
  grid-template-columns: 1.18fr 0.82fr;
}

.portfolio-app-reverse .app-showcase {
  order: 2;
}

.portfolio-copy {
  align-self: center;
  padding: 24px;
}

.app-showcase {
  display: grid;
  min-height: 360px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue-100);
}

.app-showcase-recover {
  background: var(--coral-100);
}

.app-showcase-qr {
  background: var(--green-100);
}

.device-mock {
  width: 190px;
  min-height: 320px;
  padding: 18px;
  color: var(--surface);
  background: #101c2f;
  border-radius: 28px;
}

.device-mock strong {
  display: block;
  margin-bottom: 20px;
}

.mock-circle {
  width: 112px;
  height: 112px;
  margin: 0 auto 26px;
  border: 18px solid var(--coral-600);
  border-radius: 50%;
}

.mock-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mock-buttons span,
.mock-list span {
  height: 38px;
}

.mock-list {
  display: grid;
  gap: 11px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
}

.qr-grid span {
  aspect-ratio: 1;
  background: var(--dark);
}

.qr-grid span:nth-child(2),
.qr-grid span:nth-child(4),
.qr-grid span:nth-child(8) {
  background: transparent;
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  color: #33465e;
  line-height: 1.55;
}

.check-list li::before {
  content: "";
  position: absolute;
  top: 0.48em;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--teal-600);
  border-radius: 50%;
}

.story-layout {
  align-items: center;
}

.story-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 46px;
  text-align: center;
  box-shadow: var(--shadow);
}

.story-card img {
  width: 132px;
  border-radius: 24px;
}

.story-card strong {
  color: var(--blue-900);
  font-size: 1.4rem;
}

.story-card span {
  color: var(--muted);
}

.value-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
}

.value-grid div {
  padding: 22px;
  background: var(--soft);
  border-radius: var(--radius);
}

.value-grid h2 {
  font-size: 1.1rem;
}

.contact-layout {
  grid-template-columns: 0.78fr 1.22fr;
}

.contact-panel,
.contact-form {
  padding: 30px;
}

.contact-panel address {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.contact-panel address a,
.contact-socials a,
.social-links a {
  color: var(--blue-800);
  font-weight: 800;
}

.contact-socials,
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.contact-form,
.form-grid {
  display: grid;
  gap: 18px;
}

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

label span {
  display: block;
  margin-bottom: 8px;
  color: #33465e;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-800);
  box-shadow: 0 0 0 4px rgba(32, 75, 168, 0.12);
}

.form-note {
  margin: 0;
  font-size: 0.93rem;
}

.site-footer {
  padding: 56px 0 24px;
  color: #c7d2e3;
  background: var(--dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr;
  gap: 36px;
}

.footer-brand,
.site-footer h2,
.site-footer a {
  color: var(--surface);
}

.site-footer h2 {
  font-size: 1rem;
}

.site-footer p,
.site-footer address {
  color: #aebbd0;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  margin-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #aebbd0;
}

@media (max-width: 980px) {
  h1 {
    font-size: clamp(2.25rem, 9vw, 4.2rem);
  }

  .media-grid {
    opacity: 0.28;
    right: 20px;
    width: 58vw;
  }

  .service-grid,
  .app-grid,
  .stats-grid,
  .value-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .split-section,
  .process-grid,
  .contact-layout,
  .story-layout,
  .portfolio-app,
  .portfolio-app-reverse {
    grid-template-columns: 1fr;
  }

  .portfolio-app-reverse .app-showcase {
    order: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --shell: min(100% - 28px, 1120px);
  }

  .nav {
    min-height: 72px;
  }

  .brand span {
    max-width: 180px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    inset: 72px 14px auto;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: grid;
  }

  .nav-links a {
    padding: 14px;
  }

  .hero {
    min-height: auto;
    padding: 72px 0 110px;
    background:
      linear-gradient(90deg, rgba(7, 21, 39, 0.9), rgba(7, 21, 39, 0.7)),
      url("../images/appelation-logo.png") center right -80px / 310px no-repeat,
      var(--dark);
  }

  .hero-media {
    display: none;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .stats-band {
    margin-top: -38px;
  }

  .stats-grid,
  .service-grid,
  .app-grid,
  .value-grid,
  .footer-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 68px 0;
  }

  .page-hero {
    padding: 66px 0 24px;
  }

  .cta-panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 26px;
  }

  .portfolio-app {
    padding: 14px;
  }

  .portfolio-copy {
    padding: 10px 4px 8px;
  }

  .app-showcase {
    min-height: 310px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .brand img,
  .footer-brand img {
    width: 40px;
    height: 40px;
  }

  .brand span {
    max-width: 142px;
    font-size: 0.95rem;
  }

  .hero-actions,
  .section-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .service-card,
  .app-card-body,
  .contact-panel,
  .contact-form,
  .story-card {
    padding: 22px;
  }
}

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