/*
Theme Name: Black Pearl
Description: A cinematic, bilingual WordPress theme for digital architecture.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: black-pearl
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

@font-face {
    font-family: "Space Grotesk";
    src: url("assets/fonts/space-grotesk.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: Vazirmatn;
    src: url("assets/fonts/vazirmatn.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    unicode-range: U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFF;
}
:root {
    color-scheme: dark;
    --paper: #08090b;
    --panel: #101216;
    --ink: #f4f3ef;
    --muted: #abb2bd;
    --line: #2e333b;
    --accent: #c8f480;
    --accent-ink: #151b0d;
    --focus: #c8f480;
    --display: "Space Grotesk", Arial, sans-serif;
    --body: "Space Grotesk", system-ui, sans-serif;
    --measure: 86rem;
    --gutter: clamp(1.25rem, 5.3vw, 5rem);
    --header: 4.5rem;
    --admin-bar: 0px;
    --section: clamp(4.75rem, 10vw, 8.5rem);
    --ease: cubic-bezier(.22, .61, .36, 1);
}
:root[data-theme="light"] {
    color-scheme: light;
    --paper: #f4f3ef;
    --panel: #fff;
    --ink: #08090b;
    --muted: #424954;
    --line: #b9bdc3;
    --accent: #375c10;
    --accent-ink: #f4f3ef;
    --focus: #375c10;
}
[dir="rtl"] {
    --display: Vazirmatn, "Space Grotesk", Tahoma, sans-serif;
    --body: Vazirmatn, "Space Grotesk", Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + var(--admin-bar) + 1rem); }
html:not([data-motion="off"]) { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 var(--body); }
body.admin-bar { --admin-bar: 32px; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-inline-size: 100%; block-size: auto; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { color: #14180d; background: #c8f480; }
h1, h2, h3, p { margin-block: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1; }
h1, h2 { letter-spacing: -.07em; }
h3 { letter-spacing: -.045em; }
[dir="rtl"] :is(h1, h2, h3) { letter-spacing: normal; line-height: 1.2; }
.shell { inline-size: 100%; max-inline-size: var(--measure); padding-inline: var(--gutter); margin-inline: auto; }
.section { padding-block: var(--section); }
.skip-link { position: fixed; z-index: 200; inset-block-start: .5rem; inset-inline-start: .5rem; transform: translateY(-200%); padding: .75rem 1rem; color: var(--ink); background: var(--paper); }
.skip-link:focus { transform: none; }
:is(.site-header,.hero-frame,.study-frame,.journey) {
    color-scheme: dark;
    --focus: #c8f480;
    --ink: #f4f3ef;
    --muted: #abb2bd;
    --accent: #c8f480;
    --accent-ink: #151b0d;
    --line: #2e333b;
    color: var(--ink);
}
.site-header { position: sticky; z-index: 10; inset-block-start: var(--admin-bar); background: #08090b; border-block-end: 1px solid #22262b; }
.site-header__inner { min-block-size: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; position: relative; }
.wordmark { display: inline-flex; align-items: center; gap: .66rem; text-decoration: none; font: 700 .98rem/1 var(--display); letter-spacing: .105em; white-space: nowrap; }
.wordmark strong { font-weight: 700; }
.wordmark__icon { inline-size: 1.32rem; block-size: 1.32rem; border: 1px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.wordmark__icon::before { content: ""; block-size: .48rem; inline-size: .48rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px transparent; }
.site-nav, .header-tools, .languages { display: flex; align-items: center; }
.site-nav { column-gap: clamp(1rem, 2.6vw, 2.6rem); row-gap: .35rem; flex-wrap: wrap; justify-content: center; }
.site-nav a, .languages a { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; font-size: .9rem; min-block-size: 2.75rem; }
.site-nav a:hover, .languages a:hover, .languages [aria-current] { color: var(--ink); }
.header-tools { gap: .6rem; }
.languages { border-inline-start: 1px solid var(--line); padding-inline-start: .65rem; }
.languages a { justify-content: center; min-inline-size: 2.65rem; }
.languages [aria-current] { color: var(--accent); font-weight: 700; }
.menu-toggle { background: transparent; border: 1px solid var(--line); color: var(--ink); padding-inline: .65rem; min-block-size: 2.75rem; }

.hero-track, .study-track { background: #08090b; }
.hero-frame {
    position: relative;
    min-block-size: calc(100svh - var(--header) - var(--admin-bar));
    isolation: isolate;
    overflow: clip;
    display: grid;
    background: #08090b;
    --drift-x: 0px;
    --drift-y: 0px;
    --pearl-scale: 1;
    --copy-y: 0px;
}
.hero-grid {
    position: absolute;
    z-index: -1;
    inset: 0 var(--gutter);
    border-inline: 1px solid #17191e;
    background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), #16181c calc(25% - 1px), #16181c 25%);
    mask-image: linear-gradient(transparent 4%, #000 27% 85%, transparent);
}
.hero-art {
    position: absolute;
    z-index: -1;
    inset-block-start: 50%;
    inset-inline-end: max(-1vw, calc((100vw - var(--measure)) / 2 - 1rem));
    inline-size: clamp(29rem, 62vw, 61rem);
    display: grid;
    transform: translate(var(--drift-x), calc(-52% + var(--drift-y))) scale(var(--pearl-scale));
    pointer-events: none;
}
.hero-art img { width: 100%; mask-image: radial-gradient(ellipse at 50% 50%, #000 52%, transparent 72%); }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, #08090b 0, transparent 28%); }
[dir="rtl"] .hero-art::after { transform: scaleX(-1); }
.hero-inner {
    display: grid;
    grid-template-rows: 1fr auto;
    padding-block: clamp(3.8rem, 10svh, 7rem) 1.4rem;
    min-block-size: inherit;
}
.hero-copy { align-self: center; max-inline-size: 40rem; transform: translateY(var(--copy-y)); }
.eyebrow {
    display: flex;
    align-items: center;
    gap: .8rem;
    color: var(--accent);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .13em;
    line-height: 1.5;
}
.eyebrow::before { content: ""; inline-size: 1.7rem; block-size: 1px; flex: none; background: currentColor; }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
.hero-copy h1 {
    margin-block: 1.55rem 1.6rem;
    font-size: clamp(4.25rem, min(9.1vw, 15.8svh), 9rem);
    font-weight: 700;
    line-height: .80;
    letter-spacing: -.095em;
}
.hero-copy h1 span { display: block; }
.hero-copy h1 span:last-child { color: var(--accent); }
[dir="rtl"] .hero-copy h1 { font-size: clamp(3.5rem, min(7.5vw, 15svh), 7.4rem); line-height: 1.04; }
.hero-intro { max-inline-size: 24rem; font-size: clamp(1rem, 1.45vw, 1.23rem); color: #c0c4cb; line-height: 1.55; margin-block-end: 1.75rem; }
.button {
    display: inline-flex;
    text-decoration: none;
    min-block-size: 3.1rem;
    align-items: center;
    justify-content: center;
    padding: .65rem 1.15rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: color .2s, background-color .2s, border-color .2s;
}
.button--filled { color: var(--accent-ink); background: var(--accent); }
.button--filled:hover { color: #08090b; background: #def6ba; }
.button--outline { color: var(--ink); background: transparent; border-color: var(--line); }
.button--outline:hover { border-color: var(--accent); color: var(--accent); }
.hero-meta {
    margin-block-start: 2.4rem;
    min-block-size: 3rem;
    border-block-start: 1px solid #30343c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: .82rem;
    letter-spacing: .045em;
}
.hero-meta a { display: inline-flex; gap: .7rem; min-block-size: 2.75rem; align-items: center; text-decoration: none; }
.hero-meta a:hover { color: var(--accent); }
.scroll-mark { width: .65rem; height: 1rem; border: 1px solid currentColor; border-radius: .55rem; display: grid; justify-items: center; }
.scroll-mark::after { content: ""; width: 1px; height: .25rem; background: currentColor; margin-top: 2px; }
.section-head { display: grid; align-items: end; grid-template-columns: 1.2fr .65fr; gap: 2.8rem; margin-block-end: 2rem; }
.section-head h2, .study-copy h2 { margin-block-start: 1.05rem; font-size: clamp(3.05rem, 7.25vw, 7.6rem); }
:is(.section-head h2,.study-copy h2) em { color: var(--muted); font-style: normal; }
.section-head > p, .study-copy > p:not(.eyebrow,.study-note) { color: var(--muted); max-inline-size: 31rem; font-size: clamp(1rem, 1.5vw, 1.18rem); }
.availability { color: var(--muted); padding: .85rem 0; border-block-start: 1px solid var(--line); margin-block-end: .55rem; }
.journeys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.journey { position: relative; isolation: isolate; min-block-size: 26rem; display: flex; align-items: end; overflow: clip; background: #14171c; border: 1px solid var(--line); }
.journey__art, .journey__geometry { position: absolute; z-index: -2; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: center; transition: transform .65s var(--ease); }
.journey:hover :is(.journey__art,.journey__geometry) { transform: scale(1.045); }
.journey::after { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(transparent 21%, #08090b9e 56%, #08090b 100%); }
.journey__copy { padding: clamp(1.15rem, 2.7vw, 2rem); }
.journey h3 { font-size: clamp(1.9rem, 3vw, 3rem); margin-block-end: .75rem; }
.journey p { color: #c5c8cf; max-inline-size: 25rem; }
.journey__recent { display: grid; margin-block-start: .65rem; gap: .1rem; }
.journey__recent span { font-size: .875rem; }
.journey__recent a { color: var(--ink); text-underline-offset: .23em; }
.text-link { display: inline-flex; align-items: center; min-block-size: 2.75rem; margin-block-start: .55rem; text-decoration-color: currentColor; text-underline-offset: .27em; color: var(--accent); font-weight: 700; }
.journey__geometry {
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at 50% 35%, #405044 1%, #17241d 33%, #0e1414 75%);
    perspective: 500px;
}
.journey__geometry i {
    grid-area: 1/1;
    inline-size: 45%;
    aspect-ratio: 1;
    border: 1px solid #b3d7a886;
    box-shadow: inset 0 0 1.5rem #d9fbb519, 0 0 1.2rem #b8e6861c;
    transform: translateY(calc(var(--layer) * 15px - 55px)) rotateX(57deg) rotateZ(calc(38deg + var(--layer) * 11deg));
    background: repeating-linear-gradient(90deg, #bbe5a042 0 1px, transparent 1px 11px), repeating-linear-gradient(0deg, #bbe5a037 0 1px, transparent 1px 11px);
}
.journey__geometry i:nth-child(1) { --layer: 0; }
.journey__geometry i:nth-child(2) { --layer: 1; }
.journey__geometry i:nth-child(3) { --layer: 2; }
.journey__geometry i:nth-child(4) { --layer: 3; }
.journey__geometry i:nth-child(5) { --layer: 4; }
.tool-strip { display: grid; grid-template-columns: .85fr 1.5fr; gap: 1.3rem 2.5rem; padding-block: 1.5rem; border-block: 1px solid var(--line); margin-block-start: 2rem; }
.tool-strip__title { color: var(--ink); font-weight: 700; }
.tool-strip small { color: var(--muted); font-size: .875rem; }
.tool-strip ul { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.tool-strip li { font-size: .9rem; white-space: nowrap; color: var(--muted); }
.study-frame { background: #0a0d10; border-block: 1px solid #272e35; display: grid; align-items: center; position: relative; overflow: clip; }
.study-inner { display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 1.5rem; padding-block: clamp(4.25rem, 9vh, 7rem); }
.study-copy { z-index: 1; }
.study-copy h2 { margin-block-end: 1.45rem; }
.study-controls { display: flex; flex-wrap: wrap; gap: .5rem; padding-block: 1.25rem .6rem; }
.study-controls button, .preferences button {
    border: 1px solid var(--line);
    padding: .5rem .85rem;
    min-block-size: 2.75rem;
    background: transparent;
    color: var(--ink);
    font-size: .9rem;
}
.study-controls button:hover, .preferences button:hover { border-color: var(--accent); }
.study-controls button[aria-pressed="true"], .preferences button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.study-note { min-block-size: 3em; color: var(--muted); font-size: .9rem; margin-block-start: .8rem; }
.study-visual { display: grid; place-items: center; position: relative; inline-size: 100%; aspect-ratio: 1; }
.study-visual > * { grid-area: 1/1; inline-size: 100%; block-size: 100%; }
.study-visual img { mask-image: radial-gradient(#000 43%, transparent 69%); }
.study-visual canvas { display: block; }
.study-visual.is-live img { visibility: hidden; }
.journal h2 { font-size: clamp(2.55rem, 6vw, 5.6rem); margin-block: 1rem 1.7rem; }
.journal > .button { margin-block-start: 1.5rem; }
.notice { padding: 1rem 1.15rem; color: var(--muted); border: 1px solid var(--line); }
.site-footer { border-block-start: 1px solid var(--line); background: var(--panel); }
.footer-grid { display: grid; align-items: start; grid-template-columns: .7fr 1fr auto; gap: 1rem 2rem; padding-block: 3rem 2rem; }
.footer-grid > .wordmark { min-block-size: 2.75rem; }
.footer-links, .preferences { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.footer-links a { display: inline-flex; align-items: center; min-block-size: 2.75rem; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-links ul { padding: 0; margin: 0; display: contents; list-style: none; }
.copyright { color: var(--muted); grid-column: 1/-1; border-block-start: 1px solid var(--line); padding-block-start: 1rem; text-align: start; }
[dir="rtl"] .copyright { text-align: right; }
.content-main { min-block-size: 65svh; }
.content-heading { margin-block-end: 2.25rem; }
.content-heading h1 { font-size: clamp(3rem, 8vw, 7.75rem); overflow-wrap: anywhere; }
.content-heading p, .content-heading .term-description { color: var(--muted); margin-block-start: 1rem; max-inline-size: 49rem; }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.entry-card { background: var(--panel); border: 1px solid var(--line); min-inline-size: 0; }
.entry-card img { inline-size: 100%; aspect-ratio: 16/9; object-fit: cover; }
.entry-card__body { padding: 1.2rem; }
.entry-card h2, .entry-card h3 { font-size: clamp(1.38rem, 2.8vw, 2rem); overflow-wrap: anywhere; }
.entry-card h2 a, .entry-card h3 a { text-decoration: none; }
.entry-card h2 a:hover, .entry-card h3 a:hover { color: var(--accent); }
.entry-card time { color: var(--muted); display: inline-block; margin-block-end: .55rem; font-size: .875rem; }
.entry-card p { color: var(--muted); margin-block-start: .75rem; }
.entry-content { max-inline-size: 52rem; overflow-wrap: anywhere; }
.entry-content > * + * { margin-block-start: 1.25rem; }
.entry-content :is(h2,h3) { line-height: 1.15; letter-spacing: -.04em; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.entry-content a { color: var(--accent); text-underline-offset: .16em; }
.entry-content :is(iframe,video) { max-inline-size: 100%; }
.entry-content table { display: block; max-inline-size: 100%; overflow-x: auto; }
.entry-content pre { overflow: auto; }
.attributes { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; margin-block: 1.2rem; }
.attributes div { display: grid; }
.attributes dt { color: var(--muted); font-size: .85rem; }
.attributes dd { margin: 0; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: .85rem; border-block: 1px solid var(--line); padding-block: 1rem; margin-block-end: 2rem; }
.filter-form label { display: grid; gap: .25rem; flex: 1 1 8rem; }
.filter-form .search-field { flex-basis: 13rem; }
.filter-form .button { min-block-size: 2.75rem; }
:is(input:not([type="checkbox"],[type="radio"]),select,textarea) { border: 1px solid var(--line); border-radius: 0; min-block-size: 2.75rem; max-inline-size: 100%; background: var(--panel); color: var(--ink); padding: .5rem .6rem; }
.pagination { margin-block-start: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.pagination .page-numbers { display: grid; min-block-size: 2.75rem; min-inline-size: 2.75rem; place-items: center; padding-inline: .55rem; border: 1px solid var(--line); }
.comments-area { max-inline-size: 52rem; margin-block-start: 3.5rem; }
.comment-form label { display: block; }
.comment-form-cookies-consent label { display: inline; }
.comment-form > p { margin-block: .7rem; }
.woocommerce :is(.woocommerce-info,.woocommerce-error,.woocommerce-message) { color: var(--ink); background: var(--panel); }
.woocommerce :is(#respond input#submit,a.button,button.button,input.button) { min-block-size: 2.75rem; background: var(--accent); color: var(--accent-ink); }
.woocommerce form .form-row :is(input.input-text,textarea) { background: var(--panel); color: var(--ink); }
.woocommerce ul.products li.product img { aspect-ratio: 1; object-fit: cover; }
.woocommerce nav.woocommerce-pagination ul { border-color: var(--line); }

@media (min-width: 64rem) and (min-height: 39rem) {
    html[data-motion="on"] .hero-track { min-block-size: calc(145svh - var(--header) - var(--admin-bar)); }
    html[data-motion="on"] .hero-frame { position: sticky; inset-block-start: calc(var(--header) + var(--admin-bar)); }
    html[data-motion="on"] .study-track.is-live { min-block-size: 190svh; }
    html[data-motion="on"] .study-track.is-live .study-frame {
        position: sticky;
        inset-block-start: calc(var(--header) + var(--admin-bar));
        min-block-size: calc(100svh - var(--header) - var(--admin-bar));
    }
    .study-visual { max-block-size: min(70svh, 39rem); max-inline-size: 39rem; justify-self: center; }
    .study-visual > * { max-block-size: inherit; object-fit: contain; }
}
@media (max-width: 63.99rem) {
    .hero-art { inline-size: clamp(28rem, 70vw, 46rem); inset-inline-end: -9vw; }
    .journey { min-block-size: 24rem; }
    .footer-grid { grid-template-columns: 1fr 1.3fr; }
    .preferences { grid-column: 1/-1; }
}
@media (max-width: 46rem) {
    :root { --header: 4rem; }
    body.admin-bar { --admin-bar: 46px; }
    .site-header__inner { flex-wrap: wrap; gap: 0 1rem; }
    .site-nav { order: 3; justify-content: flex-start; flex: 1 0 100%; padding-block: .2rem; }
    .site-nav a { padding-inline: .2rem; }
    html[data-menu="ready"] .site-nav {
        display: none;
        position: absolute;
        inset: 100% 0 auto;
        padding: .5rem var(--gutter) 1rem;
        background: #08090b;
        border-block-end: 1px solid #30343c;
    }
    html[data-menu="ready"] .site-nav.is-open { display: flex; gap: .2rem 1.3rem; }
    .header-tools { gap: .2rem; }
    .languages { padding-inline-start: .12rem; border: 0; }
    .languages a { min-inline-size: 2.3rem; font-size: .85rem; }
    .wordmark { font-size: .83rem; gap: .45rem; }
    .wordmark__icon { inline-size: 1.1rem; block-size: 1.1rem; }
    .hero-frame { min-block-size: max(41rem, calc(100svh - var(--header) - var(--admin-bar))); }
    .hero-inner { padding-block: clamp(12rem, 43vw, 18rem) 1rem; }
    .hero-copy { align-self: end; }
    .hero-copy h1 { font-size: clamp(3.8rem, 12vw, 6.2rem); margin-block: 1rem; }
    [dir="rtl"] .hero-copy h1 { font-size: clamp(3.2rem, 10vw, 6rem); }
    .hero-intro { max-inline-size: min(22rem, 95%); margin-block-end: 1rem; }
    .hero-art { inline-size: min(105vw, 34rem); inset-inline-end: -8vw; inset-block-start: 0; transform: translate(var(--drift-x), calc(-6% + var(--drift-y))) scale(var(--pearl-scale)); }
    .hero-art::after, [dir="rtl"] .hero-art::after { transform: none; background: linear-gradient(0deg, #08090b 0%, transparent 55%); }
    .hero-meta { margin-block-start: 1.5rem; font-size: .78rem; }
    .section-head, .journeys, .tool-strip, .study-inner, .entry-grid, .footer-grid { grid-template-columns: 1fr; }
    .section-head { gap: 1.15rem; }
    .journeys { gap: .75rem; }
    .journey { min-block-size: 21rem; }
    .study-inner { gap: .5rem; }
    .study-visual { max-inline-size: 26rem; justify-self: center; }
    .study-note { min-block-size: unset; }
    .copyright { grid-column: auto; }
}
@media (max-width: 22.5rem) {
    .site-header__inner { gap: 0 .35rem; }
    .wordmark { font-size: .77rem; }
    .art-caption { display: none; }
}
@media (max-width: 37.5rem) {
    #wpadminbar { position: fixed; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { transition-duration: .01ms !important; }
