:root {
  --white: oklch(1 0 0);
  --black: oklch(0 0 0);
  --footer: oklch(0.145 0 0);
  --gray: oklch(0.43 0 0);
  --line: oklch(0 0 0 / 10%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(1.25rem, 3vw, 3rem);
  --section: clamp(6rem, 12vw, 11rem);
  --z-header: 20;
  --z-modal: 40;
  --z-cursor: 60;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--white); }
body { margin: 0; background: var(--white); color: var(--black); font-family: Inter, Vazirmatn, Arial, sans-serif; font-kerning: normal; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
img { display: block; width: 100%; }
::selection { color: var(--white); background: var(--black); }

.skip-link { position: fixed; inset: 0 auto auto 1rem; translate: 0 -120%; z-index: 100; padding: .75rem 1rem; background: var(--black); color: var(--white); transition: translate .3s var(--ease); }
.skip-link:focus { translate: 0 1rem; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.site-header { position: fixed; inset: 0 0 auto; z-index: var(--z-header); display: flex; align-items: center; justify-content: flex-end; padding: 1.5rem var(--pad); color: var(--white); mix-blend-mode: difference; pointer-events: none; direction: ltr; }
.site-header > * { pointer-events: auto; }
.menu-toggle, .menu-close { position: relative; display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span { position: absolute; width: 1.45rem; height: 1px; background: currentColor; }
.menu-toggle span:last-child { rotate: 90deg; }

.menu-panel { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--black); color: var(--white); z-index: var(--z-modal); }
.menu-panel::backdrop { background: var(--black); }
.menu-panel[open] { animation: menu-in .65s var(--ease) both; }
.menu-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 1.5rem var(--pad) 2rem; }
.menu-top { display: flex; justify-content: flex-end; align-items: center; font-family: ui-monospace, monospace; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.menu-close { font-size: 2.25rem; font-weight: 300; }
.menu-panel nav { display: flex; flex-direction: column; margin: 4rem 0; }
.menu-panel nav a { display: flex; align-items: baseline; gap: 1.5rem; border-top: 1px solid oklch(1 0 0 / 18%); padding: .5rem 0 .8rem; font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 700; line-height: .95; letter-spacing: -.04em; transition: transform .5s var(--ease), opacity .5s var(--ease); }
.menu-panel nav a:hover { transform: translateX(-1.25rem); }
.menu-panel nav a span { font-family: ui-monospace, monospace; font-size: .7rem; letter-spacing: .1em; font-weight: 400; }
.menu-inner > p { margin: 0; color: oklch(1 0 0 / 66%); font-size: .9rem; }

.hero { position: relative; min-height: 88svh; display: grid; place-items: center; padding: 7rem var(--pad) 5rem; overflow: hidden; }
.hero-content { display: grid; justify-items: center; gap: 2rem; text-align: center; }
.hero h1 { display: flex; justify-content: center; margin: 0; max-width: 100%; padding-block: 2vw; font-size: 12vw; font-weight: 700; line-height: 1; letter-spacing: -.05em; white-space: nowrap; }
.letter-mask { display: inline-block; overflow: hidden; padding-bottom: .08em; }
.letter-mask > span { display: inline-block; }
.hero-space { width: .24em; }
.hero-content > p { margin: 0; color: var(--gray); font-size: clamp(1rem, 1.6vw, 1.45rem); letter-spacing: -.02em; }
.scroll-cue { position: absolute; bottom: 2rem; left: var(--pad); display: flex; align-items: center; gap: .8rem; direction: ltr; color: var(--gray); font-family: ui-monospace, monospace; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.scroll-cue span { width: 2.5rem; height: 1px; background: currentColor; }

.marquee { overflow: hidden; padding-block: 0 1rem; direction: ltr; }
.marquee-track { display: flex; width: max-content; gap: 1rem; direction: ltr; animation: marquee 30s linear infinite; will-change: transform; }
.marquee-group { display: flex; flex: 0 0 auto; gap: 1rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-card { width: clamp(13rem, 24vw, 48rem); aspect-ratio: 5 / 7; margin: 0; overflow: hidden; background: oklch(.92 0 0); }
.marquee-card.shape-1 { border-top-left-radius: 6.25rem; }
.marquee-card.shape-2 { border-top-right-radius: 6.25rem; border-bottom-left-radius: 2.5rem; }
.marquee-card.shape-3 { border-radius: 1rem; }
.marquee-card img { height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .7s var(--ease), transform .7s var(--ease); }
.marquee-card:hover img { filter: grayscale(0); transform: scale(1.05); }

.work { padding: var(--section) var(--pad); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.section-header h2 { margin: 0; font-size: clamp(3.5rem, 5.625vw, 4.5rem); font-weight: 500; line-height: 1; letter-spacing: -.05em; }
.section-header h2 span { display: block; }
.section-header p { margin: 0; color: var(--gray); font-family: ui-monospace, monospace; font-size: .75rem; letter-spacing: .08em; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(3rem, 7vw, 7rem) 3rem; padding-top: 2rem; }
.project-item { min-width: 0; }
.project-visual { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .25rem; background: oklch(.92 0 0); }
.project-visual img { height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .7s var(--ease), transform .7s var(--ease); }
.project-overlay { position: absolute; inset: 0; background: oklch(0 0 0 / 0%); transition: background .7s var(--ease); }
.project-arrow { position: absolute; top: 1.25rem; right: 1.25rem; width: 2rem; height: 2rem; padding: .4rem; border-radius: 50%; background: var(--white); opacity: 0; translate: -.5rem .5rem; transition: opacity .5s var(--ease), translate .5s var(--ease); }
.project-arrow path { fill: none; stroke: var(--black); stroke-width: 1.25; }
.project-visual:hover img { filter: grayscale(0); transform: scale(1.05); }
.project-visual:hover .project-overlay { background: oklch(0 0 0 / 10%); }
.project-visual:hover .project-arrow { opacity: 1; translate: 0; }
.project-meta { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.project-meta h3 { margin: 0; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.03em; }
.project-meta p { max-width: 34ch; margin: .55rem 0 0; color: var(--gray); font-size: .875rem; line-height: 1.6; }
.project-tags { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; color: var(--gray); font-family: ui-monospace, monospace; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

.site-footer { background: var(--footer); color: var(--white); padding: 3rem var(--pad) 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; }
.footer-grid h2 { margin: 0 0 1.25rem; font-family: ui-monospace, monospace; font-size: .7rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: oklch(1 0 0 / 55%); }
.footer-grid p, .footer-grid a { display: block; margin: 0; color: oklch(1 0 0 / 72%); font-size: .9rem; line-height: 1.85; }
.footer-grid a { width: fit-content; transition: color .5s var(--ease); }
.footer-grid a:hover { color: var(--white); }
.footer-brand { display: grid; gap: 2rem; }
.footer-brand .footer-logo { color: var(--white); font-size: 2.25rem; font-weight: 700; line-height: 1.1; letter-spacing: -.05em; direction: ltr; }
.footer-brand > p:last-child { max-width: 36ch; }
.footer-bottom { display: flex; justify-content: flex-start; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid oklch(1 0 0 / 12%); color: oklch(1 0 0 / 55%); font-family: ui-monospace, monospace; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }

.difference-cursor { position: fixed; top: -1rem; left: -1rem; z-index: var(--z-cursor); width: 2rem; height: 2rem; border: 1px solid var(--black); border-radius: 50%; background: var(--white); mix-blend-mode: difference; pointer-events: none; opacity: 0; transform: scale(1); transition: transform .55s var(--ease), opacity .2s linear; }
.difference-cursor.is-visible { opacity: 1; }
.difference-cursor.is-active { transform: scale(2.5); }
.menu-cursor { z-index: calc(var(--z-modal) + 1); }

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - .5rem)); } }
@keyframes menu-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

@media (pointer: fine) { .portfolio-page, .portfolio-page a, .portfolio-page button { cursor: none; } }
@media (max-width: 64rem) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-grid > section:last-child { grid-column: 2 / -1; }
}
@media (max-width: 42rem) {
  .hero { min-height: 80svh; }
  .hero h1 { white-space: normal; flex-wrap: wrap; font-size: clamp(4.25rem, 21vw, 6rem); line-height: .92; }
  .hero-space { flex-basis: 100%; height: .05em; }
  .scroll-cue { display: none; }
  .section-header { align-items: start; flex-direction: column; }
  .project-grid { grid-template-columns: 1fr; }
  .project-meta { align-items: start; }
  .project-meta h3 { font-size: 1.25rem; }
  .project-meta p { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
  .footer-grid > section:last-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .letter-mask > span { opacity: 1; translate: 0; }
  .marquee-track { animation: none; }
}
