/* =========================================================
   Scenarium Ideale — stylesheet
   Mobile-first. CSS custom properties only. No preprocessor.
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --border: #ececec;
  --text: #1a1a1a;
  --muted: #6e6e6e;
  --accent: #1d9e75;
  --accent-fg: #ffffff;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Outfit", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: 3.052rem;
  --step-6: 3.815rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

  --t: 150ms ease;

  --sidebar-w: 280px;
  --content-max: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #161618;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f2f3;
    --muted: rgba(242, 242, 243, 0.55);
    --accent: #5dcaa5;
    --accent-fg: #0b0b0c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t), opacity var(--t);
}

a:hover {
  color: var(--accent);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ----- Focus ------------------------------------------------ */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: var(--space-3) var(--space-4);
  z-index: 100;
  font-weight: 500;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* ----- Typography ------------------------------------------ */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw + 1rem, var(--step-6));
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-5);
  color: var(--text);
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw + 0.5rem, var(--step-4));
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 var(--space-4);
}

.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-2);
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 var(--space-6);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--step--1);
}

p {
  margin: 0 0 var(--space-4);
  max-width: 68ch;
}

p:last-child {
  margin-bottom: 0;
}

/* ----- App layout ------------------------------------------ */
.app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.sidebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: -0.005em;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.brand-text {
  display: none;
}

/* Mobile: compact symbol only. Desktop: full brand lockup. */
.brand-lockup {
  display: none;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-2);
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.nav a.is-active {
  color: var(--text);
  background: var(--bg);
}

.sidebar-foot {
  display: flex;
  align-items: center;
}
.sidebar-foot > p {
  display: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.lang-btn {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
}
.lang-btn:hover {
  color: var(--text);
}
.lang-btn.is-active {
  color: var(--accent);
}
.lang-sep {
  color: var(--border);
}

.content {
  padding: var(--space-6) var(--space-4) var(--space-9);
  max-width: 100%;
  outline: none;
}

.content > .view {
  max-width: var(--content-max);
  margin: 0 auto;
}

.view[hidden] {
  display: none;
}

/* ----- Hero & blocks --------------------------------------- */
.hero {
  padding: var(--space-7) 0 var(--space-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.page-head {
  padding: var(--space-7) 0 var(--space-7);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-7);
}

.block {
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--border);
}

.block:last-of-type {
  border-bottom: 0;
}

.block-head {
  margin-bottom: var(--space-5);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

/* ----- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.25rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color var(--t), opacity var(--t);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.btn-primary:hover {
  color: var(--accent-fg);
  opacity: 0.9;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--accent);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ----- Services list --------------------------------------- */
.services {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.service {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: color var(--t);
}

.service:hover {
  color: var(--text);
}

.service h3 {
  margin-bottom: var(--space-2);
}

.service p {
  color: var(--muted);
  margin: 0;
}

/* ----- Process steps --------------------------------------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.step {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.step p {
  color: var(--muted);
  margin: 0;
}

/* ----- Filters --------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.chip {
  padding: 0.5rem 0.875rem;
  font-size: var(--step--1);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  transition: color var(--t), opacity var(--t);
}

.chip:hover {
  color: var(--text);
}

.chip.is-active {
  color: var(--accent-fg);
  background: var(--accent);
  border-color: var(--accent);
}

/* ----- Projects grid --------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  min-height: 200px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: color var(--t), opacity var(--t);
}

.project-card:hover {
  color: var(--text);
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-cat {
  font-weight: 500;
}

.project-card h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
}

.project-card p {
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.project-results {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.project-results li {
  font-size: var(--step--1);
  padding: 0.25rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

/* ----- Project detail (presentation page) ------------------ */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--space-5);
}
.detail-back:hover {
  color: var(--accent);
}

.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-6);
}
.feature-list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.detail-results {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.detail-results li {
  font-size: var(--step--1);
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

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

.project-link {
  margin-top: auto;
  align-self: flex-start;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.project-link:hover {
  color: var(--accent);
}

.project-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  grid-column: 1 / -1;
}

/* Skeleton loaders */
.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skeleton-bar {
  background: var(--border);
  border-radius: var(--radius-sm);
  height: 12px;
  position: relative;
  overflow: hidden;
  opacity: 0.7;
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-bar.long { width: 80%; }
.skeleton-bar.mid  { width: 60%; }
.skeleton-bar.short { width: 40%; }
.skeleton-bar.tall { height: 28px; width: 70%; }

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; }
}

/* ----- Form ------------------------------------------------ */
.form {
  max-width: 640px;
  display: grid;
  gap: var(--space-5);
}

/* Spam honeypot — hidden from people, present for bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--t), opacity var(--t);
  font-family: var(--font-body);
}

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

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

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #c9514c;
}

.error {
  margin: 0;
  color: #c9514c;
  font-size: var(--step--1);
}

.form-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.form-status {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.form-status.is-success {
  color: var(--accent);
}

.form-status.is-error {
  color: #c9514c;
}

/* ----- Tablet ---------------------------------------------- */
@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }

  .content {
    padding: var(--space-7) var(--space-6) var(--space-9);
  }
}

/* ----- Desktop --------------------------------------------- */
@media (min-width: 1200px) {
  .app {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    border-top: 0;
    border-right: 1px solid var(--border);
    overflow: hidden;
  }

  .sidebar-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--space-7) var(--space-6);
    height: 100%;
    gap: var(--space-7);
  }

  .brand {
    font-size: var(--step-1);
  }

  .brand {
    display: block;
  }
  .brand-mark {
    display: none;
  }
  .brand-lockup {
    display: block;
    width: 100%;
  }
  .brand-lockup svg {
    width: 100%;
    height: auto;
    display: block;
  }

  .nav ul {
    flex-direction: column;
    gap: var(--space-1);
  }

  .nav a {
    width: 100%;
    padding: var(--space-3) var(--space-3);
    font-size: var(--step-0);
    color: var(--muted);
    border-radius: var(--radius-sm);
  }

  .nav a:hover {
    color: var(--text);
  }

  .nav a.is-active {
    color: var(--accent-fg);
    background: var(--accent);
  }

  .sidebar-foot {
    display: block;
    margin-top: auto;
  }
  .sidebar-foot > p {
    display: block;
  }
  .lang-switch {
    margin-bottom: var(--space-3);
  }

  .content {
    grid-column: 2;
    padding: var(--space-9) var(--space-8) var(--space-9);
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }

  .project-card.is-featured {
    grid-column: span 2;
  }

  .services {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================================
   PDA sub-project
   ========================================================= */

.pda-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  max-width: var(--content-max);
  margin: 0 auto;
}

.pda-shell[hidden] {
  display: none;
}

/* ----- PDA tones (accent map) ------------------------------ */
.pda-shell {
  --tone-blue-fg: #3b82f6;
  --tone-blue-bg: rgba(59, 130, 246, 0.08);
  --tone-green-fg: #22a06b;
  --tone-green-bg: rgba(34, 160, 107, 0.08);
  --tone-purple-fg: #8b5cf6;
  --tone-purple-bg: rgba(139, 92, 246, 0.08);
  --tone-orange-fg: #f59e0b;
  --tone-orange-bg: rgba(245, 158, 11, 0.1);
  --tone-indigo-fg: #6366f1;
  --tone-indigo-bg: rgba(99, 102, 241, 0.08);
}

@media (prefers-color-scheme: dark) {
  .pda-shell {
    --tone-blue-fg: #6ea8fe;
    --tone-blue-bg: rgba(110, 168, 254, 0.1);
    --tone-green-fg: #4cc38a;
    --tone-green-bg: rgba(76, 195, 138, 0.1);
    --tone-purple-fg: #b28bff;
    --tone-purple-bg: rgba(178, 139, 255, 0.1);
    --tone-orange-fg: #fbbf24;
    --tone-orange-bg: rgba(251, 191, 36, 0.12);
    --tone-indigo-fg: #8b8df5;
    --tone-indigo-bg: rgba(139, 141, 245, 0.1);
  }
}

[data-tone="blue"] { --tone-fg: var(--tone-blue-fg); --tone-bg: var(--tone-blue-bg); }
[data-tone="green"] { --tone-fg: var(--tone-green-fg); --tone-bg: var(--tone-green-bg); }
[data-tone="purple"] { --tone-fg: var(--tone-purple-fg); --tone-bg: var(--tone-purple-bg); }
[data-tone="orange"] { --tone-fg: var(--tone-orange-fg); --tone-bg: var(--tone-orange-bg); }
[data-tone="indigo"] { --tone-fg: var(--tone-indigo-fg); --tone-bg: var(--tone-indigo-bg); }

/* ----- PDA sub-navigation ---------------------------------- */
.pda-subnav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}

.pda-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.pda-back:hover {
  color: var(--accent);
}

.pda-tabs-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.pda-tabs-nav a {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  color: var(--muted);
  border: 1px solid transparent;
}

.pda-tabs-nav a:hover {
  color: var(--text);
}

.pda-tabs-nav a.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

/* ----- PDA inner tabs (within Management/Application) ------ */
.pda-inner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.pda-inner-tabs a {
  padding: 0.625rem 0.875rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.pda-inner-tabs a:hover {
  color: var(--text);
}

.pda-inner-tabs a.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  border-radius: 0;
}

.pda-tab-panel[hidden] {
  display: none;
}

/* ----- Orchestra banner ------------------------------------ */
.orchestra-banner {
  position: relative;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-7);
}

.orchestra-banner .eyebrow {
  margin-bottom: var(--space-2);
}

.orchestra-banner h2 {
  margin-bottom: var(--space-3);
}

/* ----- KPI grid -------------------------------------------- */
.kpi-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.kpi-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
}

.kpi-label {
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.kpi-note {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
}

.kpi--rich {
  border-top: 3px solid var(--tone-fg, var(--accent));
  background: linear-gradient(0deg, var(--surface), var(--surface));
}

.kpi--rich .kpi-value {
  color: var(--tone-fg, var(--text));
}

/* ----- Link cards ------------------------------------------ */
.link-cards {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: color var(--t), opacity var(--t);
}

.link-card:hover {
  color: var(--text);
}

.link-card h3 {
  margin: 0;
}

.link-card p {
  margin: 0;
  color: var(--muted);
}

.link-card-cta {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ----- Team grid ------------------------------------------- */
.team-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.team-card--human {
  border-color: var(--accent);
  background: linear-gradient(0deg, var(--surface), var(--surface));
}

.team-badge {
  align-self: flex-start;
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

.team-badge--human {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.team-badge--ai {
  background: var(--bg);
  color: var(--muted);
}

.team-card h3 {
  margin: 0;
}

.team-role {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--accent);
  margin: 0;
  letter-spacing: 0.02em;
}

.team-card p:last-child {
  color: var(--muted);
  margin: 0;
}

/* ----- Overview grid (cards with icons) -------------------- */
.overview-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

.overview-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--tone-bg, var(--bg));
  color: var(--tone-fg, var(--text));
  margin-bottom: var(--space-2);
}

.overview-card h3 {
  margin: 0;
}

.overview-card > p {
  color: var(--muted);
  margin: 0 0 var(--space-2);
}

/* ----- Sprint list ----------------------------------------- */
.sprint-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.sprint {
  position: relative;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}

.sprint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.sprint-num {
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent);
}

.sprint h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

.sprint p {
  color: var(--muted);
  margin: 0 0 var(--space-2);
}

.sprint p:last-child {
  margin-bottom: 0;
}

/* ----- Agent grid ------------------------------------------ */
.agent-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.agent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--tone-fg, var(--accent));
  border-radius: var(--radius-md);
}

.agent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--tone-bg, var(--bg));
  color: var(--tone-fg, var(--text));
  margin-bottom: var(--space-2);
}

.agent-card h3 {
  margin: 0;
}

.agent-role {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--tone-fg, var(--accent));
  letter-spacing: 0.02em;
  margin: 0;
}

.agent-card > p {
  color: var(--muted);
  margin: 0;
}

.agent-access {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ----- Achievement grid ------------------------------------ */
.achievement-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.achievement {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone-fg, var(--accent));
  border-radius: var(--radius-md);
}

.achievement h3 {
  margin: 0;
}

.achievement p {
  margin: 0;
  color: var(--muted);
}

/* ----- Phase grid ------------------------------------------ */
.phase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

.phase {
  position: relative;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.phase h3 {
  margin: var(--space-2) 0 var(--space-3);
}

/* ----- Status pill ----------------------------------------- */
.status-pill {
  align-self: flex-start;
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}

.status-pill--done {
  background: var(--tone-green-bg);
  color: var(--tone-green-fg);
  border-color: var(--tone-green-fg);
}

/* ----- Timeline -------------------------------------------- */
.timeline {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
  padding-left: var(--space-5);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.timeline li {
  position: relative;
  padding: var(--space-3) 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(var(--space-5) * -1 + 1px);
  top: calc(var(--space-3) + 0.5rem);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline time {
  display: block;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.timeline p {
  margin: 0;
  color: var(--muted);
}

/* ----- Report card ----------------------------------------- */
.report-card {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.report-card > header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.report-card h3 {
  margin: var(--space-5) 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0;
}

.report-card h4 {
  margin: var(--space-5) 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0;
}

.report-card > h3:first-of-type,
.report-card > h4:first-of-type {
  margin-top: 0;
}

.report-card .kpi-grid {
  margin-bottom: var(--space-3);
}

/* ----- Feature card ---------------------------------------- */
.feature-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.feature-card h3 {
  margin: 0 0 var(--space-2);
}

.feature-card > p {
  color: var(--muted);
  margin: 0 0 var(--space-3);
}

/* ----- Screen grid (visual placeholders) ------------------- */
.screen-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.screen-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.screen-card h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.screen-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--step-0);
  line-height: 1.55;
}

.screen-frame {
  aspect-ratio: 9 / 16;
  background:
    linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.screen-frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  opacity: 0.6;
}

.screen-frame--wide {
  aspect-ratio: 16 / 10;
}

.screen-frame-label {
  position: relative;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
}

.screen-shot {
  display: block;
  width: 50%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 1290 / 2796;
  object-fit: cover;
  object-position: center top;
  margin: 0 auto var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* ----- Data table ------------------------------------------ */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table thead th {
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg);
}

.data-table tbody th {
  font-weight: 500;
  color: var(--text);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.trend {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.trend--up {
  background: var(--tone-green-bg);
  color: var(--tone-green-fg);
  border-color: transparent;
}

/* ----- Distribution bars ----------------------------------- */
.distribution {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.distribution-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--step--1);
  margin-bottom: var(--space-1);
}

.distribution-row span:last-child {
  color: var(--muted);
  font-weight: 500;
}

.distribution-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.distribution-bar > span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--accent);
}

/* ----- Bullet & benefit lists ------------------------------ */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: 0;
  margin: 0 0 var(--space-3);
  max-width: 68ch;
}

.bullet-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text);
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.benefit-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding-left: 0;
  margin: 0;
}

.benefit-list li {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.benefit-list strong {
  color: var(--text);
}

/* ----- Inline code ----------------------------------------- */
code {
  font-family: "Outfit", monospace;
  font-size: 0.9em;
  padding: 0.1rem 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ----- PDA tablet breakpoint ------------------------------- */
@media (min-width: 768px) {
  .pda-subnav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
  }

  .pda-tabs-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

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

  .agent-grid,
  .achievement-grid,
  .link-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

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

/* ----- PDA desktop breakpoint ------------------------------ */
@media (min-width: 1200px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

  .team-card--human {
    grid-column: span 3;
  }
}
