/* Self-hosted, subsetted (latin + latin-ext) woff2 — no external font CDN. */
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/karla-v33-latin_latin-ext-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/karla-v33-latin_latin-ext-500.woff2") format("woff2");
}
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/karla-v33-latin_latin-ext-700.woff2") format("woff2");
}

:root {
  --bg: #1a1a1a;
  --bg2: #1f1f1f;
  --bg3: #272727;
  --content: #2f2f2f;
  --text: #f5f5f5;
  --muted: #a9a9a9;
  --faint: #7c7c7c;
  --o: #e27e2a;
  --gold: #f5c73d;
  --red: #ce3517;
  --grad: linear-gradient(135deg, #f5c73d, #e27e2a 55%, #ce3517);
  --line: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --font: "Karla", system-ui, -apple-system, sans-serif;
  --head: "Karla", system-ui, sans-serif;
}

/* Offset anchor jumps so the sticky topbar doesn't cover the target heading. */
html { scroll-padding-top: 84px; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .wordmark { font-family: var(--head); line-height: 1.15; font-weight: 600; }

a { color: var(--o); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }
img { max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding-inline: 32px; }
.container-narrow { max-width: 760px; }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.28em; font-size: 13px; font-weight: 700; color: var(--o); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--o); color: #1a1a1a; padding: 10px 18px; z-index: 100; }
.skip-link:focus { left: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--o); color: var(--text); background: transparent;
  padding: 12px 24px; border-radius: 32px; font: 500 16px var(--font);
  cursor: pointer; transition: background 0.2s, color 0.2s, filter 0.2s;
}
.btn:hover { background: var(--o); color: #1a1a1a; }
.btn-grad { border: 0; background: var(--grad); color: #211404; font-weight: 700; }
.btn-grad:hover { filter: brightness(1.08); color: #211404; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  background: rgba(26, 26, 26, 0.85); backdrop-filter: blur(10px);
}
.wordmark { display: inline-flex; align-items: center; font-weight: 700; font-size: 22px; letter-spacing: 0.04em; color: var(--text); }
.wordmark::before { content: ""; flex: 0 0 auto; width: 24px; height: 24px; margin-right: 8px; background: url("/img/tersacore-logo-gradient.svg") center / contain no-repeat; }
.wordmark .dot { color: var(--o); }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); }

/* Tiles & badges */
.tile {
  border-radius: 14px; overflow: hidden; flex: 0 0 auto; background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; border-radius: 20px; }
.chip-os { color: var(--faint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.spot .chips { margin-top: auto; margin-bottom: 16px; }
.soon { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); border: 1px solid rgba(245, 199, 61, 0.4); padding: 3px 9px; border-radius: 20px; }

/* Hero (home) */
.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; padding: 72px 0 18px; }
.hero .lead { grid-column: span 2; align-self: center; padding-right: 24px; }
.hero h1 { font-size: clamp(38px, 5vw, 52px); font-weight: 700; margin: 16px 0 20px; max-width: 600px; }
.hero .sub { font-size: 18px; color: var(--muted); max-width: 460px; margin-bottom: 30px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.spot { grid-column: span 1; background: radial-gradient(130% 90% at 0% 0%, rgba(245, 199, 61, 0.20), rgba(226, 126, 42, 0.08) 38%, transparent 64%), var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 26px; position: relative; display: flex; flex-direction: column; }
.spot .label { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.spot .tile { width: 60px; height: 60px; margin: 16px 0 14px; }
.spot h2 { font-size: 22px; }
.spot .k { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.spot p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.spot-cta { margin-top: auto; }

.section-label { color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.16em; margin: 46px 0 16px; }
.rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Cards */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: border-color 0.2s, transform 0.2s; }
.card:hover { border-color: rgba(226, 126, 42, 0.5); transform: translateY(-3px); }
.card .top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.card .tile { width: 52px; height: 52px; }
.card h3 { font-size: 18px; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 1px; }
.subtitle:empty { display: none; }
.spot .names .subtitle { font-size: 14px; }
.card .tag { color: var(--muted); font-size: 14px; min-height: 42px; }
.card .row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.card .row a { color: var(--o); font-size: 14px; font-weight: 500; }
/* Whole-card link (apps with a landing page) */
.card-link { display: block; color: var(--text); }
.card-link:hover, .card-link:hover h3 { color: var(--text); }
.card-link h3 { color: var(--text); }
.card-cta { color: var(--o); font-size: 14px; font-weight: 500; }
.card-link:hover .card-cta { color: var(--gold); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 72px 0 80px; }
.stat { background: var(--bg); padding: 28px 20px; text-align: center; }
.stat .n { font-family: var(--head); font-weight: 700; font-size: clamp(28px, 4vw, 40px); }
.stat .l { color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }

/* Section heads */
.apps-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; flex-wrap: wrap; gap: 8px; }
.apps-head h2 { font-size: clamp(24px, 4vw, 30px); }
.apps-head p { color: var(--faint); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Generic page (legal, contact, site-map) */
.page { padding-top: 64px; padding-bottom: 80px; }
.page h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 8px; }
.page .updated { color: var(--faint); font-size: 15px; margin-bottom: 36px; }
.prose { color: var(--text); }
.prose h2 { font-size: 20px; margin: 30px 0 10px; color: var(--gold); }
.prose p { color: var(--muted); margin-bottom: 14px; }
.prose ul { color: var(--muted); margin: 0 0 14px 20px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--o); }
.back { margin-top: 36px; font-size: 15px; }
.back a { color: var(--o); }
.back a::before { content: "\2190"; margin-right: 7px; }
.back a:hover { text-decoration: underline; }
.lang-switch { display: flex; gap: 14px; margin-bottom: 24px; font-size: 14px; }
.lang-switch a { color: var(--faint); }
.lang-switch a:hover { color: var(--text); }
.lang-switch .active { color: var(--o); font-weight: 500; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 620px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 15px; color: var(--muted); }
.req { color: var(--o); }
.field input, .field select, .field textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  font: 400 17px/1.5 var(--font); padding: 13px 16px; transition: border-color 0.2s;
}
/* Reset native select chrome so it matches the inputs (same height on web + iOS); add a custom chevron. */
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 42px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23a9a9a9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--o); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.h-captcha { min-height: 78px; }
.form-status { display: none; margin: 0; padding: 12px 16px; border-radius: 10px; font-size: 15px; }
.form-status.success { display: block; background: rgba(99, 153, 34, 0.16); color: #b6dd8c; }
.form-status.error { display: block; background: rgba(206, 53, 23, 0.16); color: #f6a48a; }
.btn-submit:disabled { opacity: 0.6; cursor: wait; }

/* Site map */
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.map-col h2 { font-size: 18px; color: var(--o); margin-bottom: 12px; }
.map-col ul { list-style: none; }
.map-col li { margin-bottom: 8px; }
.map-col a { color: var(--muted); font-size: 15px; }
.map-col a:hover { color: var(--text); }

/* App landing page */
.app-page { padding-top: 40px; padding-bottom: 72px; }
.app-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.app-id { display: flex; align-items: center; gap: 18px; }
.app-icon { width: 88px; height: 88px; border-radius: 20px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); }
.app-id-text h1 { font-size: clamp(34px, 6vw, 48px); }
.app-sub { color: var(--muted); font-size: 17px; margin-top: 2px; }
.app-tagline { font-size: clamp(20px, 2.6vw, 27px); line-height: 1.3; margin: 28px 0; max-width: 440px; }
.app-dl { padding: 14px 28px; font-size: 17px; }
.app-meta { color: var(--faint); font-size: 14px; margin-top: 14px; }
.app-hero-shot { display: flex; justify-content: center; }
.app-section-title { font-size: clamp(23px, 4vw, 30px); margin: 64px 0 6px; }

/* Pure-CSS iPhone frame (screenshots are raw, unframed) */
.device { width: 100%; max-width: 235px; aspect-ratio: 1320 / 2868; padding: 6px; border-radius: 38px; background: linear-gradient(150deg, #45433f, #1b1b1b 62%); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.07); margin: 0; }
.device img { width: 100%; height: 100%; object-fit: cover; border-radius: 32px; display: block; }
.device-lg { max-width: 272px; border-radius: 44px; }
.device-lg img { border-radius: 38px; }

/* Screenshot gallery: all shots in App Store order, horizontal scroll on every
   viewport (a partial next shot + the scrollbar signal there's more). */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: 212px; gap: 22px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 16px; margin-top: 18px; scrollbar-width: thin; scrollbar-color: var(--content) transparent; }
.shots .device { max-width: 212px; scroll-snap-align: start; }
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb { background: var(--content); border-radius: 4px; }
.shots::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 18px; }
.feature { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature-ic { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: rgba(226, 126, 42, 0.12); color: var(--o); margin-bottom: 14px; }
.feature-ic svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }

.app-cta-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; margin-top: 56px; padding: 34px 36px; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(120% 150% at 0% 0%, rgba(245, 199, 61, 0.16), rgba(226, 126, 42, 0.06) 42%, transparent 72%), var(--bg2); }
.app-cta-band h2 { font-size: clamp(22px, 3vw, 27px); }
.app-cta-band p { color: var(--muted); margin-top: 6px; }
.app-legal-links { text-align: center; color: var(--faint); font-size: 14px; margin-top: 40px; }
.app-legal-links a { color: var(--muted); }
.app-legal-links a:hover { color: var(--text); }

@media (max-width: 820px) {
  .app-hero { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .app-id { justify-content: center; }
  .app-tagline { margin-inline: auto; }
  .app-cta-band { justify-content: center; text-align: center; }
}
@media (max-width: 680px) {
  .shots { grid-auto-columns: 66%; scroll-snap-type: x mandatory; margin-inline: -20px; padding-inline: 20px; }
  .shots .device { max-width: 100%; scroll-snap-align: center; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer { background: var(--bg2); border-top: 1px solid var(--line); padding: 56px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 44px; }
.footer-about .wordmark { font-size: 20px; }
.footer-about p { color: var(--faint); font-size: 14px; margin-top: 12px; max-width: 320px; }
.footer-col h3 { font-size: 16px; color: var(--o); margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--muted); font-size: 14px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 28px; display: flex; justify-content: space-between; color: var(--faint); font-size: 14px; flex-wrap: wrap; gap: 8px; }

/* Back to top */
.to-top { position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%; background: var(--o); display: inline-flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s, filter 0.2s; z-index: 30; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { filter: brightness(1.1); }
.to-top img { width: 18px; height: 18px; }

/* Reveal on scroll (transform only on hero so LCP isn't gated by opacity) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.hero .lead > *, .hero .spot { animation: rise 0.7s ease both; }
.hero .spot { animation-delay: 0.1s; }
@keyframes rise { from { transform: translateY(20px); } to { transform: none; } }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero .lead { grid-column: auto; padding-right: 0; }
  .spot { grid-column: auto; }
  .rail, .grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .container { padding-inline: 20px; }
  .nav a:not(.btn) { display: none; }
  .rail, .grid, .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .hero .lead > *, .hero .spot { opacity: 1; transform: none; transition: none; animation: none; }
}
