/* ============================================================
   TECH9 TERMINAL V1 — additive design layer.
   Base design system + shared components live in styles.css.
   Loaded by index.html and services.html (shared terminal
   visual language). Page-specific rules live in services.css.

   Font rule: mono is reserved for Latin/technical text
   (commands, digits, paths). Arabic labels keep the display
   font so connected script is never forced into a Latin mono.
   ============================================================ */

/* ---- Terminal surface + line tokens (reuse base accent/text) ---- */
:root,
[data-theme="light"] {
    --term-panel: #FFFDF6;
    --term-line: rgba(26, 26, 26, 0.16);
    --term-line-strong: rgba(26, 26, 26, 0.32);
    --term-dim: rgba(26, 26, 26, 0.72);
    --term-accent-soft: rgba(255, 107, 53, 0.10);
    /* accent tuned for text contrast on light surfaces */
    --term-accent-text: #C2410C;
    --term-accent-invert: #FF8C5A;
}

[data-theme="dark"] {
    --term-panel: #101010;
    --term-line: rgba(253, 246, 227, 0.14);
    --term-line-strong: rgba(253, 246, 227, 0.30);
    --term-dim: rgba(253, 246, 227, 0.62);
    --term-accent-soft: rgba(255, 140, 90, 0.12);
    --term-accent-text: #FF8C5A;
    --term-accent-invert: #C2410C;
}

@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        --term-panel: #101010;
        --term-line: rgba(253, 246, 227, 0.14);
        --term-line-strong: rgba(253, 246, 227, 0.30);
        --term-dim: rgba(253, 246, 227, 0.62);
        --term-accent-soft: rgba(255, 140, 90, 0.12);
        --term-accent-text: #FF8C5A;
        --term-accent-invert: #C2410C;
    }
}

/* ---- Header / navigation ---- */
header {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--term-line);
}

.nav-links {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-links a {
    position: relative;
    padding-inline-start: 0.9em;
    color: var(--term-dim);
    transition: color 0.15s ease;
}

/* mono "/" prefix = the technical accent on nav items */
.nav-links a::before {
    content: "/";
    position: absolute;
    inset-inline-start: 0;
    font-family: var(--font-mono);
    color: var(--term-accent-text);
    font-weight: 700;
}

.nav-links a:hover {
    color: var(--text-color);
    text-decoration: none;
}

.icon-btn {
    border: 1px solid var(--term-line);
    box-shadow: none;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 10px;
    color: var(--term-dim);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    transform: none;
    box-shadow: none;
    color: var(--text-color);
    border-color: var(--accent-color);
}

.menu-toggle {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--term-line);
    box-shadow: none;
    line-height: 1;
}

/* ---- Section rhythm + separators ---- */
section { border-bottom: 1px solid var(--term-line); }

section.wrap {
    padding-top: clamp(2.5rem, 5vw, 3.5rem);
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.section-head { margin-bottom: clamp(1.5rem, 3vw, 2rem); }

.section-head .cmd { margin-bottom: 1.25rem; }

.section-head h2 { margin-bottom: 0; }

/* ---- Command line / prompt (Latin, decorative) ---- */
.cmd {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--term-dim);
    direction: ltr;
    unicode-bidi: isolate;
    overflow-wrap: anywhere;
}

.cmd .prompt { color: var(--term-accent-text); font-weight: 700; }
.cmd .cmd-txt { color: var(--text-color); }

/* cursor-like indicator (single, hero only) */
.caret {
    display: inline-block;
    width: 0.6ch;
    height: 1.05em;
    margin-inline-start: 0.35ch;
    background: var(--accent-color);
    vertical-align: -0.15em;
    animation: term-caret 1.1s steps(1, end) infinite;
}

@keyframes term-caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ---- Eyebrow (human, Arabic-safe context label) ---- */
.eyebrow {
    font-family: var(--font-display);
    background: transparent;
    border: 1px solid var(--term-line);
    color: var(--text-color);
    text-transform: none;
    font-size: 0.82rem;
    padding: 3px 9px;
    box-shadow: none;
}

.section-head .eyebrow { margin-bottom: 1.25rem; }

/* ---- Prose (beyond-launch, one-place) ---- */
.prose { max-width: 62ch; }
.prose p { color: var(--term-dim); }
.prose p + p { margin-top: 1rem; }

/* ---- Terminal window frame ---- */
.term {
    background: var(--term-panel);
    border: 1px solid var(--term-line-strong);
    box-shadow: 5px 5px 0 var(--term-line);
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--term-line);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--term-dim);
}

.term-dots { display: inline-flex; gap: 0.3rem; }

.term-dots i {
    display: block;
    width: 8px;
    height: 8px;
    border: 1px solid var(--term-line-strong);
}

.term-dots i:first-child {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.term-title {
    direction: ltr;
    unicode-bidi: isolate;
    letter-spacing: 0.02em;
}

.term-body { padding: clamp(1.25rem, 2.5vw, 1.75rem); }

/* ---- Hero ---- */
.hero .term-body { padding: clamp(1.5rem, 3.5vw, 2.25rem); }

.hero h1 { margin-bottom: 1.25rem; }

.hero .lede {
    max-width: 52ch;
    font-size: clamp(1.05rem, 2.2vw, 1.2rem);
    line-height: 1.65;
    color: var(--term-dim);
}

.hero-actions { margin-top: 1.75rem; gap: 1rem; }

/* ---- Buttons ---- */
.brutal-button {
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: 3px 3px 0 var(--border-color);
    font-size: 1rem;
    padding: 0.75rem 1.35rem;
}

.brutal-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--border-color);
}

.brutal-button.secondary {
    background: transparent;
    border-color: var(--term-line-strong);
    box-shadow: none;
    color: var(--text-color) !important;
}

.brutal-button.secondary:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--accent-color);
    color: var(--accent-color) !important;
}

/* ---- Work / services list (index) ---- */
.svc-list {
    list-style: none;
    border-top: 1px solid var(--term-line);
}

.svc-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    padding: clamp(1.25rem, 3vw, 1.75rem) 0.75rem;
    margin-inline: -0.75rem;
    border-bottom: 1px solid var(--term-line);
    transition: background-color 0.15s ease;
}

.svc-row:hover { background: var(--term-accent-soft); }

.svc-num {
    padding-top: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--term-accent-text);
}

.svc-body h3 { margin-bottom: 0.5rem; }

.svc-body p {
    max-width: 62ch;
    color: var(--term-dim);
}

/* ---- Process pipeline ---- */
.proc-list { list-style: none; }

.proc-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    padding: clamp(1.25rem, 3vw, 1.75rem) 0;
    border-bottom: 1px solid var(--term-line);
}

.proc-row:first-child { border-top: 1px solid var(--term-line); }

.proc-num {
    align-self: start;
    padding: 3px 7px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1A1A1A;
    background: var(--accent-color);
}

.proc-body h3 { margin-bottom: 0.4rem; }

.proc-body p {
    max-width: 62ch;
    color: var(--term-dim);
}

/* ---- Availability (status panel) ---- */
.term--accent { border-top: 3px solid var(--accent-color); }

.avail-head {
    margin-bottom: 1rem;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.avail-head::after {
    content: "";
    display: block;
    width: 3.25rem;
    height: 4px;
    margin-top: 1rem;
    background: var(--accent-color);
}

.avail p { max-width: 52ch; color: var(--term-dim); }

.avail-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

.capacity-label {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.88rem;
    color: var(--text-color);
}

/* ---- About ---- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr;
    gap: clamp(1.5rem, 3vw, 2.25rem);
    align-items: center;
}

.profile { display: grid; gap: 1rem; justify-items: start; }

.avatar {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 1px solid var(--term-line-strong);
    background: var(--term-accent-soft);
}

.profile-label {
    margin-bottom: 0.25rem;
    font-family: var(--font-display);
    font-size: 0.82rem;
    color: var(--term-dim);
}

.about-copy p { color: var(--term-dim); }
.about-copy p + p { margin-top: 1rem; }

/* ---- Final CTA (inverted panel) ---- */
.term--invert {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
    box-shadow: none;
}

.term--invert .term-bar {
    border-bottom-color: var(--bg-color);
    color: var(--bg-color);
}

.term--invert .term-dots i { border-color: var(--bg-color); }

.term--invert h2,
.term--invert p,
.term--invert .cmd,
.term--invert .cmd .cmd-txt { color: var(--bg-color); }

.term--invert .cmd .prompt { color: var(--term-accent-invert); }

.term--invert .brutal-button {
    border-color: var(--bg-color);
    box-shadow: 3px 3px 0 var(--bg-color);
}

.contact-methods { margin-top: 1.75rem; gap: 1rem; }

/* ---- Footer ---- */
footer {
    display: block;
    padding: 0 !important;
    border-top: 1px solid var(--term-line);
    font-size: 0.82rem;
    color: var(--term-dim);
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.75rem 24px;
}

footer .logo-mark-footer { height: 24px; }

.social-links { gap: 0.75rem; }

.social-links a {
    font-family: var(--font-mono);
    border: 1px solid var(--term-line);
    box-shadow: none;
    padding: 3px 9px;
    font-size: 0.78rem;
    color: var(--term-dim);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.social-links a:hover {
    transform: none;
    box-shadow: none;
    color: var(--text-color);
    border-color: var(--accent-color);
}

/* ---- Tablet ---- */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        border-bottom: 1px solid var(--term-line);
        box-shadow: none;
    }

    .nav-links a { padding-inline-start: 0; }
    .nav-links a::before { content: none; }

    .term { box-shadow: 4px 4px 0 var(--term-line); }
    .term-body { padding: 1.5rem; }
    .hero .term-body { padding: 1.75rem; }

    .about-grid { grid-template-columns: 1fr; }
    .profile { grid-template-columns: auto 1fr; align-items: center; }

    .avail-foot .brutal-button { width: 100%; }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    /* Simplify the window framing on small screens. */
    .term-bar { display: none; }

    .term {
        border-top: 3px solid var(--accent-color);
        box-shadow: 3px 3px 0 var(--term-line);
    }

    .term-body,
    .hero .term-body { padding: 1.25rem; }

    .svc-row { grid-template-columns: 1fr; gap: 0.35rem; }
    .svc-num { padding-top: 0; }

    .hero-actions { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .caret { animation: none; }
}
