/* ==========================================================================
   Services page (services.html) — loaded after style.css and home-dark.css.
   Uses the shared palette variables; only page-specific components live here.
   ========================================================================== */

:root {
  --svc-surface: rgba(255, 255, 255, 0.03);
  --svc-surface-2: rgba(255, 255, 255, 0.06);
  --svc-link: #9fb6e8;
  --svc-ok: #6cc7a0;
  --svc-plate: #f3f4fa;
  --svc-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

.services-page section { padding: 96px 0; }
.services-page .section-header { max-width: 640px; margin-bottom: 48px; text-align: left; }
.services-page .section-header.text-center { margin-inline: auto; text-align: center; }
.services-page .section-header h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; margin-bottom: 12px; text-wrap: balance; }
.services-page .section-header p { color: var(--color-text-light); font-size: 17px; }

/* ---------- Hero ---------- */
#hero.services-hero { padding: 150px 0 80px; }
#hero.services-hero h1 { font-size: clamp(36px, 4.6vw, 54px); line-height: 1.12; }
#hero.services-hero h1 span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#hero.services-hero .hero-subtitle { max-width: 56ch; }
.hero-meta { margin-top: 30px; display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: var(--color-text-muted); }
.hero-meta strong { color: var(--color-text); font-weight: 500; }
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--svc-ok); box-shadow: 0 0 0 4px rgba(108, 199, 160, 0.18); }

/* Ops board: a GNOME terminal window */
.ops-wrap { position: relative; padding-bottom: 30px; }
.ops-board {
  background: #0b0d1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: var(--svc-mono);
  font-size: 13px;
  overflow: hidden;
}
.ops-head {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  background: #1c1f36;
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  color: #e8eaf6;
}
.ops-title { text-align: center; font-family: "Jost", sans-serif; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-menu { width: 26px; height: 26px; display: grid; place-items: center; color: #c9cce3; font-size: 18px; }
.ops-wm { display: flex; gap: 12px; }
.ops-wm span { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.10); display: grid; place-items: center; color: #e8eaf6; font-size: 13px; }
.ops-body { padding: 14px 16px 16px; }
.ops-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); align-items: baseline; }
.ops-row:last-child { border-bottom: 0; }
.ops-key { color: var(--color-text-muted); }
.ops-key::before { content: "$ "; color: var(--color-primary-light); }
.ops-val { color: #e8eaf6; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ops-val.ok { color: var(--svc-ok); }
.ops-val small { color: var(--color-text-muted); font-weight: 400; }
.ops-foot { padding: 10px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); color: var(--color-text-muted); font-size: 12px; display: flex; gap: 6px; }
.ops-foot .cursor::after { content: "▍"; color: var(--svc-ok); animation: svc-blink 1.1s steps(1) infinite; }
.tux { position: absolute; right: 18px; bottom: 0; width: 66px; height: auto; z-index: 2; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
@keyframes svc-blink { 50% { opacity: 0; } }

/* ---------- Services grid ---------- */
#services { background: radial-gradient(700px 420px at 85% 0%, rgba(130, 106, 173, 0.12), transparent 65%), var(--color-bg); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card {
  background: var(--svc-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 30px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.service-card:hover { border-color: rgba(130, 106, 173, 0.45); transform: translateY(-3px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.service-card .feature-icon { margin: 0; width: 52px; height: 52px; }
.service-card .feature-icon i { font-size: 24px; color: #fff; }
.service-card h3 { font-size: 19px; font-weight: 600; margin: 0; }
.service-card p { color: var(--color-text-light); font-size: 15px; margin: 0; }
.service-card ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.service-card li { font-size: 12.5px; padding: 4px 10px; border-radius: 6px; background: var(--svc-surface-2); color: var(--color-text); font-weight: 500; }

/* ---------- Selected work ---------- */
#work { background: radial-gradient(600px 380px at 15% 10%, rgba(79, 125, 191, 0.10), transparent 65%), var(--color-bg-alt); }
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.work-grid.compact { grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
.case {
  background: var(--svc-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px 30px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.case:hover { border-color: rgba(79, 125, 191, 0.45); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.case.wide { grid-column: 1 / -1; }
.case-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.case-brand { display: flex; align-items: center; gap: 14px; }
.case-logo { height: 52px; min-width: 52px; padding: 8px 14px; border-radius: 10px; background: var(--svc-plate); display: grid; place-items: center; }
.case-logo img { height: 100%; max-height: 36px; width: auto; max-width: 150px; display: block; }
.case-logo.text { font-family: "Poppins", sans-serif; font-weight: 700; color: #0f1124; font-size: 15px; letter-spacing: 0.02em; }
.case-top h3 { font-size: 19px; font-weight: 600; margin: 0; }
.case-when { font-family: var(--svc-mono); font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.case-role { color: var(--svc-link); font-size: 14px; font-weight: 500; }
.case p { color: var(--color-text-light); font-size: 15px; margin: 0; }
.case ul { margin: 4px 0 0; padding-left: 18px; color: var(--color-text); font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.case ul li::marker { color: var(--color-accent); }
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.case-tags span { font-family: var(--svc-mono); font-size: 11.5px; padding: 3px 9px; border-radius: 5px; background: rgba(79, 125, 191, 0.14); color: var(--svc-link); }
.work-grid.compact .case { padding: 24px; }
.work-grid.compact .case-top h3 { font-size: 16px; }
.work-grid.compact .case-logo { height: 44px; padding: 6px 12px; }
.work-grid.compact .case-logo img { max-height: 28px; max-width: 96px; }
.industries { margin-top: 40px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.industries .label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-muted); font-weight: 600; }
.industries ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; }
.industries li { font-size: 14px; color: var(--color-text-light); }
.industries li + li::before { content: "·"; margin: 0 10px; color: var(--color-accent); }

/* ---------- Open source ---------- */
#oss { padding-top: 80px; padding-bottom: 80px; }
.oss-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.oss { border-left: 2px solid var(--color-primary-light); padding: 4px 0 4px 20px; display: flex; flex-direction: column; gap: 8px; }
.oss:nth-child(2) { border-color: var(--color-accent); }
.oss:nth-child(3) { border-color: var(--svc-link); }
.oss h3 { font-family: var(--svc-mono); font-size: 15px; font-weight: 500; margin: 0; }
.oss p { font-size: 14.5px; color: var(--color-text-light); margin: 0; }
.oss-meta { font-family: var(--svc-mono); font-size: 12px; color: var(--color-text-muted); }

/* ---------- Timeline ---------- */
#track { padding-bottom: 72px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; margin-top: 8px; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: linear-gradient(90deg, rgba(79, 125, 191, 0.7), rgba(130, 106, 173, 0.7)); }
.tl-item { position: relative; padding-top: 24px; }
.tl-item::before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--color-bg); border: 3px solid var(--color-primary-light); }
.tl-item:nth-child(even)::before { border-color: var(--color-accent); }
.tl-year { font-family: var(--svc-mono); font-size: 12px; color: var(--color-text-muted); }
.tl-item h4 { font-size: 15px; font-weight: 600; margin: 4px 0 2px; }
.tl-item p { font-size: 13px; color: var(--color-text-light); line-height: 1.5; margin: 0; }

/* ---------- Principles ---------- */
#how { background: var(--color-bg-alt); }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.principle { border-top: 2px solid transparent; border-image: var(--gradient-accent) 1; padding-top: 18px; }
.principle h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.principle p { font-size: 15px; color: var(--color-text-light); margin: 0; }
.principle q { display: block; margin-top: 12px; font-size: 14px; color: var(--svc-link); font-style: italic; quotes: "“" "”"; }
.principle cite { display: block; font-style: normal; font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; }
.aside-note { margin-top: 36px; font-size: 14px; color: var(--color-text-muted); max-width: 70ch; }

/* ---------- Recommendations ---------- */
.rec-fixed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.rec {
  background: var(--svc-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 34px 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.rec::before { content: "“"; position: absolute; top: 6px; left: 22px; font-family: "Poppins", sans-serif; font-size: 80px; line-height: 1; color: rgba(130, 106, 173, 0.28); }
.rec blockquote { margin: 0; font-size: 15.5px; color: var(--color-text); position: relative; }
.rec footer { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--color-border); }
.rec .who { font-family: "Poppins", sans-serif; font-weight: 600; color: #f0f1fa; font-size: 14.5px; }
.rec .role { font-size: 13px; color: var(--color-text-muted); }
.rec-more { margin-top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rec-more h3 { font-size: 20px; font-weight: 600; margin: 0; }
.carousel-nav { display: flex; align-items: center; gap: 12px; }
.carousel-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.22); background: transparent; color: #e8eaf6; cursor: pointer; display: grid; place-items: center; font-size: 20px; transition: background 0.25s, border-color 0.25s; }
.carousel-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.5); }
.carousel-btn:focus-visible { outline: 2px solid var(--svc-link); outline-offset: 3px; }
.carousel-count { font-family: var(--svc-mono); font-size: 13px; color: var(--color-text-muted); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.rec-scroller {
  margin-top: 18px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 3);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.rec-scroller::-webkit-scrollbar { display: none; }
.rec-scroller:focus-visible { outline: 2px solid var(--svc-link); outline-offset: 6px; border-radius: 8px; }
.rec-scroller .rec { scroll-snap-align: start; padding: 28px 24px 20px; }
.rec-scroller .rec::before { font-size: 64px; top: 4px; left: 18px; }
.rec-scroller .rec blockquote { font-size: 14.5px; color: var(--color-text-light); }
.rec-source { margin-top: 28px; font-size: 14px; color: var(--color-text-muted); text-align: center; }

/* ---------- Toolbox ---------- */
#stack { padding-top: 72px; }
.stack-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 32px; }
.stack-group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-muted); font-weight: 600; margin-bottom: 12px; }
.stack-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stack-group li { font-size: 14px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--svc-surface-2); border: 1px solid transparent; transition: border-color 0.25s; }
.stack-group li:hover { border-color: rgba(159, 182, 232, 0.4); }

/* ---------- CTA + footer tweaks ---------- */
#contact.cta-section { padding-top: 0; }
.services-page .cta-card { background: var(--gradient-brand); }
.services-page .btn-white { background: #fff; color: var(--color-primary-light); padding: 13px 28px; border-radius: 50px; font-weight: 600; font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.services-page .btn-white:hover { color: var(--color-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid, .work-grid.compact, .oss-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .stack-groups { grid-template-columns: repeat(2, 1fr); }
  .rec-fixed { grid-template-columns: 1fr; }
  .rec-scroller { grid-auto-columns: calc((100% - 16px) / 2); }
  .timeline { grid-template-columns: 1fr; gap: 18px; padding-left: 24px; }
  .timeline::before { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(180deg, rgba(79, 125, 191, 0.7), rgba(130, 106, 173, 0.7)); }
  .tl-item { padding-top: 0; }
  .tl-item::before { left: -24px; top: 4px; }
  .ops-wrap { margin-top: 40px; }
}
@media (max-width: 600px) {
  .services-page section { padding: 72px 0; }
  .services-grid, .principles, .stack-groups { grid-template-columns: 1fr; }
  .rec-scroller { grid-auto-columns: 100%; }
  .rec { padding: 28px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .rec-scroller { scroll-behavior: auto; }
  .ops-foot .cursor::after { animation: none; }
}
