/* ==========================================================================
   Dr Gaffar Ali — Apple-inspired portfolio
   Light, product-first design using the Apple system type stack.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-secondary: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --blue: #0071e3;
  --blue-btn: #0071e3;
  --blue-hover: #0077ed;
  --link: #06c;

  /* Surfaces (cards, inputs, chips) and translucent chrome */
  --surface: #ffffff;
  --field-bg: #ffffff;
  --chip: #f5f5f7;
  --icon-bg: #ececf0;
  --hairline: rgba(0, 0, 0, 0.08);
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-bg-solid: rgba(255, 255, 255, 0.94);
  --overlay-bg: rgba(255, 255, 255, 0.97);
  --toolbar-bg: rgba(245, 245, 247, 0.9);
  --showcase-bg:
    radial-gradient(70% 100% at 50% 0%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(135deg, #f5f5f7 0%, #edf4ff 52%, #f8f1ff 100%);
  --success: #1a7f37;
  --danger: #d70015;
  --warn: #b25000;

  --container: 1120px;
  --radius: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.09);
}

/* ---------- Dark mode (follows the system setting) ----------
   Add data-theme="light" to <html> to keep a page light. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-secondary: #0f0f11;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --muted-2: #98989d;
    --line: #38383a;
    --line-soft: #2c2c2e;
    --blue: #2997ff;
    --blue-btn: #0071e3;
    --blue-hover: #0a7cf0;
    --link: #2997ff;

    --surface: #1c1c1e;
    --field-bg: #232326;
    --chip: #2c2c2e;
    --icon-bg: #2c2c2e;
    --hairline: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(0, 0, 0, 0.72);
    --header-bg-solid: rgba(0, 0, 0, 0.9);
    --overlay-bg: rgba(0, 0, 0, 0.96);
    --toolbar-bg: rgba(15, 15, 17, 0.88);
    --showcase-bg:
      radial-gradient(70% 100% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
      linear-gradient(135deg, #17171a 0%, #101a2b 52%, #1c1528 100%);
    --success: #30d158;
    --danger: #ff453a;
    --warn: #ff9f0a;
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 18px 44px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
em { font-style: normal; }

::selection {
  background: rgba(0, 113, 227, 0.2);
  color: var(--text);
}

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.apple-mark,
.github-mark {
  fill: currentColor;
  stroke: none;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--blue-btn);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 980px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}

.btn--primary {
  background: var(--blue-btn);
  color: #fff;
}
.btn--primary:hover { background: var(--blue-hover); }
.btn--primary:active { background: #006edb; }

.btn--link {
  padding: 12px 6px;
  background: none;
  border: 0;
  color: var(--link);
}
.btn--link:hover { text-decoration: underline; }

.btn--glass {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn--glass:hover { border-color: var(--muted-2); }

.btn--nav {
  padding: 7px 15px;
  background: var(--blue-btn);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.btn--nav:hover { background: var(--blue-hover); }

.btn--sm { padding: 9px 17px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.chev {
  font-size: 1.2em;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-1px);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--hairline);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: var(--header-bg-solid);
  box-shadow: 0 1px 14px rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-header .brand {
  position: relative;
  z-index: 120;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
  min-width: 0;
}

.brand-text strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-list { display: flex; align-items: center; gap: 2px; }

.nav-link {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  opacity: 0.86;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-link:hover { opacity: 1; background: var(--bg-secondary); }
.nav-link.is-active { opacity: 1; font-weight: 500; }

.nav-foot { display: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--blue);
}

.availability .status-dot { background: #30d158; }

.nav-toggle {
  position: relative;
  z-index: 120;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 148px 0 84px;
  overflow: hidden;
  background: var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(52% 46% at 50% -6%, rgba(0, 113, 227, 0.07), transparent 70%),
    radial-gradient(34% 34% at 88% 8%, rgba(175, 82, 222, 0.05), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.hero-tagline {
  margin-top: 8px;
  color: var(--blue);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.022em;
}

.hero-lead {
  max-width: 640px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.52;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
}

.hero-showcase {
  position: relative;
  max-width: 1060px;
  margin: 54px auto 0;
  padding: 44px 42px 28px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 32px;
  background: var(--showcase-bg);
  box-shadow: 0 36px 80px -58px rgba(0, 0, 0, 0.45);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: 26px;
}

.showcase-icon {
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: 22px;
  transition: transform 0.3s var(--ease);
}
a.showcase-icon:hover { transform: translateY(-4px) scale(1.04); }

.showcase-icon img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: var(--icon-bg);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

.showcase-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.showcase-caption .icon {
  width: 14px;
  height: 14px;
  color: var(--text);
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: 100px 0;
  scroll-margin-top: 64px;
}

#projects { background: var(--bg-secondary); }
#about { background: var(--bg); }
#contact { background: var(--bg-secondary); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.label-dot { display: none; }

.section-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.section-title:focus-visible { outline-offset: 8px; }

.grad-text {
  color: var(--blue);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.section-note {
  margin: 16px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.section-head {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 48px;
}

.section-head-side {
  justify-self: end;
  max-width: 46ch;
}

.section-head > .section-note {
  justify-self: end;
  max-width: 46ch;
  margin-top: 0;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 14px;
  color: var(--link);
  font-size: 16px;
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

/* ---------- App cards ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

.projects-grid > .project-card { grid-column: span 2; }
.projects-grid > .app-card--featured { grid-column: span 3; }

.project-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.app-card { display: flex; flex-direction: column; }

.app-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.app-icon {
  width: 72px;
  height: 72px;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--icon-bg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  object-fit: cover;
}

.app-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.status .status-dot {
  width: 6px;
  height: 6px;
  background: var(--blue);
  box-shadow: none;
  animation: none;
}

.status--review .status-dot { background: #ff9f0a; }
.status--development .status-dot,
.status--planned .status-dot { background: var(--muted-2); }

.app-platform {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
}

.app-version {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.app-version[hidden] { display: none; }

.app-apple {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted-2);
  opacity: 0.7;
}

.app-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.016em;
}

.project-card > p {
  min-height: 4.4em;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
}

.tags li {
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

.app-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--link);
  font-size: 14px;
  font-weight: 500;
}

.app-link .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.25s var(--ease);
}

.app-link--pending { color: var(--muted-2); font-weight: 400; }

.app-icon--placeholder {
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
}

.project-card:hover .app-link .icon { transform: translate(2px, -2px); }

.apps-note {
  margin-top: 18px;
  max-width: 80ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.apps-note a { color: var(--link); text-decoration: underline; }

#apps-grid .apps-note {
  grid-column: 1 / -1;
  margin: 0;
}

.project-card:not(a) { cursor: default; }

/* Featured cards: larger, with App Store screenshots peeking from the bottom */
.app-card--featured { padding: 32px 32px 0; }
.app-card--featured h3 { font-size: 28px; letter-spacing: -0.022em; }
.app-card--featured > p { min-height: 0; max-width: 46ch; font-size: 16px; }
.app-card--featured .app-link { margin-top: 0; padding-top: 18px; justify-content: flex-start; }

.app-shots {
  display: flex;
  justify-content: center;
  gap: 14px;
  height: 250px;
  margin-top: auto;
  padding-top: 28px;
  box-sizing: content-box;
  overflow: hidden;
}

.app-shots:empty { display: none; }
.app-card--featured:has(.app-shots:empty) { padding-bottom: 32px; }

.app-shot {
  flex: 0 1 calc((100% - 28px) / 3);
  min-width: 0;
  align-self: flex-start;
  aspect-ratio: 9 / 19.5;
  border: 1px solid var(--hairline);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--chip);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  object-fit: cover;
  object-position: top;
  transition: transform 0.45s var(--ease);
}

.app-card--featured:hover .app-shot { transform: translateY(-6px); }

/* ---------- Support (Buy Me a Coffee) ---------- */
.support-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 40px;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.support-card[hidden] { display: none; }

.support-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  background: var(--chip);
  font-size: 26px;
  line-height: 1;
}

.support-copy { flex: 1; min-width: 0; }

.support-copy h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.support-copy p {
  margin-top: 3px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.btn--coffee {
  flex: none;
  background: #ffdd00;
  color: #1d1d1f;
  font-size: 15px;
}
.btn--coffee:hover { background: #ffe433; }

/* Header coffee button: pill with label on wide screens, just the cup on phones */
.header-coffee {
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
}

.header-coffee > span[aria-hidden] { font-size: 15px; line-height: 1; }

.latest-updates {
  margin-top: 56px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.latest-updates[hidden] { display: none; }

.latest-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
}

.latest-head .section-label { margin: 0 0 5px; }

.latest-head h3 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.latest-head .section-link { margin: 0; }

.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.update-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.update-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.update-icon {
  width: 50px;
  height: 50px;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--icon-bg);
  object-fit: cover;
}

.update-copy { min-width: 0; flex: 1; }

.update-category {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.update-copy strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 12px;
}

.update-arrow {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--muted-2);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.update-card:hover .update-arrow {
  color: var(--blue);
  transform: translate(1px, -1px);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}

.about-intro .section-title {
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
}

.about-intro .section-note { max-width: 36ch; }

.about-person {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 8px 16px 8px 8px;
  border-radius: 980px;
  background: var(--bg-secondary);
  transition: background-color 0.2s var(--ease);
}
.about-person:hover { background: var(--line-soft); }

.about-person img {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  background: var(--chip);
  object-fit: cover;
}

.about-person strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.about-person small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.about-person .chev { color: var(--muted-2); }

.about-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.about-copy p:last-child { margin-bottom: 0; }
.about-copy em { color: var(--text); }

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  margin-top: 56px;
}

.focus-card {
  position: relative;
  display: block;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: none;
}

.focus-card:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.focus-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--blue);
}

.focus-icon .icon { width: 25px; height: 25px; }
.focus-icon--violet,
.focus-icon--teal { color: var(--blue); background: none; border: 0; }

.focus-card h3 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.focus-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.focus-num {
  position: absolute;
  top: 20px;
  right: 0;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-copy .section-title { font-size: clamp(2rem, 3.8vw, 3.1rem); }

.contact-list { margin-top: 32px; }

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.contact-row:first-child { border-top: 1px solid var(--line); }

.contact-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 0;
  background: none;
  color: var(--blue);
}
.contact-icon .icon { width: 19px; height: 19px; }

.contact-info { min-width: 0; }

.contact-k {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
}

.contact-v {
  display: block;
  margin-top: 1px;
  color: var(--text);
  font-size: 16px;
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease);
}

a.contact-v:hover { color: var(--link); }

.contact-v--link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-external {
  width: 12px;
  height: 12px;
  color: var(--muted-2);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact-v--link:hover .contact-external {
  color: var(--link);
  transform: translate(1px, -1px);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.copy-btn .icon { width: 12px; height: 12px; }
.copy-btn:hover { border-color: var(--muted-2); background: var(--bg-secondary); }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }

/* ---------- Form ---------- */
.form-panel {
  padding: 36px;
  border: 0;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.form-head { margin-bottom: 24px; }

.form-head h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.form-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted-2); }

.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--muted-2); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.field textarea {
  resize: vertical;
  min-height: 118px;
}

.select-wrap { position: relative; }

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.field select option { background: var(--field-bg); color: var(--text); }

.select-arrow {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.field-error {
  margin-top: 5px;
  max-height: 0;
  overflow: hidden;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.2s var(--ease), max-height 0.2s var(--ease);
}

.field.has-error input,
.field.has-error textarea { border-color: var(--danger); }

.field.has-error input:focus,
.field.has-error textarea:focus { box-shadow: 0 0 0 3px rgba(215, 0, 21, 0.12); }

.field.has-error .field-error { opacity: 1; max-height: 44px; }

.form-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.form-note a { color: var(--link); text-decoration: underline; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.2em;
  margin-top: 10px;
  color: var(--success);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.form-status.is-error { color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.brand--footer { gap: 8px; }
.brand--footer .brand-mark { width: 26px; height: 26px; border-radius: 7px; font-size: 9px; }
.brand--footer .brand-text strong { font-size: 13px; }
.brand--footer .brand-text small { font-size: 11px; color: var(--muted); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s var(--ease);
}

.footer-links a:hover { color: var(--link); }

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s var(--ease);
}
.footer-top .icon { width: 12px; height: 12px; transform: rotate(180deg); }
.footer-top:hover { color: var(--link); }

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  border-radius: 99px;
  background: var(--line);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .section { padding: 84px 0; }

  .projects-grid > .project-card { grid-column: span 3; }
  .projects-grid > .app-card--featured { grid-column: 1 / -1; }
  .project-card > p { min-height: 3.3em; }
  .app-card--featured > p { min-height: 0; }

  .section-head {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 36px;
  }

  .section-head-side,
  .section-head > .section-note {
    justify-self: start;
    max-width: 56ch;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-intro { position: static; }

  .showcase-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .hero-showcase { padding: 36px 32px 24px; }

  .focus-grid { margin-top: 40px; }
}

@media (max-width: 900px) {
  .header-cta { display: none; }
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 92px 28px 44px;
    background: var(--overlay-bg);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
                visibility 0.3s var(--ease);
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Removing the header blur while open keeps the fixed overlay sized to
     the viewport instead of the header. */
  body.menu-open .site-header,
  body.menu-open .site-header.is-scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav-list {
    flex-direction: column;
    gap: 2px;
    text-align: center;
  }

  .nav-link {
    padding: 8px 18px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    opacity: 1;
  }

  .nav-link:hover { background: transparent; }
  .nav-link.is-active { color: var(--blue); }

  .nav-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: min(100%, 320px);
    margin-top: 4px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }

  .availability {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  .nav-foot .btn { width: 100%; }
}

@media (max-width: 700px) {
  .container { width: calc(100% - 36px); }

  .hero { padding: 118px 0 66px; }
  .hero-title { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .hero-tagline { font-size: clamp(1.45rem, 7vw, 1.9rem); }
  .hero-lead { font-size: 17px; margin-top: 18px; }
  .hero-showcase { margin-top: 38px; padding: 26px 20px 20px; border-radius: 24px; }
  .showcase-grid { gap: 16px; }
  .showcase-icon img { width: 68px; height: 68px; border-radius: 16px; }
  .showcase-caption { margin-top: 20px; font-size: 12px; }

  .section { padding: 72px 0; }
  .projects-grid { gap: 12px; }
  .projects-grid > .project-card { grid-column: 1 / -1; }
  .project-card > p { min-height: 0; }

  .project-card { padding: 24px; border-radius: 22px; }
  .app-icon { width: 64px; height: 64px; border-radius: 16px; }
  .app-card h3 { font-size: 21px; }

  .app-card--featured { padding: 24px 24px 0; }
  .app-card--featured h3 { font-size: 24px; }
  .app-card--featured:has(.app-shots:empty) { padding-bottom: 24px; }
  .app-shots { height: 210px; gap: 10px; padding-top: 22px; }
  .app-shot { flex-basis: calc((100% - 20px) / 3); border-radius: 14px 14px 0 0; }

  /* Other apps collapse to compact rows: icon, name, two lines of copy. */
  .app-card:not(.app-card--featured) {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 16px;
    border-radius: 18px;
  }
  .app-card:not(.app-card--featured) .app-head { display: contents; }
  .app-card:not(.app-card--featured) .app-icon {
    grid-row: 1 / span 3;
    width: 52px;
    height: 52px;
    border-radius: 13px;
    box-shadow: none;
  }
  .app-card:not(.app-card--featured) .app-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
  }
  .app-card:not(.app-card--featured) .status { font-size: 11px; }
  .app-card:not(.app-card--featured) .status .status-dot,
  .app-card:not(.app-card--featured) .app-version,
  .app-card:not(.app-card--featured) .app-apple,
  .app-card:not(.app-card--featured) .tags,
  .app-card:not(.app-card--featured) .app-link { display: none; }
  .app-card:not(.app-card--featured) h3 { margin: 3px 0 2px; font-size: 17px; }
  .app-card:not(.app-card--featured) > p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .latest-updates { margin-top: 44px; padding-top: 30px; }
  .latest-head h3 { font-size: 23px; }
  .updates-grid { grid-template-columns: 1fr; }

  .focus-grid { grid-template-columns: 1fr; gap: 0; }
  .focus-card { padding: 20px 0; border-top: 1px solid var(--line); }
  .focus-card:last-child { border-bottom: 1px solid var(--line); }
  .focus-num { top: 20px; }

  .contact-row { flex-wrap: wrap; }
  .copy-btn { margin-left: auto; }

  .support-card { flex-wrap: wrap; padding: 20px; }
  .support-copy { flex-basis: calc(100% - 70px); }
  .support-card .btn--coffee { width: 100%; }

  .form-panel { padding: 24px; border-radius: 22px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-top { display: none; }
}

@media (max-width: 520px) {
  .brand-text small { display: none; }
  .header-coffee-label { display: none; }
  .header-coffee { padding: 8px 11px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .btn--link { width: auto; }
  .hero-showcase { padding: 22px 16px 18px; }
  .showcase-icon img { width: 56px; height: 56px; border-radius: 14px; }
  .showcase-grid { gap: 12px; }
  .showcase-caption { font-size: 12px; }

  .section-title { font-size: clamp(1.8rem, 8.5vw, 2.4rem); }
  .section-note { font-size: 16px; }

  .app-head { gap: 12px; }
  .app-apple { display: none; }
  .tags li { font-size: 11.5px; }

  .contact-icon { width: 22px; height: 22px; }
  .contact-v { font-size: 15px; }

  .form-panel { padding: 20px; }
  .form-head h3 { font-size: 22px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1; transform: none; }
}
