/* ==========================================================================
   mobile-app-development — graphite theme, aligned 1:1 with the main site.
   Dark --lc-* tokens and the shell recolor come from dark-shell.css (loaded
   just before this file); everything below is page-only styling.
   ========================================================================== */

/* ============================== layout ============================== */
.mad {
  font-family: var(--lc-font-text);
  color: var(--lc-ink);
}

/* reading progress bar (same idea as the home page) */
.mad-prog {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--lc-accent), var(--lc-teal));
  z-index: 60;
  pointer-events: none;
}

/* scroll-in reveal — landings.js (already loaded) toggles .is-in */
.mad .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .28, 1);
}
.mad .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* hero cascade on load */
@keyframes madUp {
  from { opacity: 0; transform: translateY(18px) }
  to { opacity: 1; transform: none }
}
.mad-hero__copy > * { animation: madUp .7s cubic-bezier(.22, .61, .28, 1) both }
.mad-hero__copy > :nth-child(2) { animation-delay: .08s }
.mad-hero__copy > :nth-child(3) { animation-delay: .18s }
.mad-hero__copy > :nth-child(4) { animation-delay: .28s }
.mad-hero__stage { animation: madUp .8s cubic-bezier(.22, .61, .28, 1) .2s both }

.mad-wrap {
  max-width: 1300px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 56px);
}
.mad section,
.mad > section { padding-block: clamp(60px, 8vw, 96px) }

.mad-mono {
  font-family: var(--lc-font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lc-ink-soft);
}
.mad-shead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--lc-line);
  padding-top: 22px;
  margin-bottom: 40px;
}
.mad-shead h2 {
  margin: 0;
  font-family: var(--lc-font-display);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.05;
  font-size: clamp(26px, 3.4vw, 46px);
  max-width: 24ch;
}

/* ============================== buttons ============================== */
.mad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 28px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 .96rem/1 var(--lc-font-text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s, background .25s, color .25s, border-color .25s;
}
.mad-btn--primary {
  background: var(--lc-accent);
  color: #0a0b0e;
}
.mad-btn--primary:hover {
  background: #ff7a52;
  color: #0a0b0e;
  transform: translateY(-2px);
}
.mad-btn--ghost {
  border-color: var(--lc-line2);
  color: var(--lc-ink);
}
.mad-btn--ghost:hover {
  border-color: var(--lc-ink);
  color: var(--lc-ink);
}
/* quiet link-style CTA next to the primary one */
.mad-btn--quiet {
  padding: 15px 10px;
  border: 0;
  font-family: var(--lc-font-mono);
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lc-ink-soft);
}
.mad-btn--quiet i {
  font-style: normal;
  transition: transform .25s;
}
.mad-btn--quiet:hover { color: var(--lc-ink) }
.mad-btn--quiet:hover i { transform: translateY(3px) }

/* ============================== hero ============================== */
.mad-hero {
  padding-top: clamp(48px, 8vh, 96px);
  padding-bottom: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
}
.mad-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(26px, 4vw, 44px);
  padding: 7px 15px;
  border: 1px solid var(--lc-line2);
  border-radius: 100px;
  font-family: var(--lc-font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lc-ink-soft);
}
.mad-tag__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lc-teal);
  flex: none;
}
.mad-hero h1 {
  margin: 0 0 clamp(22px, 3vw, 34px);
  font-family: var(--lc-font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.6vw, 76px);
  line-height: .98;
  letter-spacing: -.032em;
  max-width: 15ch;
  text-wrap: balance;
}
.mad-hero h1 em {
  font-style: normal;
  color: var(--lc-accent);
}
.mad-lead {
  margin: 0 0 clamp(26px, 3.4vw, 40px);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.62;
  color: var(--lc-ink-soft);
  max-width: 54ch;
}
.mad-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------- phone mockup --------------- */
.mad-hero__stage {
  justify-self: center;
  display: grid;
  gap: 18px;
  justify-items: center;
}
.mad-phones {
  position: relative;
  width: min(300px, 68vw);
  aspect-ratio: 3 / 4;
}
@keyframes madFloat {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-10px) }
}
.mad-phone {
  position: absolute;
  width: 62%;
  aspect-ratio: 9 / 19;
  border-radius: 26px;
  border: 1px solid var(--lc-line2);
  background: linear-gradient(160deg, #181b22 0%, #101218 60%, #0c0e13 100%);
  box-shadow: var(--lc-shadow-lift);
  padding: 10px;
  animation: madFloat 7s ease-in-out infinite;
}
.mad-phone--a {
  left: 0;
  bottom: 0;
  z-index: 2;
}
.mad-phone--b {
  right: 0;
  top: 0;
  z-index: 1;
  opacity: .85;
  animation-delay: -3.5s;
}
.mad-phone__notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 7px;
  border-radius: 100px;
  background: #05060a;
  z-index: 2;
}
.mad-phone__screen {
  height: 100%;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 94, 46, .12), transparent 55%),
    #0e1015;
  border: 1px solid var(--lc-line);
  box-shadow: inset 0 0 24px rgba(255, 94, 46, .05);
  padding: 30px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* minimal glowing UI inside the screens */
.mad-ui-bar {
  height: 8px;
  width: 46%;
  border-radius: 100px;
  background: var(--lc-accent);
  opacity: .9;
}
.mad-ui-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lc-teal);
  opacity: .8;
}
.mad-ui-line {
  height: 7px;
  width: 88%;
  border-radius: 100px;
  background: var(--lc-line2);
}
.mad-ui-line--short { width: 58% }
.mad-ui-card {
  height: 26%;
  border-radius: 10px;
  border: 1px solid var(--lc-line2);
  background: var(--lc-panel);
}
.mad-ui-btn {
  margin-top: auto;
  height: 30px;
  border-radius: 9px;
  background: var(--lc-accent);
  box-shadow: 0 6px 18px rgba(255, 94, 46, .3);
}
.mad-ui-pill {
  margin-top: auto;
  height: 24px;
  width: 70%;
  border-radius: 100px;
  border: 1px solid rgba(56, 225, 192, .4);
  background: rgba(56, 225, 192, .08);
}
.mad-hero__cap {
  margin: 0;
  font-family: var(--lc-font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lc-ink-soft);
}

/* ============================== steps ============================== */
.mad-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--lc-line);
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  overflow: hidden;
}
.mad-step {
  position: relative;
  background: var(--lc-panel);
  padding: clamp(20px, 2.2vw, 28px);
  transition: background .25s, box-shadow .25s,
    transform .45s cubic-bezier(.22, .61, .28, 1), opacity .7s ease;
}
@media (hover: hover) {
  .mad-step:hover {
    background: var(--lc-panel2);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
  }
}
/* the progress line that fills step by step as the list scrolls in */
.mad-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lc-accent), rgba(255, 94, 46, .35));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .55s cubic-bezier(.22, .61, .28, 1);
}
.mad-step.is-in::before { transform: scaleX(1) }
.mad-step:nth-child(1)::before { transition-delay: .05s }
.mad-step:nth-child(2)::before { transition-delay: .25s }
.mad-step:nth-child(3)::before { transition-delay: .45s }
.mad-step:nth-child(4)::before { transition-delay: .65s }
.mad-step__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--lc-line2);
  font-family: var(--lc-font-mono);
  font-size: 11px;
  color: var(--lc-accent);
  margin-bottom: 16px;
  transition: border-color .4s;
}
.mad-step.is-in .mad-step__n { border-color: var(--lc-accent) }
.mad-step strong {
  display: block;
  font-family: var(--lc-font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}
.mad-step p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--lc-ink-soft);
}

/* ============================== tools ============================== */
.mad-tools-sec {
  background: var(--lc-surface-3);
  border-top: 1px solid var(--lc-line);
  border-bottom: 1px solid var(--lc-line);
}
.mad-tools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}
.mad-tool {
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: var(--lc-panel);
  padding: clamp(18px, 2.2vw, 26px);
  transition: border-color .25s, background .25s,
    transform .45s cubic-bezier(.22, .61, .28, 1), opacity .7s ease;
}
@media (hover: hover) {
  .mad-tool:hover {
    border-color: var(--lc-line2);
    background: var(--lc-panel2);
    transform: translateY(-3px);
  }
}
.mad-tool strong {
  display: block;
  font-family: var(--lc-font-display);
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -.01em;
  margin-bottom: 8px;
  color: var(--lc-ink);
}
.mad-tool p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--lc-ink-soft);
}

/* ============================== fit ============================== */
.mad-fit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.mad-fit__card {
  padding: 18px 16px;
  background: var(--lc-panel);
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  transition: border-color 0.25s;
}
@media (hover: hover) {
  .mad-fit__card:hover { border-color: rgba(255, 94, 46, 0.45); }
}
.mad-fit__card h3 {
  margin: 0 0 12px;
  font-family: var(--lc-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lc-accent);
}
.mad-fit__card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.mad-fit__card li {
  position: relative;
  padding-left: 16px;
  color: var(--lc-ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}
.mad-fit__card li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--lc-accent);
}
.mad-fit__card--out {
  background: transparent;
  border-style: dashed;
  border-color: var(--lc-line2);
}
.mad-fit__card--out li::before { content: "×"; }
.mad-fit__card a {
  color: var(--lc-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mad-fit__card a:hover { color: var(--lc-accent-tint); }
.mad-fit__note {
  margin: 18px 0 0;
  font-family: var(--lc-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: var(--lc-ink-soft);
  max-width: 62ch;
}

/* ============================== faq ============================== */
.mad-faq__list {
  display: grid;
  gap: 8px;
}
.mad-faq {
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: var(--lc-panel);
  padding: 2px 20px;
  transition: border-color .2s;
}
.mad-faq[open] { border-color: var(--lc-line2) }
.mad-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-family: var(--lc-font-display);
  font-weight: 600;
  font-size: clamp(15px, 1.5vw, 18px);
  letter-spacing: -.01em;
}
.mad-faq summary::-webkit-details-marker { display: none }
.mad-faq summary::after {
  content: '+';
  font-family: var(--lc-font-mono);
  font-size: 1.25rem;
  color: var(--lc-accent);
  line-height: 1;
  flex: none;
  transition: transform .28s cubic-bezier(.22, .61, .28, 1);
}
.mad-faq[open] summary::after { transform: rotate(45deg) }
.mad-faq__body {
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.22, .61, .28, 1), opacity .3s ease;
}
.mad-faq p {
  margin: 0 0 20px;
  max-width: 80ch;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--lc-ink-soft);
}
.mad-faq__link { margin-top: -12px }
.mad-faq__link a {
  font-family: var(--lc-font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--lc-accent);
  text-decoration: none;
}
.mad-faq__link a:hover { text-decoration: underline }

/* ============================== final ============================== */
.mad-end {
  border-top: 1px solid var(--lc-line);
  background:
    radial-gradient(760px 320px at 82% 18%, rgba(255, 94, 46, .14), transparent 62%),
    var(--lc-surface-3);
}
.mad-end h2 {
  margin: 0 0 18px;
  font-family: var(--lc-font-display);
  font-weight: 600;
  font-size: clamp(28px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -.03em;
  max-width: 20ch;
}
.mad-end h2 em {
  font-style: normal;
  color: var(--lc-accent);
}
.mad-end__lead {
  margin: 0 0 32px;
  max-width: 58ch;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.62;
  color: var(--lc-ink-soft);
}
.mad-end__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.mad-end__note {
  display: block;
  margin: 26px 0 0;
}
.mad-more {
  margin-top: clamp(34px, 5vw, 54px);
  border-top: 1px dashed var(--lc-line2);
  padding-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.mad-more__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mad-more__link {
  font-family: var(--lc-font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--lc-ink-soft);
  border: 1px solid var(--lc-line2);
  border-radius: 100px;
  padding: 7px 13px;
  text-decoration: none;
  transition: .25s;
}
.mad-more__link:hover {
  border-color: var(--lc-teal);
  color: var(--lc-teal);
}

/* ============================== responsive ============================== */
@media (max-width: 1080px) {
  .mad-steps { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .mad-tools { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .mad-fit { grid-template-columns: 1fr }
}
@media (max-width: 900px) {
  .mad-hero { grid-template-columns: 1fr }
  .mad-hero__stage { margin-top: 8px }
}
@media (max-width: 620px) {
  .mad-steps,
  .mad-tools { grid-template-columns: 1fr }
  .mad-hero h1 { font-size: clamp(32px, 9vw, 44px) }
  .mad-phones { width: min(240px, 74vw) }
}
@media (prefers-reduced-motion: reduce) {
  .mad-btn,
  .mad-faq summary::after,
  .mad-faq__body,
  .mad-step,
  .mad-step::before,
  .mad-step__n,
  .mad-tool { transition: none }
  .mad-hero__copy > *,
  .mad-hero__stage,
  .mad-phone { animation: none }
  .mad .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .mad-step::before { transform: scaleX(1) }
}
