/* ==========================================================
   TechnoHub R&R — Design System v2.0
   Professional Architecture Studio
   ========================================================== */

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

/* -------------------- CUSTOM PROPERTIES -------------------- */
:root {
  /* Palette */
  --bg:             #060608;
  --bg-elevated:    #0c0c10;
  --surface:        #121216;
  --surface-hover:  #1a1a20;

  --border:         rgba(255, 255, 255, 0.06);
  --border-hover:   rgba(255, 255, 255, 0.14);

  --text:           #f0f0f2;
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-tertiary:  rgba(255, 255, 255, 0.35);

  --accent:         #00c8ff;
  --accent-dim:     rgba(0, 200, 255, 0.55);
  --accent-glow:    rgba(0, 200, 255, 0.12);
  --accent-gradient: linear-gradient(135deg, #00c8ff 0%, #0080ff 55%, #6c5ce7 100%);

  /* Layout */
  --radius:    16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --max-width: 1200px;

  /* Easing */
  --ease-out-expo:  cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-accent: 0 8px 30px rgba(0, 200, 255, 0.12);
}

/* -------------------- BASE -------------------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Page-leave transition */
body.page-leaving {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

img { display: block; }

a { color: inherit; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Custom scrollbar */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* -------------------- KEYFRAMES -------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleOut {
  to { opacity: 0; transform: scale(1.04); filter: blur(6px); }
}

@keyframes progressBar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes kenBurns {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

@keyframes menuLinkIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes spinPulse {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

/* -------------------- LOADING SCREEN -------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.loading-overlay .loading-logo {
  height: 48px;
  margin-bottom: 1.2rem;
  opacity: 0.85;
}

.loading-overlay .loading-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
  animation: fadeIn 0.8s 0.2s ease forwards;
}

.loading-progress {
  width: 120px;
  height: 2px;
  margin-top: 1.6rem;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  background-size: 200% 100%;
  border-radius: 2px;
  transform-origin: left;
  animation: progressBar 1.8s var(--ease-out-expo) forwards,
             shimmer 1.5s linear infinite;
}

/* Loading exit */
.loading-overlay.exit {
  animation: scaleOut 0.6s var(--ease-out-quart) forwards;
  pointer-events: none;
}

/* -------------------- NAVBAR -------------------- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  z-index: 1000;
  background: rgba(6, 6, 8, 0.55);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: all 0.4s var(--ease-out-quart);
}

.navbar.scrolled {
  height: 64px;
  background: rgba(6, 6, 8, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.25);
}

/* Logo */
.logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.logo img {
  height: 32px;
  transition: transform 0.4s var(--ease-out-expo);
}

.logo a:hover img {
  transform: scale(1.08);
}

.logo span {
  font-family: 'Playfair Display', serif;
  letter-spacing: 2.5px;
  font-size: 1rem;
  font-weight: 400;
}

/* -------------------- NAV LINKS -------------------- */
.nav-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-sidebar-header,
.nav-sidebar-footer {
  display: none;
}

.nav-links {
  display: flex;
  gap: 2.8rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
  transition: color 0.35s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.5s var(--ease-out-expo);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* -------------------- MOBILE TOGGLE -------------------- */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  padding: 6px;
  margin-left: auto;
  background: none;
  border: none;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.35s var(--ease-out-expo);
  transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* -------------------- HERO -------------------- */
.hero {
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

.slideshow-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(1.1);
  animation: kenBurns 8s ease-in-out alternate infinite;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(6,6,8, 0.25) 0%,
      rgba(6,6,8, 0.10) 35%,
      rgba(6,6,8, 0.50) 70%,
      rgba(6,6,8, 0.92) 100%);
  pointer-events: none;
}

/* Hero text */
.project-title {
  position: absolute;
  bottom: 100px;
  width: 100%;
  text-align: center;
  z-index: 5;
  padding: 0 1.5rem;
}

.project-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  animation: fadeInUp 1s 0.6s var(--ease-out-expo) forwards;
}

.project-title p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  opacity: 0;
  animation: fadeInUp 1s 0.9s var(--ease-out-expo) forwards;
}

/* -------------------- DOTS -------------------- */
.dots-container {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.45s var(--ease-out-expo);
}

.dot.active {
  background: var(--text);
  width: 28px;
  border-radius: 4px;
}

/* -------------------- SCROLL REVEAL -------------------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity   0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * 0.1s);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------- CONTENT SECTIONS -------------------- */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10rem 2rem 6rem;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: 4rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
}

/* Accent line under page title */
.page-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent-gradient);
  margin: 1.2rem auto 0;
  border-radius: 2px;
}

/* -------------------- PORTFOLIO -------------------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo);
}

.portfolio-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.portfolio-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.portfolio-item img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out-expo),
              filter 0.7s ease;
}

.portfolio-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.78);
}

/* Overlay */
.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.8rem 2rem;
  background: linear-gradient(to top,
    rgba(6,6,8, 0.92) 10%,
    rgba(6,6,8, 0.45) 50%,
    rgba(6,6,8, 0.08) 100%);
  opacity: 0.85;
  transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.portfolio-info {
  transform: translateY(8px);
  transition: transform 0.5s var(--ease-out-expo);
}

.portfolio-item:hover .portfolio-info {
  transform: translateY(0);
}

.portfolio-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 600;
}

.portfolio-info p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Placeholder card */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-hover);
  cursor: default;
}

.placeholder:hover {
  transform: none;
  box-shadow: none;
}

.placeholder-box span {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* -------------------- ABOUT PAGE -------------------- */
.about-section {
  max-width: var(--max-width);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5.5rem;
  margin-bottom: 4rem;
  align-items: start;
}

.about-column {
  display: flex;
  flex-direction: column;
}

.about-column p {
  margin: 0 0 1.6rem 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
}

.about-column p.about-lead {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
  margin-bottom: 2.2rem;
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

.about-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  text-align: left;
  margin-top: 0;
  margin-bottom: 4.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text);
}

.about-signature {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: inline-block;
}

.about-signature .sig-name {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.about-signature .sig-title {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.about-image {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-top: 2rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s var(--ease-out-expo);
}

.about-image:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-accent), var(--shadow-lg);
}

.about-block {
  max-width: 760px;
  margin: 0 auto 4.5rem;
}

.about-block h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  margin-bottom: 1.3rem;
  font-weight: 600;
  position: relative;
  padding-left: 20px;
}

.about-block h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.about-block p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.about-list {
  list-style: none;
  padding-left: 0;
}

.about-list li {
  margin-bottom: 1rem;
  padding-left: 1.6rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

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

/* -------------------- CONTACT PAGE -------------------- */
.contact-page {
  max-width: 1000px;
}

.contact-header {
  max-width: 680px;
  margin: 0 auto 4rem;
  text-align: center;
}

.contact-subtitle {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4.5rem;
  align-items: start;
}

/* Info */
.contact-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 2.2rem;
  font-weight: 600;
}

.contact-info p {
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-info span {
  display: block;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
  margin-bottom: 0.35rem;
}

.contact-info a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* Form */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-hover);
  padding: 0.7rem 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.4s ease;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group label {
  position: absolute;
  left: 0;
  top: 0.7rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: all 0.35s var(--ease-out-expo);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -1rem;
  font-size: 0.62rem;
  color: var(--accent);
}

/* Submit Button */
#contact-form button {
  align-self: flex-start;
  margin-top: 0.5rem;
  padding: 0.9rem 2.6rem;
  background: transparent;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

#contact-form button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

#contact-form button:hover {
  color: var(--bg);
  border-color: transparent;
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

#contact-form button:hover::before {
  opacity: 1;
}

#contact-form button:active {
  transform: translateY(0);
}

/* Button loading state */
#contact-form button.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Success */
#form-success {
  display: none;
  padding: 1rem 1.4rem;
  background: var(--accent-glow);
  border: 1px solid rgba(0,200,255,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--accent);
  animation: fadeInUp 0.5s var(--ease-out-expo);
}

#form-success.visible {
  display: block;
}

/* -------------------- PROJECT PAGE -------------------- */
.project-page {
  max-width: 1000px;
}

.project-intro {
  margin-bottom: 2rem;
}

.project-summary {
  max-width: 760px;
  margin: 0 auto 4rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Facts grid */
.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.project-facts > div {
  padding: 0.8rem 0;
}

.project-facts span {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.project-facts p {
  margin-top: 0.45rem;
  font-size: 0.95rem;
  color: var(--text);
}

/* Sections */
.project-section {
  max-width: 720px;
  margin: 0 auto 4.5rem;
}

.project-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 1.3rem;
  font-weight: 600;
}

.project-section p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

/* List */
.project-list {
  list-style: none;
  padding-left: 0;
}

.project-list li {
  margin-bottom: 1.3rem;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.65;
  position: relative;
  font-size: 0.98rem;
}

.project-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.project-list strong {
  color: var(--text);
  font-weight: 500;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  transition: color 0.3s ease, gap 0.3s var(--ease-out-expo);
}

.back-link:hover {
  color: var(--accent);
  gap: 12px;
}

/* Read More button */
.read-more-btn {
  display: inline-block;
  margin-top: 1.2rem;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: color 0.3s var(--ease-out-quart);
}

.read-more-btn::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-expo);
}

.read-more-btn:hover {
  color: var(--text);
}

.read-more-btn:hover::after {
  transform: scaleX(1);
  background: var(--text);
}

#moreText {
  animation: fadeIn 0.4s var(--ease-out-quart) forwards;
}

/* -------------------- FOOTER -------------------- */
footer {
  position: relative;
  padding: 0;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 800px);
  height: 1px;
  background: var(--accent-gradient);
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
  opacity: 0.35;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 2.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 1rem;
}

.footer-brand img {
  height: 28px;
}

.footer-brand span {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  letter-spacing: 2px;
}

.footer-brand p {
  color: var(--text-tertiary);
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-nav h4,
.footer-contact h4 {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li {
  margin-bottom: 0.7rem;
}

.footer-nav a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.3s ease;
}

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

.footer-contact p {
  margin-bottom: 0.5rem;
  color: var(--text-tertiary);
  font-size: 0.88rem;
}

.footer-contact a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}

/* -------------------- FEATURED PROJECTS (INDEX) -------------------- */
.featured-section {
  padding: 6rem 0;
  background: var(--bg);
}

.featured-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  text-align: center;
  margin-bottom: 3.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
}

.section-label::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent-gradient);
  margin: 1.2rem auto 0;
  border-radius: 2px;
}

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

.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  background: var(--surface);
  transition: transform 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo);
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.featured-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out-expo),
              filter 0.7s ease;
}

.featured-card:hover img {
  transform: scale(1.06);
  filter: brightness(0.7);
}

.featured-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top,
    rgba(6,6,8, 0.92) 0%,
    rgba(6,6,8, 0.4) 70%,
    transparent 100%);
}

.featured-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.featured-card-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.featured-card-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.featured-cta {
  text-align: center;
  margin-top: 3rem;
}

.view-all-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.8rem 2rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.view-all-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.view-all-link:hover {
  color: var(--bg);
  border-color: transparent;
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

.view-all-link:hover::before {
  opacity: 1;
}

/* -------------------- BACK TO TOP -------------------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.4s var(--ease-out-expo);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

/* -------------------- CURSOR TRAIL -------------------- */
#trail-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.trail-particle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  background: radial-gradient(circle, rgba(0,200,255,0.35), transparent 70%);
  opacity: 0;
  pointer-events: none;
  filter: blur(1.5px);
  mix-blend-mode: screen;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* -------------------- IMAGE LAZY LOAD -------------------- */
img[data-src] {
  opacity: 0;
  transition: opacity 0.6s ease;
}

img[data-src].loaded {
  opacity: 1;
}

/* -------------------- ERROR PAGE -------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  min-height: 80dvh;
  text-align: center;
  padding-top: 10rem;
  padding-bottom: 6rem;
}

.error-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 600;
  line-height: 1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.error-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.error-desc {
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.error-btn {
  display: inline-block;
  padding: 0.9rem 2.6rem;
  background: transparent;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.error-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.error-btn:hover {
  color: var(--bg);
  border-color: transparent;
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

.error-btn:hover::before {
  opacity: 1;
}

.error-btn:active {
  transform: translateY(0);
}

/* -------------------- RESPONSIVE -------------------- */

/* ---------- Tablet (1024px) ---------- */
@media (max-width: 1024px) {
  .content-section {
    padding: 9rem 1.8rem 5rem;
  }

  .about-grid {
    gap: 3.5rem;
  }

  .contact-container {
    gap: 3rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
  }

  .portfolio-item img {
    height: 320px;
  }
}

/* ---------- Mobile (768px) ---------- */
@media (max-width: 768px) {
  body {
    line-height: 1.65;
  }

  .content-section {
    padding: 7rem 1.2rem 3.5rem;
  }

  /* --- Navbar --- */
  .navbar {
    height: 64px;
    padding: 0 1.5rem;
  }

  .navbar.scrolled {
    height: 56px;
  }

  .logo img {
    height: 28px;
  }

  .logo span {
    font-size: 0.88rem;
    letter-spacing: 2px;
  }

  .mobile-toggle {
    display: flex;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  /* Overlay backdrop */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 6, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out-quart);
    z-index: 998;
  }

  .nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Sidebar drawer from left */
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 10, 14, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    transform: translateX(-100%);
    transition: transform 0.45s var(--ease-out-quart);
    z-index: 999;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  /* Sidebar header */
  .nav-sidebar-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 1.8rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .nav-sidebar-header a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
  }

  .nav-sidebar-header img {
    height: 28px;
  }

  .nav-sidebar-header span {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
  }

  /* Sidebar nav links */
  .nav-links {
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    flex: 1;
  }

  .nav-links li {
    width: 100%;
    opacity: 0;
    transform: translateX(-20px);
  }

  .nav-menu.active .nav-links li {
    animation: menuLinkIn 0.4s var(--ease-out-quart) forwards;
  }

  .nav-menu.active .nav-links li:nth-child(1) { animation-delay: 0.1s; }
  .nav-menu.active .nav-links li:nth-child(2) { animation-delay: 0.18s; }
  .nav-menu.active .nav-links li:nth-child(3) { animation-delay: 0.26s; }
  .nav-menu.active .nav-links li:nth-child(4) { animation-delay: 0.34s; }

  .nav-links a {
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    padding: 1rem 1.8rem;
    width: 100%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: color 0.3s ease, background 0.3s ease,
                padding-left 0.3s var(--ease-out-quart);
  }

  .nav-links a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.03);
    padding-left: 2.2rem;
  }

  .nav-links a.active {
    color: var(--accent);
    border-left: 2px solid var(--accent);
  }

  .nav-links a::after {
    display: none;
  }

  /* Sidebar footer */
  .nav-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 1.8rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    flex-shrink: 0;
  }

  .nav-sidebar-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.3s ease;
  }

  .nav-sidebar-footer a:hover {
    color: var(--accent);
  }

  .nav-sidebar-footer span {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
  }

  /* --- Hero --- */
  .hero {
    height: 85vh;
    height: 85dvh;
  }

  .project-title {
    bottom: 60px;
    padding: 0 1.2rem;
  }

  .project-title h1 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    letter-spacing: 0.1em;
  }

  .project-title p {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
  }

  .dots-container {
    bottom: 28px;
  }

  .slide img {
    animation: none;
  }

  /* --- Page Title --- */
  .page-title {
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    letter-spacing: 0.1em;
  }

  .page-title::after {
    width: 36px;
    margin-top: 1rem;
  }

  /* --- Portfolio --- */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .portfolio-item img {
    height: 260px;
  }

  .portfolio-overlay {
    padding: 1.4rem 1.5rem;
    opacity: 1;
  }

  .portfolio-info {
    transform: translateY(0);
  }

  .portfolio-info h3 {
    font-size: 1.25rem;
  }

  .portfolio-info p {
    font-size: 0.82rem;
  }

  .placeholder {
    min-height: 200px;
  }

  /* --- Contact --- */
  .contact-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-header {
    margin-bottom: 2.5rem;
  }

  .contact-subtitle {
    font-size: 0.95rem;
  }

  #contact-form {
    gap: 2rem;
  }

  #contact-form button {
    width: 100%;
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.88rem;
    min-height: 48px;
  }

  .form-group input,
  .form-group textarea {
    font-size: 1rem;
    padding: 0.8rem 0;
  }

  .form-group label {
    font-size: 0.75rem;
  }

  /* --- About --- */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-heading {
    font-size: clamp(2rem, 7vw, 2.8rem);
    margin-bottom: 2rem;
  }

  .about-column p {
    font-size: 0.98rem;
    line-height: 1.75;
    margin-bottom: 1.4rem;
  }

  .about-column p.about-lead {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.8rem;
    padding-left: 1.2rem;
  }

  .about-image {
    height: 260px;
    margin-top: 1rem;
  }

  .about-block {
    margin-bottom: 3rem;
  }

  .about-block h2 {
    font-size: 1.35rem;
  }

  .about-block p {
    font-size: 0.95rem;
  }

  /* --- Project Pages --- */
  .project-page {
    max-width: 100%;
  }

  .project-summary {
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
  }

  .project-facts {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    padding: 1.5rem 1.2rem;
    margin-bottom: 3.5rem;
  }

  .project-facts span {
    font-size: 0.62rem;
  }

  .project-facts p {
    font-size: 0.88rem;
  }

  .project-section {
    margin-bottom: 3rem;
  }

  .project-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .project-section p {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .project-list li {
    font-size: 0.92rem;
    margin-bottom: 1rem;
    line-height: 1.6;
  }

  .back-link {
    margin-bottom: 2rem;
    font-size: 0.82rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* --- Error Page --- */
  .error-page {
    padding-top: 7rem;
    padding-bottom: 4rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .error-subtitle {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
  }

  .error-desc {
    font-size: 0.95rem;
  }

  .error-btn {
    padding: 1rem 2.4rem;
    min-height: 48px;
  }

  /* --- Footer --- */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 1.5rem 2rem;
  }

  .footer-bottom {
    padding: 1.2rem 1.5rem;
    font-size: 0.72rem;
  }

  .footer-brand p {
    max-width: 100%;
  }

  /* --- Featured --- */
  .featured-section {
    padding: 4rem 0;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .featured-card img {
    height: 220px;
  }

  .section-label {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
  }

  /* --- Loading --- */
  .loading-overlay .loading-text {
    font-size: 1.1rem;
    letter-spacing: 0.2em;
  }
}

/* ---------- Small Mobile (480px) ---------- */
@media (max-width: 480px) {
  .content-section {
    padding: 6.5rem 1rem 3rem;
  }

  /* --- Navbar --- */
  .logo img {
    height: 26px;
  }

  .logo span {
    font-size: 0.78rem;
    letter-spacing: 1.5px;
  }

  /* --- Hero --- */
  .hero {
    height: 75vh;
    height: 75dvh;
  }

  .project-title {
    bottom: 50px;
  }

  .project-title h1 {
    font-size: clamp(1.3rem, 5.5vw, 1.8rem);
    letter-spacing: 0.08em;
  }

  .project-title p {
    font-size: 0.78rem;
    margin-top: 10px;
  }

  /* --- Page Title --- */
  .page-title {
    font-size: 1.35rem;
    margin-bottom: 2rem;
    letter-spacing: 0.08em;
  }

  /* --- Portfolio --- */
  .portfolio-item img {
    height: 220px;
  }

  .portfolio-info h3 {
    font-size: 1.1rem;
  }

  .portfolio-meta {
    font-size: 0.6rem;
  }

  .placeholder {
    min-height: 160px;
  }

  /* --- Contact --- */
  .contact-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .contact-info p {
    font-size: 0.88rem;
  }

  /* --- About --- */
  .about-heading {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    margin-bottom: 1.5rem;
  }

  .about-column p {
    font-size: 0.92rem;
  }

  .about-column p.about-lead {
    font-size: 1rem;
  }

  .about-image {
    height: 200px;
  }

  .about-signature {
    margin-top: 2.5rem;
  }

  /* --- Project Pages --- */
  .project-facts {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
  }

  .project-facts > div {
    padding: 1.2rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
  }

  .project-summary {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .project-section h3 {
    font-size: 1.2rem;
  }

  .project-section p {
    font-size: 0.9rem;
  }

  .project-list li {
    font-size: 0.88rem;
    padding-left: 1rem;
  }

  .project-list li::before {
    top: 9px;
    width: 4px;
    height: 4px;
  }

  /* --- Error Page --- */
  .error-page {
    padding-top: 6rem;
  }

  .error-btn {
    width: 100%;
    text-align: center;
  }

  /* --- Footer --- */
  .footer-inner {
    padding: 2.5rem 1rem 1.5rem;
  }

  .footer-bottom {
    padding: 1rem;
    font-size: 0.68rem;
  }

  /* --- Featured --- */
  .featured-card img {
    height: 180px;
  }

  .featured-card-content h3 {
    font-size: 1.1rem;
  }

  .section-label {
    font-size: 1.35rem;
  }
}

/* ---------- Very Small Screens (360px) ---------- */
@media (max-width: 360px) {
  .logo span {
    font-size: 0.7rem;
    letter-spacing: 1px;
  }

  .logo img {
    height: 22px;
  }

  .project-title h1 {
    font-size: 1.2rem;
  }

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

  .nav-links a {
    font-size: 1.2rem;
  }
}

/* ---------- Landscape Mobile ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    height: 100vh;
    height: 100dvh;
  }

  .project-title {
    bottom: 30px;
  }

  .project-title h1 {
    font-size: 1.4rem;
  }

  .nav-links a {
    padding: 0.8rem 0;
    font-size: 1.1rem;
  }

  .loading-overlay .loading-text {
    font-size: 1rem;
  }
}

/* ---------- Safe area insets for notched devices ---------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .navbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .content-section {
    padding-left: max(1.2rem, env(safe-area-inset-left));
    padding-right: max(1.2rem, env(safe-area-inset-right));
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .slide img {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Touch-friendly sizing on mobile */
@media (pointer: coarse) {
  .dot {
    width: 12px;
    height: 12px;
    padding: 4px;
  }

  .dot.active {
    width: 32px;
  }

  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .back-link {
    min-height: 44px;
    padding: 8px 0;
  }

  .read-more-btn {
    min-height: 44px;
    padding: 8px 0;
  }
}