/* Services magazine editorial — Tkan Studio
   Coral #FF3D2E · Unbounded / Lora / Manrope · cinematic heroes, not SaaS cards */

body.smag {
  --smag-ink: #0b0b0b;
  --smag-paper: #f3f1ef;
  --smag-muted: #5c5854;
  --smag-line: rgba(11, 11, 11, 0.12);
  --smag-accent: #ff3d2e;
  --smag-accent-soft: rgba(255, 61, 46, 0.14);
  --smag-max: 1180px;
  --smag-display: Unbounded, Manrope, sans-serif;
  --smag-serif: Lora, Georgia, "Times New Roman", serif;
  --smag-body: Manrope, sans-serif;
  --smag-mono: "JetBrains Mono", ui-monospace, monospace;
  background:
    radial-gradient(90% 60% at 12% -10%, rgba(255, 61, 46, 0.07), transparent 55%),
    radial-gradient(70% 50% at 100% 8%, rgba(20, 24, 32, 0.06), transparent 50%),
    var(--smag-paper);
  color: var(--smag-ink);
  font-family: var(--smag-body);
}

body.smag .sp-wrap {
  max-width: none;
  padding: 0;
  margin: 0;
}

.smag-shell {
  width: min(100% - 40px, var(--smag-max));
  margin-inline: auto;
}

/* —— Full-bleed cinematic hero ——
   Never use raw UI case screenshots here: ghost type fights the headline.
   Media = atmospheric photo/illustration; veil keeps type readable. */
.smag-hero {
  position: relative;
  min-height: min(90vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f7f5f2;
  background:
    radial-gradient(70% 55% at 78% 12%, rgba(255, 61, 46, 0.28), transparent 55%),
    radial-gradient(55% 45% at 8% 80%, rgba(255, 61, 46, 0.08), transparent 50%),
    #0b0b0b;
  isolation: isolate;
}

.smag-hero--compact {
  min-height: min(68vh, 580px);
}

.smag-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.smag-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.08);
  transform-origin: 50% 40%;
  filter: saturate(0.92) brightness(0.72);
  will-change: transform;
}

/* Soft wash only — never leave sharp UI copy readable behind headlines */
.smag-hero__media--wash img {
  filter: blur(14px) saturate(0.85) brightness(0.55);
  transform: scale(1.22);
  transform-origin: 50% 45%;
}

.smag-hero.is-in .smag-hero__media img {
  animation: smag-ken 20s ease-out forwards;
}

.smag-hero.is-in .smag-hero__media--wash img {
  animation: smag-ken-wash 22s ease-out forwards;
}

@keyframes smag-ken {
  from { transform: scale(1.08) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1%, -0.6%, 0); }
}

@keyframes smag-ken-wash {
  from { transform: scale(1.22) translate3d(0, 0, 0); }
  to { transform: scale(1.3) translate3d(-0.8%, -0.5%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .smag-hero.is-in .smag-hero__media img,
  .smag-hero.is-in .smag-hero__media--wash img {
    animation: none;
    transform: scale(1.1);
  }
}

.smag-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(8, 8, 8, 0.88) 0%, rgba(8, 8, 8, 0.55) 46%, rgba(8, 8, 8, 0.42) 100%),
    linear-gradient(180deg, rgba(8, 8, 8, 0.55) 0%, rgba(8, 8, 8, 0.28) 38%, rgba(8, 8, 8, 0.94) 100%),
    radial-gradient(70% 60% at 82% 18%, rgba(255, 61, 46, 0.2), transparent 62%);
  pointer-events: none;
}

.smag-hero__inner {
  position: relative;
  z-index: 2;
  width: min(100% - 40px, var(--smag-max));
  margin: 0 auto;
  padding: 132px 0 64px;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}

.smag-crumbs {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(247, 245, 242, 0.62);
}

.smag-crumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.smag-crumbs a:hover {
  color: #fff;
  border-bottom-color: var(--smag-accent);
}

.smag-crumbs li + li::before {
  content: "·";
  margin-right: 8px;
  opacity: 0.5;
}

.smag-brand {
  margin: 0 0 22px;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4.6vw, 2.85rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.smag-brand span {
  color: var(--smag-accent);
}

.smag-kicker {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 245, 242, 0.62);
}

.smag-title {
  margin: 0 0 22px;
  max-width: 14ch;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(2.35rem, 6.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: #fff;
}

.smag-deck {
  margin: 0;
  max-width: 36ch;
  font-family: var(--smag-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.5;
  color: rgba(247, 245, 242, 0.9);
}

.smag-ladder {
  margin: 32px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-family: var(--smag-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(247, 245, 242, 0.78);
}

.smag-ladder strong {
  color: #fff;
  font-weight: 500;
}

.smag-price {
  margin: 22px 0 0;
  font-family: var(--smag-mono);
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(247, 245, 242, 0.85);
}

.smag-price strong {
  color: #fff;
  font-weight: 500;
}

/* —— Magazine sections —— */
.smag-section {
  padding: 88px 0;
}

.smag-section--tight {
  padding: 56px 0 72px;
}

.smag-section__head {
  margin: 0 0 36px;
  max-width: 34ch;
}

.smag-section__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smag-muted);
}

.smag-section__title {
  margin: 0 0 12px;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.smag-section__lead {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--smag-muted);
}

/* Folio contents — editorial rows, not cards */
.smag-folio {
  border-top: 1px solid var(--smag-line);
}

.smag-folio__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 18px 24px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--smag-line);
  text-decoration: none;
  color: inherit;
  transition: color 0.25s ease;
}

.smag-folio__row:hover {
  color: var(--smag-accent);
}

.smag-folio__row:hover .smag-folio__line {
  background: var(--smag-accent);
}

.smag-folio__num {
  font-family: var(--smag-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--smag-muted);
}

.smag-folio__copy h2 {
  margin: 0 0 8px;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.smag-folio__copy p {
  margin: 0;
  max-width: 54ch;
  color: var(--smag-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.smag-folio__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 7.5rem;
  font-family: var(--smag-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--smag-muted);
  text-align: right;
}

.smag-folio__line {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--smag-line);
  transition: background 0.25s ease, width 0.35s ease;
}

.smag-folio__row:hover .smag-folio__line {
  width: 72px;
}

/* Pull quote */
.smag-pull {
  margin: 0;
  padding: 8px 0 8px 22px;
  border-left: 3px solid var(--smag-accent);
  font-family: var(--smag-serif);
  font-style: italic;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--smag-ink);
  max-width: 22ch;
}

.smag-pull footer {
  margin-top: 14px;
  font-family: var(--smag-body);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--smag-muted);
}

/* Big facts / ladder strip */
.smag-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--smag-line);
  border: 1px solid var(--smag-line);
}

.smag-fact {
  background: #fff;
  padding: 28px 22px 26px;
}

.smag-fact__n {
  margin: 0 0 8px;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--smag-accent);
}

.smag-fact__l {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--smag-muted);
}

/* Chapter divider — atmosphere, not a second article of UI type */
.smag-chapter {
  position: relative;
  min-height: clamp(260px, 40vw, 400px);
  overflow: hidden;
  background: #111;
  color: #fff;
  isolation: isolate;
}

.smag-chapter__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.smag-chapter__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  opacity: 0.85;
  transform: scale(1.06);
  filter: saturate(0.9) brightness(0.7);
}

.smag-chapter__media--wash img {
  filter: blur(12px) saturate(0.8) brightness(0.5);
  transform: scale(1.2);
  opacity: 1;
}

.smag-chapter.is-in .smag-chapter__media img {
  animation: smag-ken 22s ease-out forwards;
}

.smag-chapter.is-in .smag-chapter__media--wash img {
  animation: smag-ken-wash 24s ease-out forwards;
}

.smag-chapter__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.88) 6%, rgba(8, 8, 8, 0.45) 55%, rgba(8, 8, 8, 0.55) 100%),
    linear-gradient(180deg, rgba(8, 8, 8, 0.2), rgba(8, 8, 8, 0.55));
}

.smag-chapter__inner {
  position: relative;
  z-index: 2;
  width: min(100% - 40px, var(--smag-max));
  margin: 0 auto;
  padding: 72px 0;
  display: grid;
  gap: 12px;
  max-width: 28ch;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.4);
}

.smag-chapter__label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.smag-chapter__title {
  margin: 0;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.smag-caption {
  margin: 10px 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--smag-muted);
}

/* Asymmetric split */
.smag-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.smag-split--flip {
  grid-template-columns: 0.95fr 1.05fr;
}

.smag-split--flip .smag-split__media {
  order: -1;
}

.smag-split__media {
  position: relative;
  overflow: hidden;
  background: #d8d4cf;
  aspect-ratio: 4 / 5;
}

.smag-split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.smag-split figure {
  margin: 0;
}

.smag-split > figure {
  display: grid;
  gap: 0;
}

.smag-split > figure.smag-split__media {
  /* media figure also holds caption below crop */
  aspect-ratio: auto;
  background: transparent;
  overflow: visible;
}

.smag-split > figure.smag-split__media img {
  aspect-ratio: 4 / 5;
  background: #d8d4cf;
}

/* Device / phone product mockup in magazine split */
.smag-split > figure.smag-split__media--device {
  display: grid;
  gap: 12px;
}

.smag-split > figure.smag-split__media--device img {
  aspect-ratio: 3 / 4;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  object-fit: contain;
  background: #141414;
  border-radius: 0;
}

.smag-prose h2 {
  margin: 0 0 14px;
  font-family: var(--smag-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.smag-prose p {
  margin: 0 0 1em;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #2a2724;
}

.smag-prose p:last-child { margin-bottom: 0; }

.smag-prose a {
  color: var(--smag-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.smag-prose a:hover {
  text-decoration-thickness: 2px;
}

.smag-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.smag-list li {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--smag-line);
  font-size: 1rem;
  line-height: 1.5;
  color: #2a2724;
}

.smag-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.smag-list__n {
  font-family: var(--smag-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--smag-muted);
  padding-top: 0.2em;
}

.smag-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: smag-step;
  display: grid;
  gap: 0;
}

.smag-steps li {
  counter-increment: smag-step;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--smag-line);
  font-size: 1.02rem;
  line-height: 1.5;
}

.smag-steps li::before {
  content: counter(smag-step, decimal-leading-zero);
  font-family: var(--smag-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--smag-accent);
  padding-top: 0.35em;
}

/* CTA */
.smag-cta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 24px;
  align-items: center;
  padding: 36px 0;
  border-top: 1px solid var(--smag-line);
  border-bottom: 1px solid var(--smag-line);
}

.smag-cta p {
  margin: 0;
  font-family: var(--smag-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.4;
  max-width: 36ch;
}

.smag-cta a {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--smag-ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: background 0.25s ease, transform 0.25s ease;
}

.smag-cta a:hover {
  background: var(--smag-accent);
}

.smag-cta a .smag-u {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.smag-cta a:hover .smag-u {
  width: 42px;
}

/* Reveal motion */
.smag-reveal {
  opacity: 1;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.smag-reveal.is-in {
  opacity: 1;
  transform: none;
}

.smag-reveal-delay-1 { transition-delay: 0.08s; }
.smag-reveal-delay-2 { transition-delay: 0.16s; }
.smag-reveal-delay-3 { transition-delay: 0.24s; }

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

/* Mobile */
@media (max-width: 900px) {
  .smag-hero {
    min-height: min(88vh, 760px);
    align-items: end;
  }

  .smag-title {
    max-width: 12ch;
  }

  .smag-folio__row {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .smag-folio__meta {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .smag-facts {
    grid-template-columns: 1fr 1fr;
  }

  .smag-split,
  .smag-split--flip {
    grid-template-columns: 1fr;
  }

  .smag-split--flip .smag-split__media {
    order: 0;
  }

  .smag-split__media {
    aspect-ratio: 16 / 10;
  }

  .smag-split > figure.smag-split__media--device {
    aspect-ratio: auto;
  }

  .smag-split > figure.smag-split__media--device img {
    max-width: min(360px, 88vw);
    aspect-ratio: 3 / 4;
  }

  .smag-cta {
    grid-template-columns: 1fr;
  }

  .smag-cta a {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .smag-shell {
    width: min(100% - 28px, var(--smag-max));
  }

  .smag-hero__inner {
    width: min(100% - 28px, var(--smag-max));
    padding: 104px 0 40px;
  }

  .smag-facts {
    grid-template-columns: 1fr;
  }

  .smag-section {
    padding: 52px 0;
  }

  .smag-folio__row {
    padding: 22px 0;
  }
}
