/* ===========================
   Custom Properties
   =========================== */
:root {
  --color-bg: #0b1121;
  --color-bg-card: #111a2e;
  --color-bg-elevated: #162036;
  --color-border: #1c2a45;
  --color-text: #c9d1d9;
  --color-text-muted: #6b7b99;
  --color-white: #e6edf3;
  --color-accent: #5b9bf5;
  --color-accent-dim: #3d6bb5;
  --color-tag-bg: #1a3a5c;
  --color-tag-text: #5b9bf5;
  --color-green-bg: #d4edda;
  --color-blue-bg: #c4ddf9;
  --color-grey-bg: #8e9aaf;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-logo: "Syne", sans-serif;
  --max-width: 1100px;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul {
  list-style: none;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background-color: var(--color-accent);
  color: #fff;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 999;
}

.skip-link:focus {
  top: 0.5rem;
}

/* Global focus visible */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Body scroll lock */
body.nav-open {
  overflow: hidden;
}

/* External link indicator */
.external-indicator {
  font-size: 0.7em;
  margin-left: 0.25rem;
  opacity: 0.6;
}

/* ===========================
   Utilities
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===========================
   Navigation
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background-color: rgba(11, 17, 33, 0.85);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.nav-pill {
  display: flex;
  gap: 0;
  background-color: var(--color-bg-elevated);
  border-radius: 50px;
  padding: 0.3rem;
  border: 1px solid var(--color-border);
}

.nav-link {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition), background-color var(--transition);
}

.nav-link:hover {
  color: var(--color-white);
}

.nav-link.active {
  background-color: var(--color-border);
  color: var(--color-white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Nav overlay (backdrop for mobile drawer) */
.nav-overlay {
  display: none;
}

@media (max-width: 768px) {
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 150;
  }

  .nav-overlay.open {
    opacity: 1;
    pointer-events: all;
  }
}

/* ===========================
   Hero
   =========================== */
.hero {
  padding: 8rem 0 4rem;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-border);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-bg-elevated));
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  transform: scale(1.15);
}

.hero-heading {
  font-size: 2rem;
  font-weight: 400;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.hero-name {
  font-weight: 800;
  color: var(--color-white);
}

.hero-bio {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ===========================
   Works Section
   =========================== */
.works {
  padding: 4rem 0 6rem;
}

.works-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.works-sidebar {
  position: sticky;
  top: 5rem;
}

.works-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 1.5rem;
}

.works-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0.6rem 0.25rem;
  min-height: 44px;
  transition: color var(--transition);
}

.filter-btn:hover {
  color: var(--color-white);
}

.filter-btn.active {
  color: var(--color-white);
}

.filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.filter-arrow {
  margin-left: auto;
  font-size: 0.9rem;
}

/* Works Panels */
.works-panel {
  display: none;
  flex-direction: column;
  gap: 2.5rem;
}

.works-panel.active {
  display: flex;
}

/* ===========================
   Case Study Project Cards
   =========================== */
.project-card {
  display: block;
  transition: transform var(--transition);
}

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

.project-thumb {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 90%;
  height: 85%;
  object-fit: contain;
  border-radius: 8px;
}

.project-thumb.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb--green {
  background: linear-gradient(135deg, #c8f7d5, #a8e6cf);
}

.project-thumb--blue {
  background: linear-gradient(135deg, #b3d9ff, #87c1f5);
}

.project-thumb--grey {
  background: linear-gradient(135deg, #8e9aaf, #b0bec5);
}

.project-thumb--cream {
  background: linear-gradient(135deg, #f7f2eb, #ede5d8);
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  text-transform: lowercase;
}

.tag--blue {
  background-color: var(--color-tag-bg);
  color: var(--color-tag-text);
}

.project-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 0.25rem;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.lock-icon {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.25rem;
  opacity: 0.5;
}

.project-read {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===========================
   Visual Design Cards
   =========================== */
.vd-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
  background-color: var(--color-bg-card);
  transition: transform var(--transition);
}

.vd-card:hover {
  transform: translateY(-4px);
}

.vd-card-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

.vd-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.35rem;
}

.vd-card-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.vd-card-right {
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-card));
}

.vd-card-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vd-card-right.no-img {
  min-height: 200px;
}

/* ===========================
   Empty State
   =========================== */
.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ===========================
   Contact
   =========================== */
.contact {
  padding: 5rem 0;
  border-top: 1px solid var(--color-border);
}

.contact-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.contact-heading {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

.heart {
  font-style: normal;
}

.contact-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  min-height: 44px;
  border: 1px solid var(--color-accent-dim);
  border-radius: 50px;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition);
}

.contact-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.contact-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

.social-pill {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  min-height: 44px;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition);
}

.social-pill:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

/* ===========================
   Footer
   =========================== */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .hero {
    padding: 6rem 0 3rem;
  }

  .nav-pill {
    display: none;
  }

  .nav-pill.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    max-width: 280px;
    border-radius: 0;
    padding: 5rem 1.5rem 2rem;
    background-color: var(--color-bg);
    border: none;
    border-left: 1px solid var(--color-border);
    z-index: 200;
  }

  .nav-toggle {
    display: flex;
    z-index: 300;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .works-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .works-sidebar {
    position: sticky;
    top: 60px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background-color: rgba(11, 17, 33, 0.92);
    backdrop-filter: blur(12px);
    margin: 0 -2rem;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--color-border);
  }

  .works-title {
    margin-bottom: 0;
  }

  .works-filters {
    flex-direction: row;
    gap: 0.75rem;
  }

  .filter-arrow {
    display: none;
  }

  .project-thumb {
    height: 180px;
  }

  .vd-card {
    grid-template-columns: 1fr;
  }

  .vd-card-right {
    min-height: 180px;
  }

  .contact-layout {
    flex-direction: column;
  }

  .contact-right {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .contact-heading {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .nav {
    padding: 1rem 1rem;
  }

  .hero-heading {
    font-size: 1.5rem;
  }

  .hero-bio {
    font-size: 0.85rem;
  }

  .works-title {
    font-size: 1.5rem;
  }

  .works-sidebar {
    margin: 0 -1rem;
    padding: 0.75rem 1rem;
  }

  .project-thumb {
    height: 150px;
  }

  .contact-heading {
    font-size: 1.35rem;
  }

  .contact-btn {
    font-size: 0.8rem;
    padding: 0.7rem 1.25rem;
    width: 100%;
    text-align: center;
  }

  .contact-buttons {
    flex-direction: column;
  }

  .social-pill {
    font-size: 0.8rem;
    padding: 0.65rem 1.25rem;
  }
}
