/* ===================================================================
   android-apps -- shared stylesheet
   Dark theme derived from gogcli.sh, adapted for mobile app portfolio
   =================================================================== */

/* ----- CSS Variables ----- */

:root {
  --bg0: #07070b;
  --bg1: #0b0b11;
  --bg2: #11111a;
  --card: rgba(17, 17, 26, 0.72);
  --card2: rgba(12, 12, 18, 0.64);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke2: rgba(255, 255, 255, 0.05);
  --text: #f3f4f6;
  --muted: rgba(243, 244, 246, 0.7);
  --dim: rgba(243, 244, 246, 0.46);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow2: 0 16px 40px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius2: 22px;
  --serif: "Fraunces", ui-serif, Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --accent: #4285f4;
  --accent2: #34a853;
}

/* ----- Per-app accent colors ----- */

.accent-dicta        { --accent: #E53935; --accent2: #FF5252; }
.accent-digitizer    { --accent: #006C51; --accent2: #00C853; }
.accent-nanomaps     { --accent: #006874; --accent2: #00BCD4; }
.accent-radiogarden  { --accent: #E8A849; --accent2: #FFB84D; }
.accent-rssreader    { --accent: #1A73E8; --accent2: #8AB4F8; }
.accent-reminder     { --accent: #006590; --accent2: #8BCEFF; }
.accent-ratebook     { --accent: #0288D1; --accent2: #03A9F4; }
.accent-kaleidoscope { --accent: #00BFA5; --accent2: #64FFDA; }
.accent-speeddial    { --accent: #6200EE; --accent2: #BB86FC; }

/* ----- Reset ----- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ----- Background layers ----- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.bg__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 15% 10%, rgba(66, 133, 244, 0.06), transparent),
    radial-gradient(ellipse 50% 45% at 85% 20%, rgba(100, 255, 218, 0.04), transparent),
    radial-gradient(ellipse 60% 55% at 50% 80%, rgba(187, 134, 252, 0.05), transparent),
    radial-gradient(ellipse 45% 40% at 30% 60%, rgba(255, 82, 82, 0.03), transparent);
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 64px 64px;
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ----- Layout container ----- */

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Skip link (accessibility) ----- */

.skip {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  transition: top 0.2s;
}
.skip:focus {
  top: 16px;
}

/* ===================================================================
   Header (.top)
   =================================================================== */

.top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 11, 0.8);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--stroke);
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.top__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.top__name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.top__tag {
  font-size: 11px;
  color: var(--dim);
  margin-left: 4px;
  padding: 2px 7px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
}

.top__nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top__nav a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s;
}
.top__nav a:hover {
  color: var(--text);
}

/* ===================================================================
   Hero section
   =================================================================== */

.hero {
  padding: 100px 0 72px;
  text-align: center;
}

.hero--app {
  text-align: left;
  padding: 80px 0 56px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero__copy { display: flex; flex-direction: column; gap: 20px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.55s ease forwards;
}
.hero__word:nth-child(2) { animation-delay: 0.08s; }
.hero__word:nth-child(3) { animation-delay: 0.16s; }
.hero__word:nth-child(4) { animation-delay: 0.24s; }
.hero__word:nth-child(5) { animation-delay: 0.32s; }
.hero__word:nth-child(6) { animation-delay: 0.40s; }
.hero__word:nth-child(7) { animation-delay: 0.48s; }
.hero__word:nth-child(8) { animation-delay: 0.56s; }

.hero h1 .accent {
  color: var(--accent);
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 600px;
}

.hero--center .lede { margin: 0 auto; }

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.hero--center .hero__actions { justify-content: center; }

/* ----- Buttons ----- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.btn--primary:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}

.btn--ghost {
  border: 1px solid var(--stroke);
  color: var(--muted);
  background: var(--card2);
}
.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

/* ===================================================================
   Cards
   =================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(6px);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Feature card */
.card.feat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card.feat .card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent2);
}

.card.feat h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
}

.card.feat p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* Block card (code/content) */
.card.block {
  background: var(--card2);
  padding: 24px;
}

.card.block pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--muted);
}

/* ===================================================================
   App Card Grid (index page)
   =================================================================== */

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.app-card {
  border-top: 4px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-card__name {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-card__tagline {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.app-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
  margin-top: auto;
  padding-top: 4px;
  transition: gap 0.2s;
}

.app-card__link:hover {
  gap: 10px;
}

.app-card__link::after {
  content: "\2192";
}

/* ===================================================================
   Section layout (app detail pages)
   =================================================================== */

.section {
  padding: 64px 0;
}

.section + .section {
  border-top: 1px solid var(--stroke2);
}

.section__head {
  margin-bottom: 40px;
}

.section__head h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section__head p {
  color: var(--muted);
  margin-top: 8px;
  max-width: 640px;
}

.section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* ===================================================================
   Feature grids
   =================================================================== */

.grid {
  display: grid;
  gap: 16px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ===================================================================
   Steps
   =================================================================== */

.steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 20px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent2);
}

.step__body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step__body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ===================================================================
   Download section
   =================================================================== */

.download {
  padding: 64px 0;
  text-align: center;
}

.download__box {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  padding: 48px 40px;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.download__box h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
}

.download__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.download__meta span {
  font-size: 13px;
  color: var(--dim);
  font-family: var(--mono);
}

.download__req {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
  padding: 6px 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  margin-top: 4px;
}

/* ===================================================================
   Tech stack
   =================================================================== */

.tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech .pill {
  font-size: 14px;
  padding: 8px 16px;
}

/* ===================================================================
   Screenshots / phone mockups
   =================================================================== */

.screenshots {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.screenshots::-webkit-scrollbar {
  height: 6px;
}
.screenshots::-webkit-scrollbar-track {
  background: var(--bg2);
  border-radius: 3px;
}
.screenshots::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.phone-frame {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 9 / 19.5;
  border-radius: 30px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, var(--bg2), var(--bg1));
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
}

.phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 27px;
}

/* Placeholder gradient when no screenshot is loaded */
.phone-frame--placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 27px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 40%,
    transparent 70%
  );
}

.screenshots--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  overflow: visible;
}

.screenshots--grid .phone-frame {
  width: 100%;
}

/* ===================================================================
   Footer
   =================================================================== */

.sitefoot {
  border-top: 1px solid var(--stroke);
  padding: 32px 0;
  margin-top: 40px;
}

.sitefoot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--dim);
}

.sitefoot__links {
  display: flex;
  gap: 20px;
}

.sitefoot__links a {
  color: var(--muted);
  transition: color 0.2s;
}
.sitefoot__links a:hover {
  color: var(--text);
}

/* ===================================================================
   Utilities
   =================================================================== */

.muted { color: var(--muted); }
.dim   { color: var(--dim); }
.mono  { font-family: var(--mono); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--mono);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  color: var(--muted);
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.code {
  background: var(--card2);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
}

.code pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.code__title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke);
}

/* ===================================================================
   Animations
   =================================================================== */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================================================
   Responsive -- 980px
   =================================================================== */

@media (max-width: 980px) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section__grid {
    grid-template-columns: 1fr;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero--app {
    text-align: center;
  }

  .hero--app .lede {
    margin: 0 auto;
  }

  .hero--app .hero__actions {
    justify-content: center;
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .cols {
    grid-template-columns: 1fr;
  }
}

/* ===================================================================
   Responsive -- 640px
   =================================================================== */

@media (max-width: 640px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .top__nav {
    display: none;
  }

  .hero {
    padding: 64px 0 48px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 40px 0;
  }

  .download__box {
    padding: 32px 24px;
  }

  .sitefoot__inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .phone-frame {
    width: 180px;
  }
}

/* ===================================================================
   Reduced motion
   =================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .hero__word {
    opacity: 1;
    transform: none;
  }
}
