/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --max-w: 1080px;
}

body {
  background: #0C0C0E;
  color: #A8A8B8;
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

/* ─── Single layout wrapper ─────────────────────────────────── */
/* Every visible section sits inside .p-wrap.                   */
/* The nav border and footer border are the only full-bleed     */
/* elements — everything else is constrained to --max-w.        */

.p-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 56px;       /* ← ONE source of truth for side spacing */
}

/* ─── Nav ───────────────────────────────────────────────────── */
/* Nav sits outside .p-wrap so its border spans full width,     */
/* but the inner row is constrained with the same padding.      */

.p-nav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.p-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 56px;    /* ← matches .p-wrap */
}

.p-logo {
  font-size: 15px;
  font-weight: 600;
  color: #F0EEE8;
  letter-spacing: -0.5px;
}

.p-logo-sub {
  font-size: 12px;
  font-weight: 300;
  color: rgba(168, 168, 184, 0.55);
  letter-spacing: -0.2px;
  margin-left: 10px;
}

.p-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ─── Portfolio Button ──────────────────────────────────────── */
.p-btn-portfolio {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 400;
  font-family: 'Geist', sans-serif;
  color: #E8855A;
  text-decoration: none;
  border: 1px solid rgba(232, 133, 90, 0.25);
  border-radius: 7px;
  padding: 6px 14px;
  transition: all 0.15s;
  white-space: nowrap;
}

.p-btn-portfolio:hover {
  background: rgba(232, 133, 90, 0.07);
  border-color: rgba(232, 133, 90, 0.45);
}

/* ─── Language Toggle ───────────────────────────────────────── */
.p-lang {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  overflow: hidden;
}

.p-lang-btn {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(168, 168, 184, 0.52);
  background: none;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}

.p-lang-btn.active {
  color: #F0EEE8;
  background: rgba(255, 255, 255, 0.07);
}

.p-lang-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.07);
}

/* ─── GitHub Link ───────────────────────────────────────────── */
.p-gh-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(168, 168, 184, 0.55);
  text-decoration: none;
  font-weight: 300;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 6px 14px;
  transition: all 0.2s;
}

.p-gh-link:hover {
  color: #A8A8B8;
  border-color: rgba(255, 255, 255, 0.13);
}

/* ─── Header ────────────────────────────────────────────────── */
.p-header {
  padding: 72px 0 60px;        /* vertical only — horizontal handled by .p-wrap */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
}

.p-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.p-eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #E8855A;
  animation: blink 2.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.p-eyebrow-text {
  font-size: 11px;
  color: #E8855A;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.p-title {
  font-size: 44px;
  font-weight: 600;
  color: #F0EEE8;
  letter-spacing: -1.8px;
  line-height: 1.04;
  margin-bottom: 16px;
}

.p-title .dim {
  font-weight: 200;
  color: rgba(240, 238, 232, 0.35);
}

.p-desc {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(168, 168, 184, 0.68);
  max-width: 480px;
}

.p-count {
  text-align: right;
}

.p-count-num {
  font-size: 52px;
  font-weight: 600;
  color: rgba(240, 238, 232, 0.09);
  letter-spacing: -3px;
  line-height: 1;
  display: block;
}

.p-count-label {
  font-size: 11px;
  color: rgba(168, 168, 184, 0.38);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ─── Section Label ─────────────────────────────────────────── */
.p-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 36px;           /* vertical only */
}

.p-section-label--mt {
  margin-top: 48px;
}

.p-sl-text {
  font-size: 10px;
  color: rgba(168, 168, 184, 0.42);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
}

.p-sl-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
}

/* ─── Projects Grid ─────────────────────────────────────────── */
.p-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin-top: 20px;            /* vertical only */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  overflow: hidden;
}

.p-card {
  background: #0C0C0E;
  padding: 32px 34px;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.p-card:hover {
  background: #111116;
}

.p-card--full {
  grid-column: 1 / -1;
}

.p-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.p-card-index {
  font-size: 10px;
  font-weight: 500;
  color: rgba(168, 168, 184, 0.38);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* ─── Status Pills ──────────────────────────────────────────── */
.p-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 400;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.p-status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.status-dev   { background: rgba(232, 133, 90, 0.1);  color: #E8855A; }
.status-dev   .p-status-dot { background: #E8855A; animation: blink 2s infinite; }

.status-done  { background: rgba(111, 203, 168, 0.1); color: #6FCBA8; }
.status-done  .p-status-dot { background: #6FCBA8; }

.status-pause { background: rgba(168, 168, 184, 0.07); color: rgba(168, 168, 184, 0.62); }
.status-pause .p-status-dot { background: rgba(168, 168, 184, 0.62); }

.status-test  { background: rgba(139, 111, 203, 0.1); color: #A07EE8; }
.status-test  .p-status-dot { background: #A07EE8; animation: blink 2s infinite; }

.status-delay { background: rgba(232, 200, 90, 0.08); color: rgba(232, 200, 90, 0.6); }
.status-delay .p-status-dot { background: rgba(232, 200, 90, 0.6); }

/* ─── Card Content ──────────────────────────────────────────── */
.p-card-name {
  font-size: 18px;
  font-weight: 600;
  color: #F0EEE8;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.p-card-desc {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(168, 168, 184, 0.62);
  font-weight: 300;
  flex: 1;
  margin-bottom: 20px;
}

.p-card-desc--wide {
  max-width: 600px;
}

.p-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 10px;
}

/* ─── Tags ──────────────────────────────────────────────────── */
.p-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.p-tag {
  font-size: 10px;
  color: rgba(168, 168, 184, 0.52);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 400;
}

/* ─── Card Links ────────────────────────────────────────────── */
.p-card-links {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.p-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 400;
  color: rgba(168, 168, 184, 0.52);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.p-link:hover {
  color: #A8A8B8;
  border-color: rgba(255, 255, 255, 0.14);
}

.p-link.primary {
  color: #E8855A;
  border-color: rgba(232, 133, 90, 0.2);
}

.p-link.primary:hover {
  background: rgba(232, 133, 90, 0.07);
  border-color: rgba(232, 133, 90, 0.35);
}

/* ─── Extras Grid ───────────────────────────────────────────── */
.p-extras-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.04);
  margin-top: 20px;            /* vertical only */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  overflow: hidden;
}

.p-extra-card {
  background: #0C0C0E;
  padding: 28px 30px;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.p-extra-card:hover {
  background: #111116;
}

.p-extra-badge {
  font-size: 9px;
  font-weight: 500;
  color: rgba(168, 168, 184, 0.38);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.p-extra-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(240, 238, 232, 0.88);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.p-extra-desc {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(168, 168, 184, 0.52);
  font-weight: 300;
  flex: 1;
  margin-bottom: 14px;
}

.p-extra-links {
  display: flex;
  gap: 8px;
}

.p-extra-link {
  font-size: 11px;
  color: rgba(168, 168, 184, 0.42);
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

.p-extra-link:hover {
  color: rgba(168, 168, 184, 0.78);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ─── Footer ────────────────────────────────────────────────── */
.p-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 28px 0;             /* vertical only */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
}

.p-footer-left {
  font-size: 12px;
  color: rgba(168, 168, 184, 0.55);
  font-weight: 300;
}

.p-footer-right {
  font-size: 12px;
  color: rgba(168, 168, 184, 0.55);
}

/* ─── i18n transition ───────────────────────────────────────── */
[data-t] {
  transition: opacity 0.15s;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile first breakpoints
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tablet: ≤ 768px ───────────────────────────────────────── */
@media (max-width: 768px) {

  .p-wrap {
    padding: 0 24px;
  }

  /* Nav */
  .p-nav-inner {
    padding: 18px 24px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .p-nav-left {
    flex: 1;
    min-width: 0;
  }

  .p-logo-sub {
    display: none; /* hide subtitle on small nav */
  }

  .p-nav-right {
    gap: 8px;
  }

  .p-gh-link span {
    display: none; /* hide "github.com/SantiRada" text, keep icon */
  }

  /* Header */
  .p-header {
    grid-template-columns: 1fr;
    padding: 48px 0 40px;
    gap: 0;
  }

  .p-count {
    display: none; /* big decorative number takes too much space */
  }

  .p-title {
    font-size: 36px;
    letter-spacing: -1.2px;
  }

  /* Projects grid → single column */
  .p-grid {
    grid-template-columns: 1fr;
  }

  .p-card--full {
    grid-column: 1;
  }

  .p-card {
    padding: 24px 22px;
  }

  /* Extras grid → single column */
  .p-extras-grid {
    grid-template-columns: 1fr;
  }

  .p-extra-card {
    padding: 22px 22px;
  }

  /* Footer */
  .p-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 24px 0;
  }
}

/* ─── Mobile: ≤ 480px ───────────────────────────────────────── */
@media (max-width: 480px) {

  .p-wrap {
    padding: 0 16px;
  }

  .p-nav-inner {
    padding: 16px 16px;
  }

  .p-title {
    font-size: 30px;
    letter-spacing: -0.8px;
  }

  .p-desc {
    font-size: 13px;
  }

  .p-card {
    padding: 20px 18px;
  }

  .p-card-name {
    font-size: 16px;
  }

  .p-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .p-card-links {
    width: 100%;
  }

  .p-link {
    flex: 1;
    justify-content: center;
  }

  .p-extra-card {
    padding: 18px 16px;
  }

  /* Nav: stack lang toggle + github link */
  .p-nav-right {
    flex-wrap: wrap;
  }
}
