/*
  wavefrom — Design System
  Inspired by: Obys, basement.studio, Actual Source, OCHI Design
  Principles: Typography as hero, strategic color, editorial confidence
*/

@font-face {
  font-family: 'FIGScript';
  src: url('../fonts/FIGWebScript.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'News Plantin';
  src: url('../fonts/NewsPlantinMTPro-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000;
  --white: #fff;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-600: #525252;
  --gray-800: #262626;
  --gray-900: #171717;
  --gray-950: #0a0a0a;

  /* Strategic accent — warm, intentional */
  --accent: #ff4d00;

  --bg: var(--gray-950);
  --text: var(--white);
  --text-muted: var(--gray-400);
  --border: var(--gray-800);

  /* Typography scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  --text-2xl: clamp(2rem, 1.5rem + 2.5vw, 4rem);
  --text-3xl: clamp(3rem, 2rem + 5vw, 8rem);
  --text-display: clamp(4rem, 3rem + 8vw, 15rem);

  --font-sans: "News Plantin", Georgia, serif;
  --font-display: "News Plantin", Georgia, serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background-color: var(--bg);
  background-image: url('../images/115-1560_IMG.JPG');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  text-transform: lowercase;
}

/* Safari-specific fix for background-attachment */
@supports (-webkit-appearance: none) {
  body {
    background-attachment: scroll;
  }
  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/115-1560_IMG.JPG');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -2;
  }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
  pointer-events: none;
}

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

/* Links — Minimal, confident */
a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.container--narrow {
  max-width: 900px;
}

/* ═══════════════════════════════════════════════════════════
   HEADER — Extreme Minimalism
   ═══════════════════════════════════════════════════════════ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.25rem 1rem;
  mix-blend-mode: difference;
}

header .container {
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo {
  font-family: 'FIGScript', cursive;
  font-size: 2.5rem;
  font-weight: normal;
  letter-spacing: -0.02em;
  text-transform: none;
}

.header__tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* Hamburger Toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s var(--ease-out-expo);
}

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

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

/* Nav Menu */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-out-expo);
  z-index: 100;
  padding-left: calc(50% - 150px);
}

.nav.active {
  opacity: 1;
  visibility: visible;
}

.nav a {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-2xl);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease-out-expo);
}

.nav a:hover,
.nav a.active {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   HERO — Typography as Primary Visual Element
   ═══════════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 clamp(3rem, 8vh, 8rem);
  position: relative;
  border-top: none;
}

.hero__canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
}

.hero__title {
  position: relative;
  z-index: 2;
  font-family: 'FIGScript', cursive;
  font-size: var(--text-display);
  font-weight: normal;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-transform: none;
  white-space: nowrap;
}

.hero__title span {
  display: block;
}

.hero__subtitle {
  margin-top: clamp(2rem, 4vh, 4rem);
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 40ch;
  line-height: 1.4;
}

/* Scrolling indicator */
.hero__scroll {
  position: absolute;
  bottom: 2rem;
  right: 1rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.4;
  writing-mode: vertical-rl;
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS — Long-form Scroll Chapters
   ═══════════════════════════════════════════════════════════ */
section {
  padding: clamp(4rem, 12vh, 10rem) 0;
  border-top: 1px solid var(--border);
}

.section__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: clamp(3rem, 6vh, 6rem);
  flex-wrap: wrap;
  gap: 1rem;
}

.section__label {
  font-size: var(--text-xs);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.section__title {
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   PROJECTS — Anti-Portfolio: Each Card Unique
   ═══════════════════════════════════════════════════════════ */
.projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 70vh;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project:hover .project__image img {
  transform: scale(1.05);
}

.project:hover .project__arrow {
  transform: translate(0, 0);
  opacity: 1;
}

.project__content {
  padding: clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project__number {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project__info {
  margin-top: auto;
}

.project__title {
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.project__description {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 35ch;
  line-height: 1.5;
}

.project__tags {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.project__tag {
  font-size: var(--text-xs);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.3s var(--ease-out-expo);
}

.project:hover .project__tag {
  border-color: var(--text-muted);
}

.project__image {
  position: relative;
  overflow: hidden;
  background: var(--gray-900);
}

.project__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out-expo);
}

.project__arrow {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(1rem, 1rem);
  opacity: 0;
  transition: all 0.4s var(--ease-out-expo);
}

.project__arrow::before {
  content: "→";
  font-size: 1.25rem;
}

/* Alternate layout for variety */
.project:nth-child(even) {
  direction: rtl;
}

.project:nth-child(even) > * {
  direction: ltr;
}

/* Unique accents per project — Anti-Portfolio */
.project[data-accent="forest"] .project__title {
  color: #22c55e;
}

.project[data-accent="agency"] .project__title {
  color: var(--accent);
}

.project[data-accent="eloise"] .project__title {
  color: #ec4899;
}

/* ═══════════════════════════════════════════════════════════
   LIST LAYOUT — Library, Blog
   ═══════════════════════════════════════════════════════════ */
.list {
  display: flex;
  flex-direction: column;
}

.list__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: clamp(1.5rem, 3vh, 2.5rem) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  transition: all 0.3s var(--ease-out-expo);
}

.list__item:hover {
  padding-left: 1rem;
}

.list__item:hover .list__title {
  color: var(--accent);
}

.list__title {
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.3s var(--ease-out-expo);
}

.list__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.list__description {
  grid-column: 1 / -1;
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 60ch;
  margin-top: -0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   PROJECT DETAIL PAGE
   ═══════════════════════════════════════════════════════════ */
.project-hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10rem 0 clamp(3rem, 8vh, 6rem);
}

.project-hero__title {
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: clamp(2rem, 4vh, 3rem);
}

.project-hero__description {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 50ch;
  line-height: 1.5;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding: clamp(2rem, 4vh, 4rem) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: clamp(3rem, 6vh, 6rem);
}

.project-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-meta__label {
  font-size: var(--text-xs);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.project-meta__value {
  font-size: var(--text-base);
}

.project-content {
  padding: clamp(4rem, 10vh, 8rem) 0;
}

.project-content p {
  font-size: var(--text-lg);
  line-height: 1.7;
  max-width: 65ch;
  margin-bottom: 2rem;
  color: var(--gray-200);
}

.project-content img {
  width: 100%;
  margin: clamp(3rem, 6vh, 6rem) 0;
}

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER — For Library, Blog, etc.
   ═══════════════════════════════════════════════════════════ */
.page-header {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10rem 0 clamp(3rem, 6vh, 5rem);
  border-bottom: 1px solid var(--border);
}

.page-header__title {
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.page-header__description {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 45ch;
  margin-top: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER — Minimal
   ═══════════════════════════════════════════════════════════ */
footer {
  padding: clamp(3rem, 6vh, 5rem) 0;
  border-top: 1px solid var(--border);
  margin-top: clamp(4rem, 10vh, 10rem);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer__copyright {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer__tagline {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__links a {
  font-size: var(--text-xs);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out-expo);
}

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

/* ═══════════════════════════════════════════════════════════
   MICROINTERACTIONS
   ═══════════════════════════════════════════════════════════ */

/* Reveal animations */
[data-reveal] {
  opacity: 0;
  transform: translateY(2rem);
  transition: all 0.8s var(--ease-out-expo);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hover line effect */
.hover-line {
  position: relative;
  display: inline-block;
}

.hover-line::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease-out-expo);
}

.hover-line:hover::after {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .project {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .project:nth-child(even) {
    direction: ltr;
  }

  .project__image {
    aspect-ratio: 16 / 10;
    order: -1;
  }

  .project__content {
    padding: clamp(2rem, 4vw, 3rem);
  }
}

@media (max-width: 768px) {
  header {
    padding: 1rem 0;
  }

  nav {
    gap: 1rem;
  }

  .hero {
    min-height: 90vh;
  }

  .list__item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .list__meta {
    order: -1;
  }

  footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}
