/*
Theme Name:   Arman Alipour
Theme URI:    https://armanalipour.com
Author:       SORAN MG
Author URI:   https://armanalipour.com
Description:  Custom portfolio theme for 2D animator/director Arman Alipour. Built from a Figma design (fileKey 8YxHrAdHO1resylTb1Efeu) — full-bleed video hero, no-scroll marketing pages, a "Work" custom post type with archive and single case-study templates, and a mobile staggered menu.
Version:      1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.6
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  arman-alipour

FONT NOTE: "TheGoodMonolith" (nav/body copy) and "Briller" (display
headings) are paid/custom fonts referenced below via @font-face but not
bundled — drop the licensed .woff2 files into assets/fonts/ and they
activate automatically (font-display:block, no fallback flash). Until
then JetBrains Mono / Unbounded are the fallbacks, loaded from Google
Fonts (see inc/enqueue.php) — no local files needed for those two.

VENDOR JS NOTE: GSAP + SplitText + ScrambleTextPlugin (the scrambled-text
hover effect) load from the jsdelivr CDN — see inc/enqueue.php. No local
vendor files needed.

LAYOUT NOTE: every page except single-work is locked to one viewport (no
scrolling). Type scales with vmin so a page that fits a 27" monitor also
fits, without scrolling, a short laptop screen or a landscape phone.
*/

@font-face {
  font-family: 'TheGoodMonolith';
  src: url('assets/fonts/goodmonolith/goodmonolith.woff2') format('woff2');
  font-weight: 500;
  font-display: block;
}

@font-face {
  font-family: 'Briller';
  src: url('assets/fonts/briller/Briller-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: block;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/goodmonolith/goodmonolith.woff2') format('woff2');
  font-weight: 500;
  font-display: block;
}

@font-face {
  font-family: 'Unbounded';
  src: url('assets/fonts/briller/Briller-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: block;
}

:root {
  --bg: #0b0b0b;
  --text: #ffffff;
  --text-muted: #d9d9d9;
  --accent: #34c759;

  --header-h: clamp(56px, 9vh, 100px);
  --footer-h: clamp(44px, 7vh, 76px);
  --gutter: clamp(20px, 3.5vw, 42px);

  --fs-nav: clamp(11px, 1.6vmin, 22px);
  --fs-heading: clamp(32px, 10vmin, 128px);
  --fs-body: clamp(11px, 1.7vmin, 25px);
  --fs-lead: clamp(15px, 2.6vmin, 38px);
  --fs-credit: clamp(9px, 1.1vmin, 16px);

  --font-display: 'Briller', 'Unbounded', 'Archivo Black', sans-serif;
  --font-mono: 'TheGoodMonolith', 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Motion ---------- */

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ---------- Header ---------- */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--header-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--gutter);
	z-index: 100;
	mix-blend-mode: difference;
	background: rgba(6, 6, 6, 0.68);
	border-radius: 16px;
	box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(15.9px);
	-webkit-backdrop-filter: blur(15.9px);
}

.site-header .logo {
  font-family: var(--font-mono);
  font-size: 24px;
  color: #fff;
  text-decoration: none;  
  letter-spacing: 0.02em;
  mix-blend-mode: exclusion;
  transition: opacity .25s var(--ease), letter-spacing .25s var(--ease);
}

.site-header .logo:hover {
  opacity: 0.75;
  letter-spacing: 0.05em;
}

.site-header nav {
  display: flex;
  gap: clamp(20px, 3.5vw, 56px);
}

/* wp_nav_menu() always wraps items in <ul><li> — make that wrapper
   layout-transparent so the flex/gap rules above still apply directly
   to the <a> tags, matching the original flat markup exactly. */
.site-header nav ul,
.site-header nav li {
  display: contents;
}

.site-header nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 24px;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  mix-blend-mode: exclusion;
  padding-bottom: 4px;
  transition: opacity .25s var(--ease);
}



.site-header nav a:hover::after,
.site-header nav a.current-menu-item::after,
.site-header nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-header nav a[aria-current="page"] {
  opacity: 0.6;
}

/* ---------- Footer ---------- */

.site-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: var(--footer-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--gutter);
	z-index: 100;
	mix-blend-mode: difference;
	background: rgba(6, 6, 6, 0.68);
	border-radius: 16px;
	box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(15.9px);
	-webkit-backdrop-filter: blur(15.9px);
}

.site-footer .socials {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
}

.site-footer .socials a {
  display: flex;
  color: #fff;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}

.site-footer .socials a:hover {
  transform: translateY(-3px);
  opacity: 0.75;
}

.site-footer .socials svg {
  width: 28px;
  height: 28px;
}

.site-footer .credit {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- Page shell ---------- */

/*
 * Global scroll behaviour is now fully native. There is no
 * overflow:hidden lock on html/body any more — every page scrolls
 * naturally when its content exceeds the viewport.
 *
 * For pages whose designed content is short enough to fit a
 * desktop screen (About, Contact, 404, generic Page) we keep
 * `min-height: 100dvh` on main so the layout responsively fills
 * the viewport without being clipped. Taller pages (Works grid,
 * single case studies, search results) start below the fixed
 * header and simply grow; scrolling kicks in automatically as
 * soon as content exceeds the viewport.
 */

.page {
  position: relative;
}

/* Short / one-screen pages. main carries no explicit class so we
   target it with :not([class]) to avoid clobbering index-content
   or any future custom mains. */
.page > main:not([class]) {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--header-h) var(--gutter) var(--footer-h);
}

/* Works archive: starts below the fixed header and grows down as
   more case-study cards are added — scrolls naturally. */
.page.page--works > main:not([class]) {
  justify-content: flex-start;
  padding-top: calc(var(--header-h) + clamp(16px, 3vh, 32px));
}

/* Search results / blog-style listing fallback. */
.index-content {
  justify-content: flex-start;
  height: auto;
  min-height: 100dvh;
  padding: calc(var(--header-h) + clamp(16px, 3vh, 32px)) var(--gutter) var(--footer-h);
}

.page-heading {
	font-family: var(--font-display);
	font-weight: 900;
	text-transform: uppercase;
	line-height: 0.82;
	font-size: 128px;
	margin-bottom: clamp(16px, 3.2vh, 48px);
	animation: fade-up .7s var(--ease) both .15s;
	flex-shrink: 0;
	margin-top: 64px;
}

.page-copy {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  max-width: 1833px;
  overflow: hidden;
}

.wp-block-paragraph{
  font-size: 40px;
}

.lead-movment {
  font-size: 60px;
}

.lead-resonates{
  font-size: 42px;
}

.page-copy p {
  margin-bottom: 23px;
  opacity: 0;
  animation: fade-up .6s var(--ease) both;
}

.page-copy p:nth-child(1) { animation-delay: .22s; }
.page-copy p:nth-child(2) { animation-delay: .28s; }
.page-copy p:nth-child(3) { animation-delay: .34s; }
.page-copy p:nth-child(4) { animation-delay: .40s; }
.page-copy p:nth-child(5) { animation-delay: .46s; }
.page-copy p:nth-child(6) { animation-delay: .52s; }
.page-copy p:nth-child(7) { animation-delay: .58s; }

/* Chars split out by scrambled-text.js (GSAP SplitText) for the
   reactbits.dev/text-animations/scrambled-text hover effect. */
.page-copy .char,
.work-single-body .char {
  display: inline-block;
  will-change: transform;
}

.page-copy .accent {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size .35s var(--ease);
}

.page-copy .accent:hover { background-size: 100% 1px; }

.page-copy .lead {
  font-size: var(--fs-lead);
  margin: 0.5em 0;
}

/* ---------- Hero (front page) ---------- */

.hero {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: #404040;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fade-in 1s ease both;
}

.hero-title {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: left;
  padding: 0 var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  /* Permanent — no animation on this element itself: animating
     opacity/transform on a mix-blend-mode element makes the browser tear
     down its compositing layer once the animation ends, which freezes
     the blend to a flat colour instead of continuing to react to the
     video behind it. The entrance motion lives on .hero-title-in. */
}

.hero-title-in {
  animation: fade-up .9s var(--ease) both .25s;
}

.hero-title h1 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.86;
  font-size: 128px;
}

.hero-title h1 span { display: block; }

.hero-title p {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 42px;
  line-height: 1.4;
  margin-top: clamp(10px, 1.6vh, 22px);
  width: 71%;
}

/* ---------- Works grid ---------- */

.works-grid {
  display: grid;
  grid-template-columns: 1.76fr 1fr;
  gap: clamp(14px, 1.8vw, 32px);
  flex: 1;
  min-height: 0;
}

.works-grid a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  isolation: isolate;
  animation: fade-up .7s var(--ease) both;
}

.works-grid a:nth-child(1) { animation-delay: .2s; }
.works-grid a:nth-child(2) { animation-delay: .3s; }

.works-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease), filter .6s var(--ease);
}

.works-grid a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.75) 100%);
  opacity: 0;
  transition: opacity .4s var(--ease);
}

.works-grid a::before {
  content: attr(data-label);
  position: absolute;
  left: clamp(14px, 1.6vw, 24px);
  bottom: clamp(14px, 1.6vh, 24px);
  z-index: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-nav);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

.works-grid a:hover img { transform: scale(1.06); filter: brightness(0.85); }
.works-grid a:hover::after { opacity: 1; }
.works-grid a:hover::before { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .works-grid { grid-template-columns: 1fr; }
}

/* Inside the scrollable Works archive, .works-grid's tiles can no longer
   size themselves as a percentage of .page's height (.page is now
   height:auto there, so 100% would collapse to nothing) — give each
   tile its own aspect ratio instead so the grid keeps its card look and
   simply wraps/grows to a new row (and the page scrolls) as more Work
   posts get added, instead of depending on a fixed one-screen height. */
html.scrollable .works-grid {
  flex: none;
  min-height: 0;
}

html.scrollable .works-grid a {
  height: auto;
  aspect-ratio: 4 / 3;
}

@media (max-width: 900px) {
  html.scrollable .works-grid a {
    aspect-ratio: 1 / 1;
  }
}

/* ==========================================================================
   Single work (case study) page
   Unlike the rest of the site this page scrolls — credit lists run long
   and shouldn't be squeezed to fit one viewport.
   ========================================================================== */

.work-single {
  padding-top: calc(var(--header-h) + clamp(20px, 4vh, 48px));
  padding-bottom: calc(var(--footer-h) + clamp(32px, 6vh, 64px));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  max-width: 1400px;
  margin: 0 auto;
}

.work-single-media {
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a1a;
  animation: fade-up .7s var(--ease) both;
}

.work-single-media img,
.work-single-media video {
  width: 100%;
  height: auto;
  display: block;
}

.work-single-body {
  max-width: 1100px;
  margin-top: clamp(24px, 4vh, 48px);
}

.work-single-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(20px, 2.6vw, 34px);
  color: #fff;
  margin-bottom: clamp(16px, 2.5vh, 28px);
  animation: fade-up .6s var(--ease) both .1s;
}

.work-single-title .meta {
  color: var(--text-muted);
  font-weight: 500;
}

.work-single-desc {
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.3vw, 19px);
  line-height: 1.6;
  color: #fff;
  max-width: 68ch;
  margin-bottom: clamp(28px, 4vh, 44px);
  animation: fade-up .6s var(--ease) both .16s;
}

.work-single-desc p {
  margin-bottom: 1em;
}

.work-single-desc p:last-child {
  margin-bottom: 0;
}

.work-single-credit-label {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.1vw, 17px);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: clamp(16px, 2.5vh, 24px);
  animation: fade-up .6s var(--ease) both .22s;
}

.work-single-credits {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.15vw, 18px);
  line-height: 1.75;
  color: #fff;
  animation: fade-up .6s var(--ease) both .28s;
}

.work-single-credits + .work-single-credits {
  margin-top: 1.6em;
}

.work-single-back {
  display: inline-block;
  margin-top: clamp(32px, 5vh, 56px);
  font-family: var(--font-mono);
  font-size: var(--fs-nav);
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}

.work-single-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   Mobile staggered menu
   Style reference: https://reactbits.dev/components/staggered-menu
   Recreated in vanilla CSS/JS using the site's own palette. Toggled via
   menu.js by flipping [data-open] attributes.
   ========================================================================== */

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--fs-nav);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  mix-blend-mode: exclusion;
  padding: 8px 0;
}

.menu-toggle-box {
  position: relative;
  width: 22px;
  height: 14px;
  flex-shrink: 0;
}

.menu-toggle-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: currentColor;
  transition: transform .35s var(--ease), opacity .35s var(--ease), top .35s var(--ease);
}

.menu-toggle-line:first-child { top: 0; }
.menu-toggle-line:last-child { top: 100%; transform: translateY(-100%); }

.menu-toggle[aria-expanded="true"] .menu-toggle-line:first-child {
  top: 50%; transform: translateY(-50%) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-line:last-child {
  top: 50%; transform: translateY(-50%) rotate(-45deg);
}

.menu-toggle-text { transition: opacity .2s var(--ease); }
.menu-toggle[aria-expanded="true"] .menu-toggle-text { opacity: 0.7; }

.staggered-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}

.staggered-menu[data-open="true"] { pointer-events: auto; }

.staggered-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.001);
}

.staggered-menu-layer {
  position: absolute;
  inset: 0;
  background: var(--layer-color);
  transform: translateX(100%);
  transition: transform .55s var(--ease);
}

.staggered-menu-layer:nth-of-type(1) { transition-delay: 0s; }
.staggered-menu-layer:nth-of-type(2) { transition-delay: .09s; }
.staggered-menu-layer:nth-of-type(3) { transition-delay: .18s; }

.staggered-menu[data-open="true"] .staggered-menu-layer {
  transform: translateX(0);
}
.staggered-menu[data-open="false"] .staggered-menu-layer {
  transition-delay: 0s;
}

.staggered-menu-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: var(--bg);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: var(--header-h) var(--gutter) var(--footer-h);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .6s var(--ease) .26s;
}

.staggered-menu[data-open="true"] .staggered-menu-panel {
  transform: translateX(0);
}

.staggered-menu-close {
  position: absolute;
  top: calc(var(--header-h) / 2);
  right: var(--gutter);
  transform: translateY(-50%);
  width: 22px; height: 22px;
  background: none;
  border: 0;
  cursor: pointer;
}

.staggered-menu-close span {
  position: absolute;
  top: 50%; left: 0;
  width: 100%; height: 2px;
  background: #fff;
}
.staggered-menu-close span:first-child { transform: rotate(45deg); }
.staggered-menu-close span:last-child { transform: rotate(-45deg); }

.staggered-menu-logo {
  font-family: var(--font-mono);
  font-size: var(--fs-nav);
  color: #fff;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

.staggered-menu[data-open="true"] .staggered-menu-logo {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .38s;
}

.staggered-menu-list {
  list-style: none;
  margin: auto 0;
}

.staggered-menu-list li {
  overflow: hidden;
}

.staggered-menu-list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  text-decoration: none;
  color: #fff;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .25s var(--ease);
  transition-delay: calc(var(--i) * .07s + .34s);
}

.staggered-menu[data-open="true"] .staggered-menu-list a {
  opacity: 1;
  transform: translateY(0);
}

.staggered-menu-list a:hover,
.staggered-menu-list a:focus-visible {
  color: var(--accent);
}

.staggered-menu-list .num {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.6vh, 16px);
  color: var(--accent);
}

.staggered-menu-list .label {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(24px, 6.5vh, 44px);
  line-height: 1;
}

.staggered-menu-socials {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity .5s var(--ease) .55s;
}

.staggered-menu[data-open="true"] .staggered-menu-socials {
  opacity: 1;
}

.staggered-menu-socials .socials-label {
  font-family: var(--font-mono);
  font-size: var(--fs-credit);
  color: var(--text-muted);
  text-transform: uppercase;
}

.staggered-menu-socials .socials-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.staggered-menu-socials a {
  font-family: var(--font-mono);
  font-size: var(--fs-credit);
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}

.staggered-menu-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 760px) {
  .site-header nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  .site-header nav { gap: 14px; }
}

/* ---------- WP core alignment/caption defaults (kept minimal on purpose) ---------- */

.alignwide { max-width: 1600px; }
.alignfull { max-width: none; }
.wp-caption,
.wp-block-image figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-credit);
  color: var(--text-muted);
}
