/* 
   Agency Light Theme 
   Reference: Modern, Minimal, Editorial
*/

:root {
  /* Colors */
  --bg-color: #ffffff;
  --text-primary: #000000;
  --text-secondary: #555555;
  --border-color: #e5e5e5;
  --accent-color: #000000;
  --shadow-color: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --nav-border: rgba(0, 0, 0, 0.04);
  --nav-shadow-1: rgba(0, 0, 0, 0.06);
  --nav-shadow-2: rgba(0, 0, 0, 0.04);

  /* Fonts */
  --font-main: 'Inter', sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;
  /* Massive negative space */
  --spacing-xxl: 12rem;

  /* Layout */
  --max-width: 1400px;
  --container-padding: 2rem;
  --nav-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: var(--nav-height);
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
}

#smooth-wrapper,
#smooth-content {
  max-width: 100%;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.6;
}

a:focus-visible,
button:focus-visible,
.nav-right a:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

a:not(.btn) {
  border-bottom: 1px solid var(--text-primary);
}

ul {
  list-style: none;
}

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

.fade-image {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-image.is-loaded {
  opacity: 1;
  transform: none;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  background: var(--bg-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border: 1px solid var(--text-primary);
  border-radius: 999px;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(10px);
}

/* Typography Utility */
.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

/* Layout Utility */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--spacing-xl) 0;
  scroll-margin-top: var(--nav-height);
}

/* Navigation */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--container-padding);
  position: fixed;
  width: 100%;
  height: var(--nav-height);
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px) saturate(120%);
  z-index: 100;
  border-bottom: 1px solid var(--nav-border);
}

.logo {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.1em;
  border-bottom: none;
  color: var(--text-primary);
}

.logo-mark {
  display: block;
  width: 110px;
  height: auto;
}

.nav-right {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.nav-right a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

nav.nav-container a {
    border: none;
}

.theme-toggle {
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--text-primary);
  opacity: 1;
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
}

.icon-sun {
  display: inline;
}

.icon-moon {
  display: none;
}

.section-subtitle {
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
}

/* Hero Section */
.hero-section {
  padding: calc(var(--nav-height) + var(--spacing-md)) 0 var(--spacing-xxl) 0;
  min-height: 90vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--spacing-xl);
  align-items: center;
}

.hero-greeting {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  display: block;
}

.hero-headline {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.hero-subtext {
  display: none;
}

.meta-list {
  margin-bottom: var(--spacing-md);
}

.meta-list li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  /* Tightened from md */
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-color);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--text-secondary);
  opacity: 1;
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  opacity: 1;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.avatar-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--spacing-md);
  background-color: #f0f0f0;
  /* Fallback */
}

.initials {
  display: none;
  /* Hide if we revert to div, but we are using img now */
}

.hero-bio {
  max-width: 300px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Selected Work */
.section-label {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  display: block;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-sm);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xxl);
  /* Big vertical spacing */
}

.project-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm) var(--spacing-lg);
  align-items: center;
  padding: var(--spacing-sm);
  border: 1px solid transparent;
  border-radius: 6px;
}

.project-visual {
  width: 100%;
  aspect-ratio: 16/10;
  transition: transform 0.3s ease;
  overflow: hidden;
  /* Ensure image doesn't overflow border radius if added */
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.project-details {
  padding-left: var(--spacing-md);
}

.project-title {
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.project-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.project-meta {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  font-size: 0.8rem;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--text-primary);
  padding-bottom: 2px;
}

/* About Section */
.about-intro {
  font-size: 1.5rem;
  line-height: 1.6;
  max-width: 800px;
  margin-bottom: var(--spacing-lg);
}

.about-intro p:first-child {
  margin-bottom: var(--spacing-md);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

.about-subhead {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
}

.about-list li {
  margin-bottom: var(--spacing-sm);
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

.service-item {
  /* No border-right needed for clean grid */
}

.service-title {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-list li {
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.5;
}

/* Contact Section */
.contact-section {
  padding: var(--spacing-lg) 0;
  text-align: center;
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
}

.contact-wrapper {
  text-align: center;
  max-width: 800px;
}

.contact-headline {
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 400;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.contact-subtext {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
  text-wrap: balance;
}

.btn-pill-large {
  display: inline-block;
  background-color: var(--text-primary);
  color: var(--bg-color);
  padding: 1.5rem 3rem;
  border-radius: 100px;
  font-size: 1.5rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}

.btn-pill-large:hover {
  transform: scale(1.05);
  background-color: #000;
  opacity: 1;
}

.contact-hint {
  margin-top: var(--spacing-md);
  color: #3d3d3d;
  font-size: 0.8rem;
}

/* Footer */
.footer {
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-xxl);
}

.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright,
.location {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
  :root {
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;
    --container-padding: 1.5rem;
    --nav-height: 76px;
  }

  .hero-grid,
  .project-item,
  .about-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .hero-right {
    align-items: flex-start;
    text-align: left;
    order: 1;
    /* Avatar below text on mobile */
  }

  .project-details {
    padding-left: 0;
  }

  /* Mobile Navigation */
  .nav-right {
    gap: var(--spacing-sm);
    font-size: 0.95rem;
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .nav-right a {
    display: none;
  }

  /* Mobile Footer */
  .footer-flex {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }

  .footer-flex a {
    text-decoration: underline;
  }
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f1115;
    --text-primary: #f5f7fb;
    --text-secondary: #c4c8d2;
    --border-color: #262b35;
    --accent-color: #f5f7fb;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --nav-bg: rgba(17, 20, 26, 0.8);
    --nav-border: rgba(255, 255, 255, 0.08);
    --nav-shadow-1: rgba(0, 0, 0, 0.4);
    --nav-shadow-2: rgba(255, 255, 255, 0.03);
  }
}

.theme-dark {
  --bg-color: #0f1115;
  --text-primary: #f5f7fb;
  --text-secondary: #c4c8d2;
  --border-color: #262b35;
  --accent-color: #f5f7fb;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(17, 20, 26, 0.8);
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-shadow-1: rgba(0, 0, 0, 0.4);
  --nav-shadow-2: rgba(255, 255, 255, 0.03);
}

.theme-light {
  --bg-color: #ffffff;
  --text-primary: #000000;
  --text-secondary: #555555;
  --border-color: #e5e5e5;
  --accent-color: #000000;
  --shadow-color: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --nav-border: rgba(0, 0, 0, 0.04);
  --nav-shadow-1: rgba(0, 0, 0, 0.06);
  --nav-shadow-2: rgba(0, 0, 0, 0.04);
}
/* Tablet and smaller screens */
@media (max-width: 768px) {
  .footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-direction: column-reverse;
    text-align: center;
  }
}

@media (max-width: 600px) {
  :root {
    --container-padding: 1.25rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 3.5rem;
    --spacing-xxl: 4rem;
    --nav-height: 72px;
  }

  .hero-section {
    min-height: 80vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-image {
    transition: none;
    transform: none;
    opacity: 1;
  }

  * {
    scroll-behavior: auto;
  }
}
