/* Atkinson Hyperlegible — Braille Institute, SIL OFL 1.1. Same faces the JustPhone app ships (400/700 + italic). */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson_hyperlegible_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson_hyperlegible_bold.ttf") format("truetype");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson_hyperlegible_italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Single dark theme — the brand look, regardless of OS setting. */
:root {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171a21;
  --text: #eceef2;
  --text-soft: #9aa1ad;
  --accent: #6b8bff;
  --accent-ink: #0f1115;
  --border: #262b35;
  --tag-ship-bg: #16311c;
  --tag-ship-ink: #7fd18f;
  --tag-soon-bg: #241f45;
  --tag-soon-ink: #b3a5ff;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand-mark { width: 26px; height: 26px; }
.brand-mark .bm-solid { fill: var(--accent); }
.brand-mark .bm-outline {
  fill: transparent;
  stroke: var(--accent);
  stroke-width: 1.7;
  transition: fill 0.25s ease;
}
.brand:hover .bm-outline { fill: var(--accent); }
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.site-header nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--text); }
.nav-cta {
  color: var(--accent) !important;
  font-weight: 600;
}

main { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem; }

.hero {
  position: relative;
  padding: 5.5rem 0 5rem;
}
.hero > :not(.hero-field) { position: relative; max-width: 720px; }
.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  margin-bottom: 1.1rem;
}
.hero-eyebrow, .hero h1 { animation: rise-in 0.5s ease-out both; }
.hero-sub { animation: rise-in 0.5s ease-out 0.12s both; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero h1, .hero-sub, .hero-field { animation: none; }
}
.hero-field {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -2rem;
  width: min(56vw, 720px);
  height: auto;
  aspect-ratio: 1092 / 416;
  color: var(--text);
  pointer-events: none;
}
.hf-acc { fill: var(--accent); }
.hf-acc[fill="none"] { fill: none; stroke: var(--accent); }

/* night sky: stars ignite one by one, then the bright ones shimmer */
@keyframes hf-ap {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* All timing lives here in classes — the CSP (style-src 'self') strips inline styles.
   Full cycle to zero: half the sky is always appearing or disappearing somewhere. */
@keyframes hf-twinkle {
  0%, 100% { opacity: 1; }
  35%, 55% { opacity: 0; }
}
.st { animation: hf-ap 0.9s ease-out var(--d, 0s) both; }
.st.tw {
  animation:
    hf-ap 0.9s ease-out var(--d, 0s) both,
    hf-twinkle var(--p, 6s) ease-in-out calc(var(--d, 0s) + 0.9s) infinite;
}
.d0 { --d: 0.2s; } .d1 { --d: 0.5s; } .d2 { --d: 0.8s; } .d3 { --d: 1.1s; }
.d4 { --d: 1.4s; } .d5 { --d: 1.7s; } .d6 { --d: 2.0s; } .d7 { --d: 2.3s; }
.d8 { --d: 2.6s; } .d9 { --d: 2.9s; } .d10 { --d: 3.1s; } .d11 { --d: 3.4s; }
.p0 { --p: 3.6s; } .p1 { --p: 4.7s; } .p2 { --p: 5.9s; }
.p3 { --p: 7.1s; } .p4 { --p: 8.2s; } .p5 { --p: 9.4s; }
/* …and the four brand shapes surface and fade, one or two at a time.
   Delay classes must beat the shorthand below (which resets delay to 0), hence .hf-star.sdN. */
.hf-star { opacity: 0; animation: hf-appear 21s ease-in-out infinite; }
.hf-star.sd0 { animation-delay: 4.0s; } .hf-star.sd1 { animation-delay: 6.6s; }
.hf-star.sd2 { animation-delay: 9.2s; } .hf-star.sd3 { animation-delay: 11.8s; }
.hf-star.sd4 { animation-delay: 14.4s; } .hf-star.sd5 { animation-delay: 17.0s; }
.hf-star.sd6 { animation-delay: 19.6s; } .hf-star.sd7 { animation-delay: 22.2s; }
@keyframes hf-appear {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  16%  { opacity: 1; }
  24%  { opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .st { animation: none !important; }
  .hf-star { animation: none; opacity: 0; }
  .hf-star.rm-keep { opacity: 1; }
}
@media (max-width: 900px) {
  /* on narrow screens the sky sits behind the hero text, dimmed for legibility;
     xMaxYMid slice crops to the dense part. Text paints above (children are position:relative). */
  .hero-field {
    top: 1.5rem;
    transform: none;
    left: -1.5rem;
    width: calc(100% + 3rem);
    height: 24rem;
    aspect-ratio: auto;
    opacity: 0.85;
  }
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  margin: 1.4rem 0 2.2rem;
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 34em;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  transition: opacity 0.15s ease;
}
.button:hover { opacity: 0.88; }

a:focus-visible, .button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

section h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 1.6rem;
}

.products { padding: 2rem 0 3rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
/* whole card is clickable via the stretched link below; cards without a link don't lift.
   Hover styles only where hover exists — on touch, a :hover-styled non-link card makes
   iOS spend the first tap on hover instead of navigating. Touch gets :active feedback. */
@media (hover: hover) {
  .card:has(a.card-link):hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  }
}
.card:has(a.card-link):active { border-color: var(--accent); }
a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .card, .card:hover { transform: none; transition: none; }
}
.card-logo {
  width: 56px;
  height: 56px;
  border-radius: 13px;
}
.card-tag {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--tag-soon-bg);
  color: var(--tag-soon-ink);
}
.card-tag.ship {
  background: var(--tag-ship-bg);
  color: var(--tag-ship-ink);
}
.card h3 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.card h3 .tm { font-weight: 400; font-size: 0.72em; margin-left: 0.14em; }
.card-lede {
  font-weight: 600;
  color: var(--text);
}
.card p { color: var(--text-soft); }
.card-lede { color: var(--text); }
.card-link {
  margin-top: auto;
  padding-top: 0.6rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  transition: transform 0.18s ease;
}
.card:hover .card-link:not(.muted) { transform: translateX(3px); }
.card-link:hover { text-decoration: underline; }
.card-link.muted {
  color: var(--text-soft);
  font-weight: 500;
}

.about { padding: 3rem 0; border-top: 1px solid var(--border); }
.about p { max-width: 44em; font-size: 1.08rem; color: var(--text-soft); }
.about > p + p { margin-top: 1rem; }
.about-quote {
  margin: 2.2rem 0 0;
  padding-left: 1.4rem;
  border-left: 3px solid var(--accent);
  max-width: 40em;
}
.about-quote p {
  font-size: 1.08rem;
  font-style: italic;
  color: var(--text);
}
.about-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.contact { padding: 3rem 0 5rem; border-top: 1px solid var(--border); }
.contact p { color: var(--text-soft); margin-bottom: 1.6rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-soft);
}
.footer-epigraph {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
}

@media (max-width: 560px) {
  .hero { padding: 3.5rem 0 3.5rem; }
  .site-header { padding: 1rem 1.1rem; flex-wrap: wrap; row-gap: 0.4rem; }
  .site-header nav { gap: 0.8rem; margin-left: auto; }
  .site-header nav a { font-size: 0.88rem; }
  .brand { font-size: 0.95rem; gap: 0.45rem; }
  .brand-mark { width: 22px; height: 22px; }
}
