/* ============================================================
   PORTFOLIO STYLES
   To retheme: edit --accent and --bg in :root below.
   ============================================================ */

:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Colors */
  --bg:           #f7f5ff;
  --surface:      #ffffff;
  --surface-2:    #f0eeff;
  --text:         #1c1730;
  --text-muted:   #7269a8;
  --accent:       #6c63ff;
  --accent-dark:  #5550d4;
  --accent-light: #ede8ff;
  --border:       rgba(108, 99, 255, 0.14);

  /* Tag color pairs [background, foreground] — cycled by tag index */
  --tc-0-bg: #ede8ff; --tc-0-fg: #5550d4;
  --tc-1-bg: #fce4fc; --tc-1-fg: #b500cc;
  --tc-2-bg: #e0f7fa; --tc-2-fg: #00838f;
  --tc-3-bg: #e0f2f1; --tc-3-fg: #00695c;
  --tc-4-bg: #fff8e1; --tc-4-fg: #e65100;
  --tc-5-bg: #fce4ec; --tc-5-fg: #c2185b;
  --tc-6-bg: #ede7f6; --tc-6-fg: #512da8;
  --tc-7-bg: #e8f5e9; --tc-7-fg: #2e7d32;

  /* Layout */
  --max-w:  1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Radii */
  --r-sm:   8px;
  --r-md:   16px;
  --r-lg:   28px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-card:       0 2px 8px rgba(28, 23, 48, 0.07),  0 0 0 1px rgba(108, 99, 255, 0.07);
  --shadow-card-hover: 0 12px 36px rgba(108, 99, 255, 0.2), 0 0 0 1px rgba(108, 99, 255, 0.14);
  --shadow-header:     0 1px 0 rgba(108, 99, 255, 0.1);
}

/* ── Reset ── */

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: var(--font); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-header);
}

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

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--accent); text-decoration: none; }

.site-nav {
  display: flex;
  gap: 2rem;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ── About section ── */

.about-section {
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 8vw, 6rem);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.about-greeting {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.about-name {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.about-role {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.4rem;
  letter-spacing: -0.01em;
}

.about-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.15s;
  text-decoration: none !important;
}

.about-link.primary {
  background: var(--accent);
  color: #fff;
}
.about-link.primary:hover { background: var(--accent-dark); }

.about-link.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.about-link.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Avatar */

.avatar-frame {
  width: clamp(180px, 22vw, 280px);
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  background: var(--accent-light);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--accent);
  padding-bottom: 0;
}
.avatar-placeholder svg {
  width: 75%;
}

/* ── Work section ── */

.work-section {
  padding-bottom: 6rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Controls ── */

.controls-bar {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.875rem;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Sort dropdown */

.sort-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
}

.sort-select {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%237269a8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
}

.sort-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

/* ── Project grid ── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

/* ── Project card ── */

.project-card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: card-in 0.35s ease both;
}

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

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Thumbnail */

.card-thumbnail {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .card-thumbnail img {
  transform: scale(1.05);
}

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card body */

.card-body {
  padding: 1.25rem 1.25rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.card-tag {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.35;
}

.card-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

/* Card footer */

.card-footer {
  padding: 0.75rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-link {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.15s;
  text-decoration: none !important;
  flex-shrink: 0;
}
.card-link:hover { gap: 0.45rem; }

/* ── Empty state ── */

.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.75rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; margin-bottom: 1.25rem; }

.btn-ghost {
  display: inline-flex;
  padding: 0.5rem 1.375rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Footer ── */

.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.6);
  padding: 3.5rem 0 2.5rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.15s;
  text-decoration: none !important;
}
.footer-link:hover { color: #fff; }

.footer-copy {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Responsive ── */

@media (max-width: 740px) {
  .about-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-visual {
    order: -1;
    margin: 0 auto;
  }
  .about-bio { margin-left: auto; margin-right: auto; }
  .about-links { justify-content: center; }
}

@media (max-width: 480px) {
  .site-nav { gap: 1.5rem; }
  .controls-bar { flex-direction: column; }
  .sort-label { align-self: flex-start; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PROJECT DETAIL PAGE  (project.html / project.js)
   ══════════════════════════════════════════════════════════════════════════════ */

.pd-loading {
  text-align: center;
  padding: 6rem 1rem;
  color: var(--text-muted);
}

/* Hero */

.pd-hero {
  width: 100%;
  height: clamp(220px, 38vw, 480px);
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}

.pd-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Narrow content column */
.pd-narrow {
  max-width: 760px;
}

/* Back link */
.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: color 0.15s;
}
.pd-back:hover { color: var(--accent); }

/* Lead */

.pd-lead {
  padding-bottom: 3rem;
}

.pd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.pd-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Meta chips */

.pd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.pd-meta-chip {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  min-width: 90px;
}

.pd-meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.pd-meta-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.pd-overview {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* Content sections */

.pd-sections {
  border-top: 1px solid var(--border);
  padding-bottom: 1rem;
}

.pd-section {
  padding-top: 2.5rem;
  padding-bottom: 0.5rem;
}

.pd-section-heading {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.pd-section-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.pd-section-body:last-child { margin-bottom: 0; }

/* Gallery */

.pd-gallery {
  padding: 2.5rem 0;
  background: var(--surface-2);
  margin: 2.5rem 0;
}

.pd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

.pd-gallery-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
}

/* Outcomes */

.pd-outcomes {
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--border);
}

.pd-outcomes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}

.pd-outcomes-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  background: var(--accent-light);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

.pd-outcomes-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* CTA */

.pd-cta {
  padding: 2rem 0 1rem;
}

.pd-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none !important;
  transition: background 0.15s;
}
.pd-cta-btn:hover { background: var(--accent-dark); }

/* Prev / next project navigation */

.pd-project-nav {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  margin-top: 2rem;
}

.pd-project-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.pd-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none !important;
  max-width: 280px;
}

.pd-nav-next {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}

.pd-nav-dir {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pd-nav-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.15s;
}

.pd-nav-link:hover .pd-nav-title { color: var(--accent); }
