/* ================================================================
   style.css — Shared styles for the entire portfolio site
   Import order: tokens → reset → typography → layout →
                 nav → components → pages → responsive
   ================================================================ */

/* ----------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   Edit these to retheme the entire site from one place.
   ---------------------------------------------------------------- */
:root {
  /* Colours */
  --bg:      #0e0e0e;
  --surface: #161616;
  --border:  #2a2a2a;
  --text:    #f0ece4;
  --muted:   #888;
  --accent:  #c8a96e;   /* warm gold */
  --accent2: #e8d5b0;
  --error:   #e05050;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  /* Layout */
  --nav-h:  68px;
  --radius: 4px;

  /* Animation */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  /* Subtle grain texture for depth — purely decorative */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ----------------------------------------------------------------
   3. TYPOGRAPHY HELPERS
   ---------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Italic gold accent used inside headings */
.display-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* ALL-CAPS eyebrow / section labels */
.label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----------------------------------------------------------------
   4. LAYOUT UTILITIES
   ---------------------------------------------------------------- */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Full-height page padding that clears the fixed nav */
.section-pad    { padding: calc(var(--nav-h) + 6rem) 0 6rem; }
.section-pad-sm { padding: 5rem 0; }

/* Horizontal rule with a floating label on the left */
.divider {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Page fade-in animation — applied to the <main> on each page */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter {
  animation: fadeUp 0.55s var(--ease) both;
}

/* ----------------------------------------------------------------
   5. BUTTONS
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  border-radius: var(--radius);
  transition: background 0.22s, color 0.22s, transform 0.18s;
}
.btn:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

/* Filled variant */
.btn-solid {
  background: var(--accent);
  color: var(--bg);
}
.btn-solid:hover {
  background: var(--accent2);
  color: var(--bg);
}

/* ----------------------------------------------------------------
   6. NAVIGATION
   Fixed glassmorphism bar shared by every page.
   nav.js handles the active-link highlighting and hamburger logic.
   ---------------------------------------------------------------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  z-index: 100;
  background: rgba(14, 14, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}
/* Animated underline */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover,
.nav-links a.active           { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after    { width: 100%; }

/* Hamburger — hidden on desktop, shown on mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
/* Hamburger → X morphing animation */
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Full-width dropdown for mobile nav */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(14, 14, 14, 0.97);
  backdrop-filter: blur(14px);
  padding: 2rem;
  flex-direction: column;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 1.4rem;
  font-family: var(--font-display);
  color: var(--muted);
  transition: color 0.2s;
}
.mobile-menu a:hover,
.mobile-menu a.active { color: var(--text); }

/* ----------------------------------------------------------------
   7. FOOTER
   Shared footer used on every page.
   ---------------------------------------------------------------- */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}
footer .footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
footer .footer-logo span { color: var(--accent); }
footer p { font-size: 0.8rem; color: var(--muted); }

/* ================================================================
   PAGE-SPECIFIC STYLES
   Grouped here to keep each HTML file lightweight. Prefix rules
   with a page class or comment block for clarity.
   ================================================================ */

/* ----------------------------------------------------------------
   HOME PAGE
   ---------------------------------------------------------------- */
.home-hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

/* Large radial glow behind the hero text column */
.home-hero::before {
  content: '';
  position: absolute;
  top: -10%; right: -5%;
  width: 55vw; height: 55vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,110,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy {
  padding: 4rem 2rem 4rem 2rem;
  max-width: 580px;
}
.hero-eyebrow { margin-bottom: 1.5rem; }
.hero-title {
  font-size: clamp(2.8rem, 5vw, 5rem);
  margin-bottom: 1.5rem;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 420px;
  margin-bottom: 2.5rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Right panel: abstract geometric composition */
.hero-visual {
  position: relative;
  height: 100%;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-geo {
  position: relative;
  width: 380px; height: 440px;
}
.geo-rect {
  position: absolute;
  border-radius: 2px;
}
.geo-rect:nth-child(1) {
  width: 280px; height: 340px;
  top: 0; left: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.geo-rect:nth-child(2) {
  width: 180px; height: 220px;
  top: 40px; left: 0;
  background: transparent;
  border: 1px solid var(--accent);
  animation: floatA 6s ease-in-out infinite;
}
.geo-rect:nth-child(3) {
  width: 100px; height: 100px;
  bottom: 30px; right: 20px;
  background: var(--accent);
  opacity: 0.12;
}
.geo-rect:nth-child(4) {
  width: 60px; height: 60px;
  bottom: 60px; right: 50px;
  background: var(--accent);
  opacity: 0.4;
  animation: floatB 5s ease-in-out infinite 1s;
}
.geo-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: rgba(200,169,110,0.08);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: -0.04em;
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(-8px, -12px); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%       { transform: translate(6px, -10px) rotate(8deg); }
}

/* Stats bar */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}
.stat {
  background: var(--bg);
  padding: 2.5rem 2rem;
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-label { font-size: 0.82rem; color: var(--muted); }

/* Services strip */
.services-strip {
  padding: 5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.service-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s;
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.service-icon  { font-size: 1.8rem; margin-bottom: 1rem; }
.service-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}
.service-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ----------------------------------------------------------------
   ABOUT PAGE
   ---------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

/* Portrait with offset gold-border frame */
.about-img-wrap { position: relative; }
.about-img-wrap::before {
  content: '';
  position: absolute;
  top: -16px; left: -16px;
  right: 16px; bottom: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 0;
}
.about-portrait {
  position: relative;
  z-index: 1;
  width: 100%; aspect-ratio: 3/4;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.about-portrait svg { width: 60%; height: 60%; opacity: 0.12; }

.about-copy h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 1.5rem; }
.about-copy p  { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.2rem; }
.about-copy p:last-of-type { margin-bottom: 2rem; }

/* Skill / tool pill tags */
.skills-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.skill-tag {
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s;
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent); }

/* Experience timeline */
.timeline { padding-top: 4rem; }
.timeline-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-year  { font-size: 0.8rem; color: var(--accent); padding-top: 0.25rem; }
.timeline-role  { font-size: 0.95rem; font-weight: 500; }
.timeline-place { font-size: 0.85rem; color: var(--muted); }

/* ----------------------------------------------------------------
   PROJECTS PAGE
   ---------------------------------------------------------------- */
.filter-bar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 3rem; }
.filter-btn {
  padding: 0.45rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  font-family: var(--font-body);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* Responsive card grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
}

.project-thumb {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-thumb-icon { font-size: 3rem; opacity: 0.5; position: relative; z-index: 1; }

/* Darken thumbnail on hover */
.project-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(14,14,14,0.5);
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover .project-thumb::after { opacity: 1; }

.project-info     { padding: 1.4rem 1.5rem; }
.project-category { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.project-title    { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; }
.project-desc     { font-size: 0.85rem; color: var(--muted); line-height: 1.55; }

/* Lightbox / modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  overflow-y: auto;
  padding: 2rem;
  align-items: flex-start;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  margin: auto;
  overflow: hidden;
  animation: fadeUp 0.35s var(--ease);
}
.modal-header {
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
  overflow: hidden;
}

/* ── Carousel ─────────────────────────────────────────────────── */
.carousel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* object-fit: contain → always shows the full image, no cropping */
.carousel-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
  left: 0.75rem;
}
.carousel-arrow:hover   { background: var(--accent); border-color: var(--accent); }
.carousel-arrow-right   { left: auto; right: 0.75rem; }
.carousel-dots {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 2;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}
.carousel-dot.active,
.carousel-dot:hover { background: var(--accent); border-color: var(--accent); }
.modal-body      { padding: 2rem 2.5rem; }
.modal-body h2   { font-family: var(--font-display); font-size: 2rem; margin-bottom: 1rem; }
.modal-body p    { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.2rem; }
.modal-tags      { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.modal-tag {
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.75rem;
  color: var(--muted);
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: var(--font-body);
}
.modal-close:hover { background: var(--accent); color: var(--bg); }

/* ----------------------------------------------------------------
   CONTACT PAGE
   ---------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: start;
}
.contact-info h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 1.2rem; }
.contact-info p  { color: var(--muted); font-size: 0.95rem; margin-bottom: 2rem; }

.contact-detail {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.contact-detail-icon {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.contact-detail-label { font-size: 0.78rem; color: var(--muted); }
.contact-detail-value { font-size: 0.92rem; }

.social-links { display: flex; gap: 0.8rem; margin-top: 2.5rem; }
.social-link {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* Contact form card */
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Inline form error message */
.form-error {
  color: var(--error);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}

/* Success state shown after submission */
.form-success {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
}
.form-success .success-icon { font-size: 3rem; margin-bottom: 1rem; }
.form-success h3 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 0.8rem; }
.form-success p  { color: var(--muted); font-size: 0.9rem; }

/* ----------------------------------------------------------------
   8. RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .home-hero    { grid-template-columns: 1fr; }
  .hero-visual  { display: none; }   /* hide geometric art on small screens */
  .about-grid   { grid-template-columns: 1fr; }
  .about-img-wrap { max-width: 340px; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .stats        { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  nav           { padding: 0 1.2rem; }
  .nav-links    { display: none; }
  .hamburger    { display: flex; }
  .container    { padding: 0 1.2rem; }
  .section-pad  { padding: calc(var(--nav-h) + 3.5rem) 0 3.5rem; }
  .stats        { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
  .hero-copy    { padding: 4rem 1.2rem 2rem; }
  .contact-form { padding: 1.5rem; }
  .modal-body   { padding: 1.5rem; }
}
