/* ==========================================================================
   Undergo Studio - shared stylesheet
   Design system: Oswald + Archivo, charcoal + off-white + coral, keyline frames
   No em dashes anywhere in content. American spellings.
   ========================================================================== */

:root {
  --ink: #1A1A1A;
  --paper: #F7F7F5;
  --paper-2: #F0EFEC;
  --coral: #E8735C;
  --coral-ink: #241C1A;
  --muted: #6A6A68;
  --muted-2: #8A8A88;
  --line: #D8D8D5;
  --line-dark: #333333;
  --white: #FFFFFF;

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --wrap: 1120px;
  --pad: 32px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---- Nav ---- */
.nav {
  background: var(--ink);
  padding: 18px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav__logo { font-family: var(--font-display); color: var(--paper); font-size: 17px; letter-spacing: 3px; font-weight: 500; }
.nav__links { display: flex; gap: 28px; align-items: center; font-size: 11px; letter-spacing: 2px; color: var(--paper); }
.nav__links a { transition: color .15s ease; }
.nav__links a:hover { color: var(--coral); }
.nav__links a.is-active { color: var(--coral); }
.nav__cta { border: 1px solid var(--coral); color: var(--coral); padding: 8px 16px; font-family: var(--font-display); }
.nav__cta:hover { background: var(--coral); color: var(--white); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav__toggle span { width: 22px; height: 2px; background: var(--paper); display: block; }

/* ---- Type ---- */
.eyebrow { font-size: 10px; letter-spacing: 3px; color: var(--coral); text-transform: uppercase; }
.display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.5px;
  margin: 0;
}
.display--xl { font-size: clamp(52px, 8vw, 104px); line-height: 0.82; letter-spacing: -1px; }
.display--lg { font-size: clamp(40px, 6vw, 72px); }
.display--md { font-size: clamp(34px, 4.5vw, 56px); }
.display--sm { font-size: clamp(28px, 3.5vw, 40px); }
.thin { font-weight: 300; }
.coral { color: var(--coral); }
.lede { font-size: 15px; color: #4A4A48; line-height: 1.7; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 16px 34px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--coral { background: var(--coral); color: var(--white); }
.btn--coral:hover { background: #d9634c; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #000; }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--link { border: 0; border-bottom: 1px solid var(--ink); padding: 0 0 4px; }

/* ---- Sections ---- */
.section { padding: 56px 0; }
.section--tight { padding: 44px 0; }
.section--ink { background: var(--ink); color: var(--paper); }
.section--paper2 { background: var(--paper-2); }
.section--ink .display { color: var(--paper); }
.section--ink .lede { color: #C9C4BE; }

/* ---- Keyline frame (the signature) ---- */
.frame { position: relative; } .frame .frame__img { z-index:1; }
.frame__border { position: absolute; inset: 10px -10px -10px 10px; border: 1.5px solid var(--coral); z-index:0; }
.frame__img { position: absolute; inset: 0; background-size: cover; background-position: center 20%; }
.frame__border { pointer-events:none; }
.section--ink .frame__border { border-color: #333; }

/* ---- Stat bar ---- */
.stats { background: var(--ink); display: grid; grid-template-columns: repeat(3, 1fr); }
.stats__item { padding: 26px var(--pad); border-right: 1px solid var(--line-dark); }
.stats__item:last-child { border-right: 0; }
.stats__num { font-family: var(--font-display); font-size: 36px; color: var(--paper); font-weight: 500; line-height: 1; }
.stats__num--coral { color: var(--coral); }
.stats__label { font-size: 10px; letter-spacing: 2px; color: #7A7A78; margin-top: 8px; }

/* ---- Template + project grids ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 54px 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.card__frame { position: relative; height: 300px; margin-right: 14px; }
.card__label { margin-top: 24px; }
.card__name { font-family: var(--font-display); font-size: 20px; font-weight: 500; line-height: 1; }
.card__meta { font-size: 10px; letter-spacing: 1.5px; color: #7A7A78; margin-top: 6px; }
.card__tag { position: absolute; top: 22px; left: 22px; background: var(--coral); color: #fff; font-size: 9px; letter-spacing: 1.5px; padding: 5px 10px; font-family: var(--font-display); z-index: 2; }
.card__tag--soon { background: var(--ink); }
.card a { display: block; }
.card:hover .frame__img { opacity: .9; }

/* ---- Filters ---- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter {
  border: 1px solid #C9C9C6; background: transparent; color: var(--ink);
  padding: 9px 20px; font-size: 10px; letter-spacing: 2px; cursor: pointer;
  font-family: var(--font-display);
}
.filter.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---- Three tiers ---- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tier { border: 1px solid var(--line); background: #fff; padding: 30px 26px; }
.tier__kicker { font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; color: var(--muted-2); }
.tier__price { font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1; margin: 10px 0 4px; }
.tier__sub { font-size: 11px; color: var(--muted-2); letter-spacing: 1px; margin-bottom: 20px; }
.tier__list { border-top: 1px solid #E4E4E1; padding-top: 16px; font-size: 12px; color: #4A4A48; line-height: 2; }
.tier__list .no { color: #B8B8B4; }
.tier--feature { border: 2px solid var(--coral); background: var(--ink); position: relative; }
.tier--feature .tier__kicker { color: var(--coral); }
.tier--feature .tier__price { color: var(--paper); }
.tier--feature .tier__list { border-top-color: var(--line-dark); color: var(--coral); }
.tier__flag { position: absolute; top: -11px; left: 26px; background: var(--coral); color: #fff; font-size: 9px; letter-spacing: 2px; padding: 4px 12px; font-family: var(--font-display); }
.tier-note { margin-top: 30px; background: var(--paper-2); border-left: 3px solid var(--coral); padding: 22px 26px; font-size: 14px; line-height: 1.7; }
.tier-note b { font-family: var(--font-display); letter-spacing: 1px; font-weight: 500; }

/* ---- Steps ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.step { border-top: 2px solid var(--ink); padding-top: 16px; }
.step__num { font-family: var(--font-display); font-size: 40px; font-weight: 300; line-height: 1; color: var(--coral); }
.step__title { font-family: var(--font-display); font-size: 15px; letter-spacing: 1px; margin: 10px 0 8px; }
.step__body { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---- Footer ---- */
.foot { background: var(--ink); padding: 64px var(--pad) 32px; color: #B8B4B0; }
.foot__grid { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; padding-left:0; padding-right:0; }
.foot__brand { max-width: 30ch; }
.foot__logo { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: 2px; color: var(--paper); }
.foot__tag { font-size: 14px; color: #A9A4A0; margin: 14px 0 16px; line-height: 1.6; }
.foot__email { font-size: 15px; color: var(--paper); border-bottom: 1px solid var(--coral); padding-bottom: 2px; }
.foot__email:hover { color: var(--coral); }
.foot__links h4 { font-family: var(--font-body); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--coral); margin-bottom: 14px; font-weight: 600; }
.foot__links a { display: block; font-size: 15px; color: #B8B4B0; margin-bottom: 9px; }
.foot__links a:hover { color: var(--coral); }
.foot__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 11px; letter-spacing: 1.5px; color: #8A8680; padding-left:0; padding-right:0; }
.foot a:hover { color: var(--coral); }

/* ---- Utility ---- */
.center { text-align: center; }
.mt-s { margin-top: 14px; }
.mt-m { margin-top: 24px; }
.mt-l { margin-top: 34px; }
.flex-cta { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ink); padding: 24px var(--pad);
  }
  .nav__toggle { display: flex; }
  .grid-2, .grid-3, .tiers, .steps { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
  .stats__item { border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .hero-split { grid-template-columns: 1fr !important; }
  .hero-split > div:first-child { order: 2; }
  .hero-split > div:last-child { order: 1; padding-left: 0 !important; }
  .hero-split .frame { min-height: 220px; height: 220px !important; margin-right: 0 !important; margin-top: 32px; }
}

/* ---- Focus states (accessibility floor) ---- */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--coral); outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Template preview cards (browser frame, hero visible, whole page on hover) ---- */
.card--full .card__shell { position: relative; margin-right: 14px; }
.card--full .card__win { position: relative; z-index: 1; border: 1px solid var(--ink); background: #111; }
.card--full .card__view { position: relative; aspect-ratio: 2 / 3; overflow: hidden; container-type: size; }
.card--full .card__page { width: 100%; display: block; transition: transform 5.5s ease; }
.card--full:hover .card__page { transform: translateY(calc(100cqh - 100%)); }
.card--full .frame__border { position: absolute; inset: 14px -14px -14px 14px; border: 1.5px solid var(--coral); z-index: 0; }
.card--full .card__tag { top: 16px; left: 16px; z-index: 3; }
.card__hint { position: absolute; right: 14px; bottom: 14px; z-index: 3; background: rgba(26,26,26,.82); color: var(--paper); font-family: var(--font-display); font-size: 9px; letter-spacing: 1.5px; padding: 5px 9px; transition: opacity .2s ease; pointer-events: none; }
.card--full:hover .card__hint { opacity: 0; }
@media (hover: none) { .card__hint { display: none; } .card--full:hover .card__page { transform: none; } }

/* ---- Built + Launched: cards link out to the live sites ---- */
.work-link { display: block; }
.work-title { font-size: 12px; letter-spacing: 2px; font-weight: 600; }
.work-ext { color: var(--muted-2); font-weight: 400; transition: color .15s ease; }
.work-link:hover .work-ext { color: var(--coral); }
.work-link:hover .card__meta { color: var(--muted); }

/* ---- Template detail: tall full-page showcase in the keyline frame ---- */
.showcase { position: relative; margin-right: 16px; }
.showcase__win { position: relative; z-index: 1; background: #111; border: 1px solid var(--ink); max-height: 640px; overflow: hidden; }
.showcase__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--ink); }
.showcase__bar span { width: 9px; height: 9px; border-radius: 50%; background: #48433f; display: block; }
.showcase__bar span:first-child { background: var(--coral); }
.showcase__win img { width: 100%; display: block; }
.showcase__fade { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; background: linear-gradient(rgba(247,247,245,0), var(--paper)); z-index: 2; pointer-events: none; }
.showcase__more { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3; font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.showcase__border { position: absolute; inset: 14px -14px -14px 14px; border: 1.5px solid var(--coral); z-index: 0; }

/* ---- Template detail: laptop mockup (see it live) ---- */
.laptop { max-width: 680px; margin: 0 auto; }
.laptop__screen { position: relative; background: #000; border: 12px solid #101010; border-radius: 16px 16px 0 0; aspect-ratio: 16 / 10; overflow: hidden; }
.laptop__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.laptop__base { height: 16px; background: linear-gradient(#dad9d5, #b7b6b1); border-radius: 0 0 13px 13px; position: relative; box-shadow: inset 0 2px 3px rgba(0,0,0,.18); }
.laptop__base::after { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 116px; height: 7px; background: #a4a49f; border-radius: 0 0 9px 9px; }

/* ---- Template detail: prev / next ---- */
.tpl-nav { display: flex; align-items: center; justify-content: center; gap: 26px; }
.tpl-nav__arrow { width: 46px; height: 46px; border: 1px solid var(--ink); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; transition: background .15s ease, color .15s ease; }
.tpl-nav__arrow:hover { background: var(--ink); color: var(--paper); }
.tpl-nav__name { font-family: var(--font-display); font-size: 34px; font-weight: 500; letter-spacing: 1px; min-width: 220px; text-align: center; }

.setup-note { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.9; }

@media (max-width: 860px) {
  .tpl-detail-hero { grid-template-columns: 1fr !important; }
  .showcase { margin-right: 0; margin-bottom: 30px; }
  .tpl-detail-hero > div:last-child { position: static !important; }
}

/* ---- Automations add-on cards ---- */
.auto { background: var(--ink); padding: 30px 26px; }
.auto__name { font-family: var(--font-display); font-weight: 500; letter-spacing: 1px; font-size: 18px; color: var(--paper); }
.auto p { font-size: 14px; color: #A9A4A0; line-height: 1.6; margin: 10px 0 0; }
.auto:hover { background: #201817; }
@media (max-width: 760px){ .grid-3 { grid-template-columns: 1fr !important; } }
