/* Erfan Hassanpur — folio v2. Warm paper editorial. Fraunces / Space Grotesk / Vazirmatn / JetBrains Mono. */

:root {
    --paper: #fff7e9;
    --card: #FBF8F1;
    --ink: #2f302c;
    --muted: #5C554A;
    --faint: #8A8172;
    --line: rgba(25, 20, 16, 0.16);
    --accent: #FF4D1C;
    --accent-deep: #C9330A;
    --gold: #FFB627;
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Space Grotesk', system-ui, sans-serif;
    --fa: 'Vazirmatn', 'Space Grotesk', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --font: var(--sans);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --w: 1120px;
}

.lalezar-regular {
  font-family: "Lalezar", sans-serif;
  font-weight: 400;
  font-style: normal;
}


html[dir="rtl"] { --font: var(--fa); }

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

html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.65;
    overflow-x: hidden;
}

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

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; }

:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; border-radius: 2px; }

.skip {
    position: fixed; top: -60px; left: 16px; z-index: 200;
    background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 8px;
    font-size: 0.85rem; transition: top 0.2s ease;
}
.skip:focus { top: 12px; }

.progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 150;
    background: var(--accent);
    transform-origin: left; transform: scaleX(0);
    transition: all 0.6s ease;
}
html[dir="rtl"] .progress { transform-origin: right; }

/* ---------- masthead ---------- */
.head {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 224, 165, 0.664);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1.5px solid var(--ink);
}
.head-in {
    max-width: var(--w); margin: 0 auto; padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.brand-dot { color: var(--accent); }
.head-nav { display: flex; gap: 26px; }
.head-nav a { font-size: 0.88rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.head-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.head-side { display: flex; align-items: center; gap: 12px; }
.avail {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 0.68rem; color: var(--muted); white-space: nowrap;
}
.avail i { width: 8px; height: 8px; border-radius: 50%; background: #1d9e4b; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.talk {
    background: var(--ink); color: var(--paper); text-decoration: none;
    font-size: 0.82rem; font-weight: 600; padding: 9px 20px; border-radius: 40px;
    border: 1.5px solid var(--ink); transition: all 0.25s ease; white-space: nowrap;
}
.talk:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.lang {
    font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
    border: 1.5px solid var(--ink); border-radius: 20px; padding: 4px 12px; cursor: pointer;
    transition: all 0.25s ease; background: transparent;
}
.lang:hover { background: var(--ink); color: var(--paper); }

.menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform 0.25s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-nav { display: none; flex-direction: column; padding: 8px 28px 20px; }
.mobile-nav a { padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 500; }

/* ---------- layout ---------- */
main { max-width: var(--w); margin: 0 auto; padding: 0 28px; }
section { padding: 90px 0; }

/* ---------- hero ---------- */
.hero { padding: 70px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 64px; align-items: center; }

.kicker {
    font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 24px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
html[dir="rtl"] .kicker { letter-spacing: 0; }
.clock {
    font-family: var(--mono); font-size: 0.7rem; color: var(--accent-deep);
    border: 1px solid var(--line); border-radius: 20px; padding: 2px 12px;
    letter-spacing: 0.04em;
}

.hero-h {
    font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em;
    font-size: clamp(2.6rem, 5.6vw, 4.6rem); line-height: 1.02;
    margin-bottom: 24px; text-wrap: balance;
}
.hero-h em { font-style: italic; color: var(--accent-deep); }

.hero-sub { max-width: 52ch; color: var(--muted); font-size: 1.03rem; margin-bottom: 30px; }
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 48px; }

.btn {
    display: inline-block; padding: 14px 30px; border-radius: 40px;
    font-size: 0.88rem; font-weight: 600; text-decoration: none;
    transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}
.btn.solid { background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 5px 5px 0 var(--ink); }
.btn.line { padding: 14px 4px; color: var(--ink); border-radius: 0; border-bottom: 2px solid var(--accent); }
.btn.line:hover { color: var(--accent-deep); }
.btn.light { background: var(--paper); color: var(--ink); border: 1.5px solid var(--paper); }
.btn.light:hover { background: #fff; box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.35); }
.btn.ghostl { border: 1.5px solid rgba(244, 239, 230, 0.4); color: var(--paper); }
.btn.ghostl:hover { border-color: var(--paper); }

.hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; border-top: 1.5px solid var(--ink); padding-top: 22px; }
.hero-meta dt { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
html[dir="rtl"] .hero-meta dt { letter-spacing: 0; }
.hero-meta dd { font-size: 0.88rem; color: var(--muted); }
.hero-meta dd a:hover { color: var(--accent-deep); }

/* ---------- paper stack (3D) ---------- */
.stack { display: grid; perspective: 1300px; }
.pcard {
    grid-area: 1 / 1; padding: 24px 24px 20px; border-radius: 18px;
    background: var(--card); border: 1.5px solid var(--ink);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.76);
    transform: rotate(var(--rot, 0deg));
    transform-style: preserve-3d; will-change: transform;
}
.p-back { --rot: -4deg; margin: 0 34px 150px 0; background: var(--ink); color: var(--paper); border-color: var(--ink); animation: floatA 7s ease-in-out infinite; }
html[dir="rtl"] .p-back { margin: 0 0 150px 34px; }
.p-mid { --rot: 2.5deg; margin: 110px 0 80px 34px; animation: floatB 8.5s ease-in-out infinite; }
html[dir="rtl"] .p-mid { margin: 110px 34px 80px 0; }
.p-front { --rot: -1.5deg; margin: 220px 60px 0 10px; background: var(--accent); border-color: var(--ink); color: #fff; animation: floatA 9.5s ease-in-out 1s infinite; }
html[dir="rtl"] .p-front { margin: 220px 10px 0 60px; }
@keyframes floatA { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes floatB { 0%, 100% { translate: 0 -5px; } 50% { translate: 0 6px; } }

.pk { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
html[dir="rtl"] .pk { letter-spacing: 0; }
.p-back .pk { color: #b9b0a1; }
.pk.hot { color: #fff; }
.pt { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; margin-bottom: 10px; }
.pt.serif { font-family: var(--serif); font-weight: 560; }
.ps { font-family: var(--mono); font-size: 0.7rem; opacity: 0.75; }
.browser {
    display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
    border-bottom: 1px solid var(--line); padding-bottom: 10px;
    font-family: var(--mono); font-size: 0.68rem; color: var(--faint);
}
.browser i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--faint); }
.browser i:first-child { background: var(--accent); border-color: var(--accent); }
.browser span { margin-inline-start: 6px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-bottom: 10px; }
.bars i { width: 5px; background: var(--accent); border-radius: 3px; animation: bar 1.1s ease-in-out infinite; }
.bars i:nth-child(1) { height: 40%; }
.bars i:nth-child(2) { height: 75%; animation-delay: 0.15s; }
.bars i:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.bars i:nth-child(4) { height: 95%; animation-delay: 0.1s; }
.bars i:nth-child(5) { height: 60%; animation-delay: 0.4s; }
.bars i:nth-child(6) { height: 85%; animation-delay: 0.25s; }
.bars i:nth-child(7) { height: 45%; animation-delay: 0.5s; }
@keyframes bar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.4); } }

/* ---------- marquee ---------- */
.marquee {
    width: 100vw; margin-inline-start: calc(50% - 50vw);
    background: var(--ink); color: var(--paper);
    border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
    transform: rotate(-1deg); overflow: hidden; padding: 12px 0;
}
.mtrack { display: flex; width: max-content; animation: scroll 26s linear infinite; }
.mtrack span {
    font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em;
    white-space: nowrap; padding-right: 8px; color: var(--paper);
}
html[dir="rtl"] .mtrack span { letter-spacing: 0; }
@keyframes scroll { to { transform: translateX(-50%); } }
html[dir="rtl"] .mtrack { animation-name: scrollR; }
@keyframes scrollR { to { transform: translateX(50%); } }

/* ---------- section heads ---------- */
.snum {
    font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent-deep); margin-bottom: 12px;
}
html[dir="rtl"] .snum { letter-spacing: 0; }
.snum.light { color: var(--gold); }
.sec-head { margin-bottom: 12px; }
.sec-head h2 {
    font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em;
    font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.05; margin-bottom: 12px;
    text-wrap: balance;
}
.sec-head > p { color: var(--muted); max-width: 62ch; }

/* ---------- work index ---------- */
.proj { border-bottom: 1px solid var(--line); position: relative; }
.proj:first-child { border-top: 1.5px solid var(--ink); margin-top: 34px; }

.proj-btn {
    width: 100%; display: grid; grid-template-columns: 52px 1fr auto 40px;
    gap: 18px; align-items: center; text-align: start; cursor: pointer;
    padding: 28px 6px; position: relative; z-index: 1;
}
html[dir="rtl"] .proj-btn { text-align: right; }
.proj-num { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.proj-title {
    font-family: var(--serif); font-weight: 560; letter-spacing: -0.01em;
    font-size: clamp(1.4rem, 2.8vw, 2.1rem); line-height: 1.15;
    transition: transform 0.3s var(--ease), color 0.25s ease;
}
.proj-tag { font-family: var(--mono); font-size: 0.68rem; color: #fff; background: var(--ink); border-radius: 20px; padding: 4px 14px; white-space: nowrap; }
.proj-tag.web { background: var(--accent); }
.proj-plus {
    font-family: var(--mono); font-size: 1.15rem; color: var(--ink);
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--ink); border-radius: 50%; background: var(--card);
    transition: transform 0.3s var(--ease), background 0.25s ease, color 0.25s ease;
}
.proj-btn:hover .proj-title { color: var(--accent-deep); transform: translateX(8px); }
html[dir="rtl"] .proj-btn:hover .proj-title { transform: translateX(-8px); }
.proj-btn:hover .proj-plus { background: var(--ink); color: var(--paper); }
.proj-btn[aria-expanded="true"] .proj-plus { transform: rotate(135deg); background: var(--accent); border-color: var(--accent); color: #fff; }

.proj-panel { overflow: hidden; }
.proj:not(.open) .proj-panel { display: none; }
.proj.open .proj-panel { display: block; animation: panelIn 0.45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.proj-body { padding: 0 6px 38px 70px; max-width: 80ch; position: relative; z-index: 1; }
html[dir="rtl"] .proj-body { padding: 0 70px 38px 6px; }
.proj-when { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); margin-bottom: 10px; }
.proj-lede { font-size: 1.02rem; margin-bottom: 20px; }
.proj-lede strong { font-weight: 600; }
.proj-notes { display: grid; gap: 14px; margin-bottom: 20px; }
.proj-notes div { border-left: 3px solid var(--accent); padding-left: 14px; }
html[dir="rtl"] .proj-notes div { border-left: none; border-right: 3px solid var(--accent); padding-left: 0; padding-right: 14px; }
.proj-notes h4 { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 4px; font-weight: 500; }
html[dir="rtl"] .proj-notes h4 { letter-spacing: 0; }
.proj-notes p { font-size: 0.92rem; color: var(--muted); }
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.proj-tags span {
    font-family: var(--mono); font-size: 0.68rem; color: var(--muted);
    border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 3px 12px;
}
.proj-status { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); }
.proj-status b { color: var(--accent-deep); font-weight: 500; }

/* ---------- services deck ---------- */
.deck { display: grid; gap: 20px; margin-top: 36px; }
.dcard {
    position: sticky; border-radius: 22px; padding: 48px 44px;
    border: 1.5px solid var(--ink);
}
.dcard h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.015em; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.1; margin-bottom: 14px; text-wrap: balance; }
.dcard > p { max-width: 60ch; margin-bottom: 22px; }
.dcard ul { list-style: none; margin-bottom: 28px; max-width: 60ch; }
.dcard li { padding: 10px 0 10px 24px; position: relative; border-top: 1px solid currentColor; border-top-color: inherit; opacity: 0.92; font-size: 0.93rem; }
html[dir="rtl"] .dcard li { padding: 10px 24px 10px 0; }
.dcard li::before { content: '✓'; position: absolute; left: 0; font-weight: 700; }
html[dir="rtl"] .dcard li::before { left: auto; right: 0; }
.dk { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; opacity: 0.75; }
html[dir="rtl"] .dk { letter-spacing: 0; }
.d-web { top: 84px; background: var(--ink); color: var(--paper); box-shadow: 0 -12px 40px rgba(25, 20, 16, 0.25); }
.d-web .dk { color: var(--gold); opacity: 1; }
.d-web ul li { border-top-color: rgba(244, 239, 230, 0.25); }
.d-game { top: 104px; background: var(--card); color: var(--ink); box-shadow: 0 -12px 40px rgba(25, 20, 16, 0.18); }
.d-game ul li { border-top-color: var(--line); }
.d-auto { top: 124px; background: var(--gold); color: var(--ink); box-shadow: 0 -12px 40px rgba(25, 20, 16, 0.18); }
.d-auto ul li { border-top-color: rgba(25, 20, 16, 0.25); }

/* ---------- process ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 36px; }
.steps li { border-top: 3px solid var(--ink); padding-top: 16px; }
.steps span { font-family: var(--serif); font-style: italic; font-size: 2rem; color: var(--accent); }
.steps h3 { font-size: 1.02rem; font-weight: 600; margin: 8px 0 6px; }
.steps p { font-size: 0.87rem; color: var(--muted); }

/* ---------- log ---------- */
.log-list { list-style: none; margin-top: 34px; border-top: 1.5px solid var(--ink); }
.log-list li {
    display: grid; grid-template-columns: 130px 1fr; gap: 20px;
    padding: 18px 6px; border-bottom: 1px solid var(--line); align-items: baseline;
    transition: background 0.25s ease;
}
.log-list li:hover { background: rgba(25, 20, 16, 0.03); }
.log-list time { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); white-space: nowrap; }
.log-list p { font-size: 0.93rem; color: var(--muted); }
.log-list p strong { color: var(--ink); font-weight: 600; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; margin-top: 30px; }
.about-grid > div > p { color: var(--muted); margin-bottom: 18px; max-width: 60ch; }
.about-grid h3 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 500; margin: 30px 0 10px; }
html[dir="rtl"] .about-grid h3 { letter-spacing: 0; }
.about-grid h3:first-child { margin-top: 0; }
.tools { font-size: 0.92rem; color: var(--muted); }
.rules { list-style: none; }
.rules li { font-size: 0.92rem; color: var(--muted); padding: 8px 0 8px 20px; position: relative; border-bottom: 1px dotted var(--line); }
html[dir="rtl"] .rules li { padding: 8px 20px 8px 0; }
.rules li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
html[dir="rtl"] .rules li::before { left: auto; right: 0; }
.muted { color: var(--muted); }

/* ---------- contact ---------- */
.contact {
    background: var(--ink); color: var(--paper); border-radius: 28px;
    padding: 72px 56px; margin-bottom: 90px; position: relative; overflow: clip;
}
.contact::after {
    content: 'E®'; position: absolute; right: -30px; bottom: -70px;
    font-family: var(--serif); font-size: 16rem; line-height: 1;
    color: rgba(244, 239, 230, 0.05); pointer-events: none;
}
html[dir="rtl"] .contact::after { right: auto; left: -30px; }
.contact-h {
    font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em;
    font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.05; margin-bottom: 20px;
    text-wrap: balance; position: relative; z-index: 1;
}
.contact-h em { font-style: italic; color: var(--gold); }
.muted-narrow { color: #b9b0a1; max-width: 56ch; margin-bottom: 30px; position: relative; z-index: 1; }
.contact-row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.contact-row + .contact-row { margin-top: 12px; }

/* ---------- footer ---------- */
.foot { border-top: 1.5px solid var(--ink); }
.foot-in {
    max-width: var(--w); margin: 0 auto; padding: 26px 28px;
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--faint);
}
.foot-col { max-width: 52ch; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent-deep); }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .head-nav, .avail { display: none; }
    .menu-btn { display: flex; }
    .mobile-nav.open { display: flex; }
    .hero-grid { grid-template-columns: 1fr; gap: 56px; }
    .stack { max-width: 480px; }
    .steps { grid-template-columns: 1fr 1fr; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .dcard { padding: 36px 28px; }
}

@media (max-width: 600px) {
    main { padding: 0 20px; }
    .head-in { padding: 12px 20px; }
    section { padding: 64px 0; }
    .hero { padding: 52px 0 64px; }
    .talk { display: none; }
    .mobile-nav .talk { display: block; }
    .hero-meta { grid-template-columns: 1fr; gap: 14px; }
    .hero-links .btn { width: 100%; text-align: center; }
    .proj-btn { grid-template-columns: 36px 1fr 38px; }
    .proj-num { display: none; }
    .proj-tag { display: none; }
    .proj-body { padding-left: 6px; }
    html[dir="rtl"] .proj-body { padding-right: 6px; }
    .steps { grid-template-columns: 1fr; }
    .log-list li { grid-template-columns: 1fr; gap: 4px; }
    .contact { padding: 52px 26px; border-radius: 22px; }
    .contact-row .btn, .contact-row .ghostl { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .rv { opacity: 1; transform: none; }
    .proj-panel { transition: none; grid-template-rows: 1fr; }
    .mtrack { animation: none; }
}
