/* 
  Colors based on the reference design:
  Background: Very dark gray/blackish #0c0b0c
  Text: Muted beige/tan #d4c4b7
  Accent/Borders: Dark red #5a1818 or thin red lines #3a1515
  Bright accent: Red #c23333
*/

:root {
    --bg-color: #0b0a0b;
    --text-primary: #dcd0c6;
    --text-muted: #8c827a;
    --accent-red: #cc3030;
    --border-color: #3b1d1d;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-signature: 'Mrs Saint Delafield', cursive;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

/* Subtle noise texture overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 3rem;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-red);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* MAIN LAYOUT */
main {
    max-width: 1400px;
    margin: 0 auto;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* HERO SECTION */
.hero {
    position: relative;
    padding: 4rem 3rem 0 3rem; /* Removed bottom padding so the image can touch the border */
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.hero-bg-text {
    position: absolute;
    top: 80px; /* Reverted to 80px for the optimal depth effect */
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: clamp(8rem, 25vw, 22rem);
    color: var(--text-primary);
    opacity: 0.9;
    line-height: 0.8;
    white-space: nowrap;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: end; 
    margin-top: 15rem; /* Reverted back to 15rem */
}

.hero-left {
    padding-bottom: 4rem; 
}

.hero-right {
    padding-bottom: 0; /* Reduced to 0 to slide this specific text block down, fixing the overlap */
    transform: translateY(10px); /* Slight nudge downwards */
}

.hero-category {
    font-family: var(--font-display);
    font-size: 4rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    line-height: 1;
}

.hero-tags {
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 3rem;
}

.hero-tags li {
    margin-bottom: 0.3rem;
}

.hero-quote {
    color: var(--accent-red);
    font-size: 0.9rem;
    max-width: 200px;
    position: relative;
}

.hero-quote i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.signature-text {
    font-family: var(--font-signature);
    font-size: 4rem;
    color: var(--text-primary);
    margin-top: 1rem;
    line-height: 0.8;
    opacity: 0.9;
}

.hero-center {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hero-circle {
    position: absolute;
    width: 450px;
    height: 450px;
    background-color: #4a1313;
    border-radius: 50%;
    z-index: -1;
    bottom: -100px; /* Pull the circle down slightly */
}

.hero-portrait {
    width: 100%;
    max-width: 750px; 
    object-fit: cover;
    display: block;
    filter: contrast(1.1) drop-shadow(0 20px 30px rgba(0,0,0,0.5));
    transform: scale(1.15); /* Reverted scale */
    transform-origin: bottom center;
}

.hero-right {
    padding-inline-start: 2rem;
}

.hero-name {
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 0.9;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.hero-role {
    color: var(--accent-red);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.hero-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 300px;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-item i {
    color: var(--accent-red);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

/* SECTION TITLES */
.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

/* WHAT I DO */
.what-i-do {
    padding: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.service-card {
    padding: 2rem;
    border-inline-end: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.service-card:last-child {
    border-inline-end: none;
}

.service-card:hover {
    background: rgba(204, 48, 48, 0.05);
}

.service-card i {
    font-size: 2rem;
    color: var(--accent-red);
    margin-bottom: 1.5rem;
    display: block;
}

.service-card h3 {
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* PROCESS & WORK */
.process-work-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    border-bottom: 1px solid var(--border-color);
}

.process-column {
    padding: 3rem;
    border-inline-end: 1px solid var(--border-color);
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-num {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-red);
    line-height: 1;
}

.step i {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.step-text h3 {
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.step-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.work-column {
    padding: 3rem;
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-more {
    color: var(--accent-red);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.view-more:hover {
    gap: 1rem;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.work-card {
    group: relative;
    cursor: pointer;
}

.work-img-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.work-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-card:hover .work-img-wrapper img {
    transform: scale(1.05);
}

.work-info h3 {
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.work-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ABOUT & TOOLS */
.about-tools-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
}

.about-column {
    padding: 3rem;
    border-inline-end: 1px solid var(--border-color);
}

.about-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.about-portrait {
    width: 150px;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.about-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.about-text .highlight-text {
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.about-bullets {
    list-style: none;
}

.about-bullets li {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-inline-start: 1.5rem;
}

.about-bullets li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--accent-red);
    border-radius: 50%;
}

.tools-column {
    padding: 3rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tool-icon:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.testimonial-quote {
    color: var(--accent-red);
    position: relative;
    padding-inline-start: 2rem;
}

.testimonial-quote i {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    font-size: 1.5rem;
}

.testimonial-quote p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.testimonial-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* FOOTER */
.footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    padding: 3rem;
}

.footer-left p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.contact-list i {
    color: var(--accent-red);
    font-size: 1.2rem;
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-label {
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.qr-codes {
    display: flex;
    gap: 2rem;
}

.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.qr-box img {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
}

.qr-box span {
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: end;
}

.footer-massive-text {
    font-family: var(--font-display);
    font-size: 3.5rem;
    line-height: 0.9;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.footer-signature {
    margin-top: 2rem;
}

/* ANIMATIONS */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
    .hero-right {
        grid-column: span 2;
        padding-inline-start: 0;
        margin-top: 2rem;
        text-align: center;
    }
    .hero-bio {
        margin: 0 auto 3rem auto;
    }
    .hero-stats {
        justify-content: center;
    }
    
    .process-work-section {
        grid-template-columns: 1fr;
    }
    
    .process-column {
        border-inline-end: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-card:nth-child(2) {
        border-inline-end: none;
    }
    .service-card:nth-child(1), .service-card:nth-child(2) {
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    .hero-center {
        grid-row: 1;
    }
    .hero-bg-text {
        font-size: 6rem;
        top: 20px;
    }
    .hero-left {
        text-align: center;
    }
    .hero-quote {
        margin: 0 auto;
    }
    
    .services-grid, .work-grid, .about-tools-section, .footer {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        border-inline-end: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .about-column {
        border-inline-end: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .about-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .about-bullets li::before {
        display: none;
    }
    .about-bullets li {
        padding-inline-start: 0;
    }
    
    .footer-center {
        margin: 3rem 0;
    }
    
    .footer-right {
        align-items: center;
        text-align: center;
    }
}


/* LANGUAGE TOGGLE */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-inline-start: 1.5rem;
    padding: 0.35rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    font-family: 'Outfit', 'Vazirmatn', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.lang-toggle:hover {
    border-color: var(--accent-red);
}

.lang-option {
    transition: color 0.3s ease;
}

.lang-option.active {
    color: var(--accent-red);
    font-weight: 600;
}

.lang-sep {
    opacity: 0.4;
}

/* QR codes are clickable links */
a.qr-box {
    color: inherit;
    text-decoration: none;
}

.qr-box img {
    transition: border-color 0.3s ease;
}

a.qr-box:hover img {
    border-color: var(--accent-red);
}

/* Keep emails / phone numbers left-to-right inside RTL layout */
.ltr-text {
    direction: ltr;
    unicode-bidi: isolate;
}

/* =========================================================
   PERSIAN (RTL) TYPOGRAPHY
   - Display: Noto Sans Arabic, extra-condensed + black weight,
     the closest Persian counterpart to Bebas Neue's tall poster look.
     Bebas Neue stays first in the stack so Latin bits (n8n, Py...) keep it.
   - Body: Vazirmatn (Outfit first so Latin text/email keep the same look).
   ========================================================= */
html[lang="fa"] {
    --font-display: 'Bebas Neue', 'Noto Sans Arabic', sans-serif;
    --font-body: 'Outfit', 'Vazirmatn', sans-serif;
}

html[lang="fa"] body {
    line-height: 1.85;
}

/* Letter-spacing breaks Persian letter joining */
html[lang="fa"] body * {
    letter-spacing: 0 !important;
}

/* Persian has no true italics; synthetic slant looks broken */
html[lang="fa"] .highlight-text,
html[lang="fa"] .testimonial-quote p {
    font-style: normal;
}

html[lang="fa"] .hero-bg-text,
html[lang="fa"] .hero-category,
html[lang="fa"] .hero-name,
html[lang="fa"] .stat-number,
html[lang="fa"] .section-title,
html[lang="fa"] .step-num,
html[lang="fa"] .footer-massive-text {
    font-stretch: 62.5%;
    font-weight: 900;
    font-synthesis: none;
}

html[lang="fa"] .hero-bg-text {
    font-size: clamp(6rem, 17vw, 15rem);
    line-height: 1;
    top: 10px;
}

html[lang="fa"] .hero-category {
    font-size: 3.6rem;
    line-height: 1.15;
}

html[lang="fa"] .hero-name {
    font-size: 4.6rem;
    line-height: 1.1;
}

html[lang="fa"] .section-title {
    font-size: 2.3rem;
    line-height: 1.3;
}

html[lang="fa"] .footer-massive-text {
    font-size: 3.2rem;
    line-height: 1.1;
}

html[lang="fa"] .hero-tags,
html[lang="fa"] .stat-label,
html[lang="fa"] .work-info p,
html[lang="fa"] .qr-box span {
    font-size: 0.8rem;
}

html[lang="fa"] .hero-role,
html[lang="fa"] .service-card h3,
html[lang="fa"] .step-text h3,
html[lang="fa"] .work-info h3 {
    font-weight: 600;
}

html[lang="fa"] .stat-label {
    line-height: 1.5;
}

/* Arrow should point in reading direction */
html[dir="rtl"] .view-more i {
    transform: scaleX(-1);
}

/* Quote icons mirror for RTL */
html[dir="rtl"] .hero-quote i,
html[dir="rtl"] .testimonial-quote i {
    transform: scaleX(-1);
}

@media (max-width: 768px) {
    html[lang="fa"] .hero-bg-text {
        font-size: 5rem;
        top: 20px;
    }
    html[lang="fa"] .hero-name {
        font-size: 3.8rem;
    }
}


/* =========================================================
   PHONE LAYOUT (≤ 600px)
   Phone-only fixes. Desktop & tablet styles above are untouched.
   ========================================================= */
@media (max-width: 600px) {
    /* --- Header: brand + language toggle on row 1, status on row 2 --- */
    .header {
        flex-wrap: wrap;
        align-items: center;
        column-gap: 0.5rem;
        row-gap: 0.6rem;
        padding: 1rem 1.25rem;
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }
    .header-left {
        flex: 1 1 auto;
    }
    .header-right {
        display: contents;
    }
    .lang-toggle {
        order: 2;
        margin-inline-start: 0;
        font-size: 0.7rem;
    }
    /* Dot is redrawn next to the status text on row 2 */
    .status-dot {
        display: none;
    }
    .header-right > span[data-i18n] {
        order: 4;
        flex-basis: 100%;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--text-muted);
    }
    .header-right > span[data-i18n]::before {
        content: '';
        width: 6px;
        height: 6px;
        flex-shrink: 0;
        background-color: var(--accent-red);
        border-radius: 50%;
        animation: pulse 2s infinite;
    }

    /* --- Hero --- */
    .hero {
        padding: 2.5rem 1.25rem 0 1.25rem;
    }
    .hero-bg-text {
        font-size: 5.5rem;
        top: 40px;
    }
    .hero-content {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 3.5rem;
    }
    /* Tablet rule (span 2) created a phantom 2nd column on phones: reset it */
    .hero-center {
        grid-row: 1;
        grid-column: 1;
    }
    .hero-right {
        grid-row: 2;
        grid-column: 1;
        margin-top: 0;
        padding: 3rem 0 2.5rem 0;
        transform: none;
        text-align: center;
    }
    .hero-left {
        grid-row: 3;
        grid-column: 1;
        padding: 2.5rem 0 3rem 0;
        border-top: 1px solid var(--border-color);
    }
    .hero-portrait {
        width: 100%;
        max-width: 360px;
        transform: scale(1.05);
    }
    .hero-circle {
        width: 290px;
        height: 290px;
        bottom: -40px;
    }
    .hero-name {
        font-size: 4rem;
    }
    .hero-category {
        font-size: 3rem;
    }
    .hero-tags {
        margin-bottom: 2rem;
    }
    .hero-bio {
        max-width: 100%;
        margin: 0 auto 2.5rem auto;
    }
    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }
    .hero-quote {
        max-width: 260px;
    }
    .signature-text {
        font-size: 3rem;
    }

    /* --- Section spacing --- */
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }
    .what-i-do,
    .process-column,
    .work-column,
    .about-column,
    .tools-column,
    .footer {
        padding: 2.5rem 1.25rem;
    }
    .service-card {
        padding: 1.75rem 0.5rem;
    }
    .service-card:last-child {
        border-bottom: none;
    }

    /* --- Featured work --- */
    .work-header {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    .work-header .section-title {
        margin-bottom: 0;
    }
    .work-grid {
        gap: 1.75rem;
    }
    .work-img-wrapper {
        height: 210px;
    }

    /* --- About & tools --- */
    .about-portrait {
        width: 100%;
        max-width: 260px;
        height: 320px;
    }
    .tools-grid {
        gap: 0.9rem;
        margin-bottom: 2.5rem;
    }
    .tool-icon {
        height: 68px;
    }

    /* --- Footer --- */
    .footer-left {
        text-align: center;
    }
    .contact-list {
        display: inline-block;
        text-align: start;
    }
    .footer-center {
        margin: 2.5rem 0;
    }
    .footer-massive-text {
        font-size: 3rem;
    }

    /* --- Persian on phones --- */
    html[lang="fa"] .hero-bg-text {
        font-size: 4.6rem;
        top: 30px;
    }
    html[lang="fa"] .hero-name {
        font-size: 3.6rem;
    }
    html[lang="fa"] .hero-category {
        font-size: 2.8rem;
    }
    html[lang="fa"] .section-title {
        font-size: 2rem;
    }
    html[lang="fa"] .footer-massive-text {
        font-size: 2.8rem;
    }
}
