/* TekHearth website. Navy / steel / ember / amber (the "Hex Core Network" logo palette).
   Everything that moves sits under html.motion, which assets/site.js adds only when reduced motion is off. */
:root {
  --navy1: #070B15; --navy2: #0F1629; --navy3: #1E2A4D;
  --surface: #141C2F; --surface2: #1B2540;
  --steel1: #F2F5FB; --steel2: #BCC6DA; --steel3: #9AA6C0;
  --ember: #FF5A1F; --ember2: #FF6A2B; --amber: #FFB547; --amber2: #FFC15E;
  --line: rgba(188, 198, 218, .14);
  --wrap: 1120px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--navy1); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: radial-gradient(1100px 680px at 50% -8%, var(--navy3) 0%, var(--navy2) 48%, var(--navy1) 100%) no-repeat, var(--navy1);
  color: var(--steel1);
  font: 400 1.0625rem/1.65 'Readex Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
/* A faint hex grid at the top of every page, fading out downwards. */
body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 760px;
  background: url(/assets/img/hexgrid.svg) center top / 34.64px 60px repeat;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
}
body > * { position: relative; }
img, svg { max-width: 100%; }
a { color: var(--ember2); text-underline-offset: 3px; }
a:hover { color: var(--amber2); }
:focus-visible { outline: 2px solid var(--amber2); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
.lede { text-wrap: pretty; }
[dir='rtl'] h1, [dir='rtl'] h2, [dir='rtl'] h3 { line-height: 1.45; }
.email { color: var(--ember2); font-weight: 500; unicode-bidi: isolate; }
/* Latin names in brackets on Arabic pages stay on one line, so the brackets never split. */
[dir='rtl'] span[lang='en'], .nowrap { white-space: nowrap; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 9; padding: 8px 14px; border-radius: 10px;
  background: var(--steel1); color: var(--navy1); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* Header */
.top { max-width: var(--wrap); margin: 0 auto; padding: 18px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; display: block; }
.brand-word { height: 22px; width: auto; display: block; }
.brand-ar { font-weight: 600; font-size: 1.3rem; line-height: 1; }
.brand-ar .s { color: var(--steel1); }
.brand-ar .e { color: #FF7A3D; } /* ember lifted to 4.6:1 for text on the top navy */
.top-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav a { color: var(--steel2); text-decoration: none; padding: 7px 11px; border-radius: 10px; font-size: .95rem; }
.top-nav a:hover { color: var(--steel1); background: rgba(242, 245, 251, .06); }
.top-nav a[aria-current='page'] { color: var(--steel1); box-shadow: inset 0 -2px 0 var(--ember2); border-radius: 0; }
.top-nav .lang-switch { border: 1px solid rgba(188, 198, 218, .28); margin-inline-start: 4px; }

/* Home: hero */
.hero { max-width: var(--wrap); margin: 0 auto; padding: 24px 20px 72px; display: grid; gap: 8px;
  text-align: center; justify-items: center; overflow-x: clip; } /* the logo glow must never widen the page */
.hero-art { position: relative; display: grid; place-items: center; width: min(250px, 66vw); }
.hero-art::before { content: ''; position: absolute; inset: -30%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 31, .16) 0%, rgba(255, 90, 31, 0) 62%); pointer-events: none; }
.mark { position: relative; width: 100%; height: auto; display: block; overflow: visible; }
.eyebrow { margin: 18px 0 0; color: var(--amber2); font-size: .8rem; font-weight: 500; letter-spacing: .2em;
  text-transform: uppercase; }
[dir='rtl'] .eyebrow { font-size: 1rem; letter-spacing: 0; }
.eyebrow [lang='en'] { font-size: .78em; letter-spacing: .12em; color: var(--steel2); }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 10px 0 12px; max-width: 17ch; letter-spacing: -.015em; }
[dir='rtl'] .hero h1 { letter-spacing: 0; max-width: 20ch; }
.lede { color: var(--steel2); font-size: clamp(1.08rem, 2.4vw, 1.25rem); margin: 0 0 26px; max-width: 36ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; background: linear-gradient(180deg, var(--ember2), var(--ember)); color: var(--navy1);
  font-weight: 600; text-decoration: none; box-shadow: 0 10px 28px -10px rgba(255, 90, 31, .7); }
.btn:hover { color: var(--navy1); filter: brightness(1.06); }
.btn-ghost { background: rgba(242, 245, 251, .03); color: var(--steel1); border: 1px solid rgba(188, 198, 218, .35); box-shadow: none; }
.btn-ghost:hover { color: var(--steel1); border-color: var(--steel2); }
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) 340px; align-items: center; text-align: start; justify-items: start;
    padding: 56px 20px 96px; gap: 40px; }
  .hero-art { order: 2; width: 340px; justify-self: center; }
  .hero h1 { font-size: clamp(2.4rem, 4.2vw, 3.3rem); max-width: 19ch; }
  .actions { justify-content: flex-start; }
  .eyebrow { margin-top: 0; }
}

/* Home: sections */
.apps, .ways, .hello { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 72px; }
.home h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin-bottom: 22px; }
.home h2::after { content: ''; display: block; width: 40px; height: 3px; margin-top: 12px; border-radius: 2px;
  background: linear-gradient(90deg, var(--ember), var(--amber)); }
[dir='rtl'] .home h2::after { background: linear-gradient(270deg, var(--ember), var(--amber)); }

.app-card { position: relative; overflow: hidden; display: flex; gap: 22px; align-items: center; max-width: 760px;
  padding: 24px; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(242, 245, 251, .05); }
.app-card::before { content: ''; position: absolute; width: 260px; height: 260px; inset-inline-end: -110px; top: -130px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 106, 43, .13), rgba(255, 106, 43, 0) 65%); pointer-events: none; }
.app-icon { flex: none; width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .8); }
.app-body h3 { font-size: 1.4rem; margin-bottom: 4px; }
.app-body p { color: var(--steel2); margin: 0 0 14px; }
.app-body .app-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0; }
.chip { font-size: .85rem; padding: 5px 12px; border-radius: 999px; color: var(--amber2);
  background: rgba(255, 181, 71, .1); border: 1px solid rgba(255, 181, 71, .35); }
.more { font-weight: 600; text-decoration: none; }
.more::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-inline-start: 8px;
  vertical-align: .1em; border-top: 2px solid; border-inline-end: 2px solid; transform: rotate(45deg); }
[dir='rtl'] .more::after { transform: rotate(-45deg); }
.more:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .app-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .app-icon { width: 80px; height: 80px; border-radius: 19px; }
}

.ways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ways li { padding: 20px 22px; border-radius: 18px; border: 1px solid var(--line); background: rgba(20, 28, 47, .72);
  color: var(--steel2); }
.ways li::before { content: ''; display: block; width: 10px; height: 10px; margin-bottom: 14px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 181, 71, .12), 0 0 14px rgba(255, 106, 43, .8); }
.ways strong { display: block; color: var(--steel1); font-weight: 600; font-size: 1.08rem; margin-bottom: 2px; }
.hello p { color: var(--steel2); margin: 0; }

/* Support and privacy */
.doc { max-width: 760px; margin: 0 auto; padding: 28px 20px 64px; }
.doc-head { margin-bottom: 22px; }
.doc-head h1 { font-size: clamp(1.8rem, 4.6vw, 2.5rem); }
.updated { color: var(--steel3); font-size: .92rem; margin: 8px 0 0; }
.doc-body { padding: 28px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 24px 48px -30px rgba(0, 0, 0, .9); }
.doc-body h2 { color: var(--amber2); font-size: 1.15rem; margin: 30px 0 8px; }
.doc-body > :first-child { margin-top: 0; }
.doc-body p { margin: 0 0 12px; }
.doc-body .summary { padding: 16px 18px; border-radius: 14px; background: var(--surface2); }
.mail-box { text-align: center; padding: 6px 0 10px; }
.mail-box p { margin: 0 0 8px; color: var(--steel2); }
.mail-box .mail-big { font-size: 1.45rem; margin: 0; }
.link-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px;
  border-radius: 14px; background: var(--surface2); border: 1px solid transparent; color: var(--steel1); text-decoration: none; }
.link-list a::after { content: ''; flex: none; width: 8px; height: 8px; margin-inline-end: 4px;
  border-top: 2px solid var(--ember2); border-inline-end: 2px solid var(--ember2); transform: rotate(45deg); }
[dir='rtl'] .link-list a::after { transform: rotate(-45deg); }
.link-list a:hover { border-color: rgba(255, 106, 43, .5); color: var(--steel1); }
@media (max-width: 520px) { .doc-body { padding: 22px 18px; } .mail-box .mail-big { font-size: 1.25rem; } }

/* Footer */
.foot { max-width: var(--wrap); margin: 0 auto; padding: 30px 20px 44px; border-top: 1px solid var(--line);
  text-align: center; color: var(--steel2); font-size: .92rem; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-bottom: 12px; }
.foot nav a { color: var(--steel1); text-decoration: none; }
.foot nav a:hover { color: var(--amber2); text-decoration: underline; }
.foot p { margin: 4px 0; }

/* 404 */
.lost-box { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 40px 20px;
  text-align: center; }
.lost-box img { border-radius: 22px; }
.lost-box h1 { font-size: 1.8rem; }

/* Phones: keep the header on one line down to 360 px. */
@media (max-width: 440px) {
  .top { padding: 14px 14px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand-word { height: 17px; }
  .brand-ar { font-size: 1.12rem; }
  .top-nav { gap: 0; }
  .top-nav a { padding: 7px 7px; font-size: .88rem; }
  .top-nav .lang-switch { margin-inline-start: 2px; }
}
@media (max-width: 380px) {
  .brand-word { height: 15px; }
  .top-nav a { padding: 7px 5px; font-size: .85rem; }
}

/* ---------- Motion (only with html.motion) ---------- */
.mark .sparks { display: none; }
.motion .mark .sparks { display: inline; }
.mark .sparks path { stroke-linecap: butt; stroke-dasharray: .1 2; stroke-dashoffset: .1; }

.motion .mark .hex { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(.6, 0, .3, 1) .15s forwards; }
.motion .mark .traces path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .55s ease-out forwards;
  animation-delay: calc(.75s + var(--i) * .08s); }
.motion .mark .nodes circle { transform-box: fill-box; transform-origin: center;
  animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) calc(1.15s + var(--i) * .08s) both,
             twinkle 7s ease-in-out calc(3s + var(--i) * .85s) infinite; }
.motion .mark .core { transform-box: fill-box; transform-origin: center; animation: core-in .9s ease-out .1s both; }
.motion .mark .shine { animation: shine-in .6s ease-out .6s both; }
.motion .mark .halo { transform-box: fill-box; transform-origin: center; animation: pulse 4.2s ease-in-out 1s infinite; }
.motion .mark .sparks path { opacity: 0; animation: spark 6s linear infinite; animation-delay: calc(2.2s + var(--i) * 1s); }
.motion .hero-art::before { animation: drift 9s ease-in-out infinite alternate; }

.mark .traces path:nth-child(1), .mark .nodes circle:nth-child(1), .mark .sparks path:nth-child(1) { --i: 0; }
.mark .traces path:nth-child(2), .mark .nodes circle:nth-child(2), .mark .sparks path:nth-child(4) { --i: 1; }
.mark .traces path:nth-child(3), .mark .nodes circle:nth-child(3), .mark .sparks path:nth-child(2) { --i: 2; }
.mark .traces path:nth-child(4), .mark .nodes circle:nth-child(4), .mark .sparks path:nth-child(5) { --i: 3; }
.mark .traces path:nth-child(5), .mark .nodes circle:nth-child(5), .mark .sparks path:nth-child(3) { --i: 4; }
.mark .traces path:nth-child(6), .mark .nodes circle:nth-child(6), .mark .sparks path:nth-child(6) { --i: 5; }
.mark .traces path:nth-child(7), .mark .nodes circle:nth-child(7) { --i: 6; }
.mark .traces path:nth-child(8), .mark .nodes circle:nth-child(8) { --i: 7; }

.motion .hero-text > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.motion .hero-text > :nth-child(1) { animation-delay: .25s; }
.motion .hero-text > :nth-child(2) { animation-delay: .35s; }
.motion .hero-text > :nth-child(3) { animation-delay: .5s; }
.motion .hero-text > :nth-child(4) { animation-delay: .65s; }

.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .reveal [data-stagger] > * { opacity: 0; transform: translateY(12px);
  transition: opacity .6s ease calc(.15s + var(--i, 0) * .12s), transform .6s cubic-bezier(.2, .7, .2, 1) calc(.15s + var(--i, 0) * .12s); }
.motion .reveal.in [data-stagger] > * { opacity: 1; transform: none; }

.motion .app-card { transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .35s ease; }
.motion .app-card:hover { transform: translateY(-3px); border-color: rgba(255, 106, 43, .45); }
.motion .btn { transition: transform .15s ease, filter .2s ease; }
.motion .btn:active { transform: scale(.97); }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%, 82%, 100% { transform: none; opacity: 1; } 88% { transform: scale(1.35); opacity: 1; } 94% { transform: none; opacity: .8; } }
@keyframes shine-in { from { opacity: 0; } to { opacity: .6; } }
@keyframes core-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: .7; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.14); } }
@keyframes spark { 0% { stroke-dashoffset: .1; opacity: 0; } 2% { opacity: 1; } 18% { stroke-dashoffset: -1; opacity: 1; } 19%, 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes drift { from { transform: translate(-4%, -3%) scale(.96); } to { transform: translate(4%, 3%) scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .motion *, .motion *::before { animation: none !important; transition: none !important; }
  .motion .reveal, .motion .reveal [data-stagger] > * { opacity: 1; transform: none; }
  .motion .mark .hex, .motion .mark .traces path { stroke-dashoffset: 0; }
  .motion .mark .sparks { display: none; }
}
