/* =========================================================
   style.css — Clean & Classy Portfolio
   ========================================================= */

/* ---------------------------------------------------------
   1. Fonts
   --------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ---------------------------------------------------------
   2. CSS Variables & Theme
   --------------------------------------------------------- */

:root {
  --color-bg: #fafafa;
  --color-bg-alt: #ffffff;
  --color-fg: #0a0a0a;
  --color-muted: #555555;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-hover: rgba(0, 0, 0, 0.2);

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root, :root[data-theme="auto"] {
    --color-bg: #0a0a0a;
    --color-bg-alt: #0f0f0f;
    --color-fg: #fafafa;
    --color-muted: #999999;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.2);
    color-scheme: dark;
  }
}

:root[data-theme="light"] {
  --color-bg: #fafafa;
  --color-bg-alt: #ffffff;
  --color-fg: #0a0a0a;
  --color-muted: #555555;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-hover: rgba(0, 0, 0, 0.2);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-bg-alt: #0f0f0f;
  --color-fg: #fafafa;
  --color-muted: #999999;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.2);
  color-scheme: dark;
}

/* ---------------------------------------------------------
   3. Base Reset
   --------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-fg);
  background-color: var(--color-bg);
  min-height: 100vh;
  transition: background-color var(--transition-base), color var(--transition-base);
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------------------------------------------------------
   4. Typography
   --------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero__title,
.nav__logo,
.projects__header h2,
.photos__header h2,
.about__header h2,
.contact__header h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3.5rem, 12vw, 8rem);
}

h2 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  color: var(--color-muted);
  max-width: 60ch;
}

/* ---------------------------------------------------------
   5. Layout
   --------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section {
  padding: var(--space-xl) 0;
}

/* ---------------------------------------------------------
   6. Navigation
   --------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  transition: all var(--transition-base);
}

.nav.scrolled {
  background: rgba(250, 250, 250, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

:root[data-theme="dark"] .nav.scrolled {
  background: rgba(10, 10, 10, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .nav.scrolled {
    background: rgba(10, 10, 10, 0.9);
  }
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}

.nav__logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-fast);
}

.nav__logo:hover {
  opacity: 0.6;
}

.nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav__link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-muted);
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-fg);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-fg);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* Hamburger Menu Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 102;
}

.nav__toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-fg);
  margin: 2px 0;
  transition: all var(--transition-base);
  border-radius: 1px;
}

.nav__toggle.active .nav__toggle-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav__toggle.active .nav__toggle-line:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active .nav__toggle-line:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

@media (max-width: 640px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    background: var(--color-bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: 101;
  }

  .nav__links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    font-size: 1.5rem;
    font-family: var(--font-serif);
  }
}

/* ---------------------------------------------------------
   7. Hero Section
   --------------------------------------------------------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  padding-top: 120px;
  border-top: none !important;
}

.hero__image {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-md);
  transition: transform var(--transition-base);
}

.hero__image:hover {
  transform: scale(1.02);
}

.hero__title {
  margin-bottom: 0.5rem;
  cursor: default;
  text-align: center;
  line-height: 1;
}

.hero__name-first,
.hero__name-last {
  display: block;
}

.hero__subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-muted);
  margin-bottom: var(--space-md);
  letter-spacing: 0.02em;
}

.hero__socials {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  transition: all var(--transition-base);
}

.social-link:hover {
  color: var(--color-fg);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}

.social-link svg {
  width: 17px;
  height: 17px;
}

/* ---------------------------------------------------------
   8. Projects Section
   --------------------------------------------------------- */

.projects {
  background: var(--color-bg);
}

.projects__header,
.photos__header,
.about__header,
.contact__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.projects__header h2,
.photos__header h2,
.about__header h2,
.contact__header h2 {
  margin: 0;
}

.label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.projects__list {
  max-width: 720px;
  margin: 0 auto;
}

.project-item {
  display: block;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.project-item:first-child {
  border-top: 1px solid var(--color-border);
}

.project-item__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.project-item__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

.project-item__role {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.project-item__description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
  max-width: none;
}

.project-item__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-top: 0.75rem;
  transition: all var(--transition-fast);
}

.project-item__link:hover {
  color: var(--color-fg);
}

.project-item__link svg {
  width: 12px;
  height: 12px;
  transition: transform var(--transition-fast);
}

.project-item__link:hover svg {
  transform: translateX(2px);
}

@media (max-width: 640px) {
  .project-item__header {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ---------------------------------------------------------
   9. Photos Section
   --------------------------------------------------------- */

.photos__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.15s ease-out;
  cursor: pointer;
  position: relative;
}

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

.photos__links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.photos__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.photos__link-label {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .photos__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------
   10. About Section
   --------------------------------------------------------- */

.about {
  background: var(--color-bg);
}

.about__content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about__text p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  text-align: left;
}

.about__text p:first-child {
  font-size: 1.2rem;
  color: var(--color-fg);
  font-weight: 400;
}

.about__text p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------
   11. Contact Section
   --------------------------------------------------------- */

.contact__inner {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.contact__header {
  margin-bottom: var(--space-sm);
}

.contact__text {
  margin-bottom: var(--space-md);
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--color-fg);
  border-radius: 100px;
  color: var(--color-fg);
  background: transparent;
  transition: all var(--transition-base);
}

.btn:hover {
  background: var(--color-fg);
  color: var(--color-bg);
  transform: translateY(-2px);
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn:hover svg {
  transform: translateX(4px);
}

/* ---------------------------------------------------------
   12. Featured Section
   --------------------------------------------------------- */

.featured {
  padding: var(--space-lg) 0;
  background: var(--color-bg);
}

.featured__label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-align: center;
  display: block;
  width: 100%;
  margin-bottom: var(--space-md);
}

.featured__scroller {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.featured__track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: scroll-logos var(--logo-duration, 30s) linear infinite;
}


@keyframes scroll-logos {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-1 * var(--logo-distance, 50%))); }
}

.featured__logo {
  flex-shrink: 0;
  height: 28px;
  width: auto;
  opacity: 0.4;
  transition: opacity var(--transition-base);
}

:root[data-theme="light"] .featured__logo {
  filter: invert(1) grayscale(100%);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .featured__logo {
    filter: invert(1) grayscale(100%);
  }
}

:root[data-theme="dark"] .featured__logo {
  filter: grayscale(100%);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .featured__logo {
    filter: grayscale(100%);
  }
}

.featured__logo:hover {
  opacity: 0.8;
}

/* ---------------------------------------------------------
   13. Footer
   --------------------------------------------------------- */

.footer {
  padding: var(--space-md) 0;
  text-align: center;
  background: var(--color-bg);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.theme-toggle {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-align: center;
}

.theme-toggle:hover {
  border-color: var(--color-border-hover);
  color: var(--color-fg);
}

/* ---------------------------------------------------------
   14. Responsive Adjustments
   --------------------------------------------------------- */

@media (max-width: 768px) {
  :root {
    --space-xl: 4rem;
    --space-lg: 3rem;
    --space-md: 1.5rem;
  }

  .hero {
    padding-top: 100px;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .hero__image {
    width: 130px;
    height: 130px;
  }

  h1 {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  h2 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .container {
    padding: 0 var(--space-sm);
  }

  .about__text p {
    font-size: 1rem;
  }

  .about__text p:first-child {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  :root {
    --space-xl: 3rem;
    --space-lg: 2rem;
    --space-md: 1rem;
  }

  .hero {
    padding-top: 80px;
    min-height: auto;
    padding-bottom: var(--space-lg);
  }

  .hero__image {
    width: 110px;
    height: 110px;
  }

  h1 {
    font-size: clamp(2rem, 14vw, 3rem);
  }

  h2 {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .hero__subtitle {
    font-size: 0.85rem;
  }

  .hero__socials {
    gap: 0.5rem;
  }

  .social-link {
    width: 36px;
    height: 36px;
  }

  .social-link svg {
    width: 15px;
    height: 15px;
  }

  .project-item {
    padding: 1.25rem 0;
  }

  .project-item__title {
    font-size: 1rem;
  }

  .project-item__description {
    font-size: 0.85rem;
  }

  .photos__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }

  .photos__links {
    gap: var(--space-md);
  }

  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.85rem;
  }

  .featured__track {
    gap: 2rem;
  }

  .featured__logo {
    height: 22px;
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* ---------------------------------------------------------
   15. Reduced Motion
   --------------------------------------------------------- */

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

  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------
   16. View Transitions
   --------------------------------------------------------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
}
