/* =========================================================
   EngTree — shared shell for the section pages

   The pages behind the navigation menu all say one thing: what
   this kind of work is, drawn as a schematic. They share this
   sheet so each page file carries only its own idea and its own
   drawing.

     <link rel="stylesheet" href="../assets/page.css">

   The drawing classes (.dgm and friends) do all the styling, so
   a page's SVG is pure geometry.
   ========================================================= */

/* ===================== IDENTITY ===================== */
:root {
    --et-black: #000000;
    --et-gold: #D4AF37;
    --et-green: #44bd32;
    --et-white: #ffffff;

    --et-bg-body: #0a0a0a;
    --et-surface: #121417;
    --et-surface-2: #181b1f;
    --et-text-main: #e4e6e8;
    --et-text-dim: #9aa0a6;
    --et-nav-bg: #000000;
    --et-border-color: #26292d;
}

[data-theme="light"] {
    --et-bg-body: #f2f4f6;
    --et-surface: #ffffff;
    --et-surface-2: #f7f8fa;
    --et-text-main: #22262b;
    --et-text-dim: #5d646c;
    --et-border-color: #dfe3e7;
}

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

/* Inherited from body rather than forced on every element,
   which would also overwrite the icon font. */
button, input, select, textarea { font-family: inherit; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background-color: var(--et-bg-body);
    color: var(--et-text-main);
    padding-top: 80px;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--et-black); }
::-webkit-scrollbar-thumb { background-color: var(--et-gold); border-radius: 6px; border: 3px solid var(--et-black); }
::-webkit-scrollbar-thumb:hover { background-color: var(--et-green); }
::selection { background: var(--et-gold); color: var(--et-black); }

.letter-e { color: var(--et-gold); }
.letter-t { color: var(--et-green); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* ===================== NAVBAR ===================== */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--et-nav-bg);
    border-bottom: 3px solid var(--et-gold);
    z-index: 1000;
    transition: all 0.4s ease-in-out;
}

.navbar.scrolled {
    height: 68px;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.nav-flex { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo-img { max-height: 58px; width: auto; transition: max-height 0.4s ease; }
.navbar.scrolled .logo-img { max-height: 48px; }

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-links > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--et-white);
    border-radius: 5px;
}

.nav-links > li > a:hover { color: var(--et-gold); background: rgba(212, 175, 55, 0.08); }
.nav-links > li > a i { color: var(--et-green); }
.nav-links a.current { color: var(--et-gold); background: rgba(212, 175, 55, 0.12); }

.theme-toggle-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--et-gold);
    color: var(--et-gold);
    cursor: pointer;
    transition: 0.3s;
}
.theme-toggle-btn:hover { background: var(--et-gold); color: var(--et-black); transform: rotate(25deg); }

.menu-toggle { display: none; font-size: 24px; color: var(--et-white); cursor: pointer; background: none; border: 0; }

/* ===================== PAGE HEAD ===================== */
.page-head {
    position: relative;
    overflow: hidden;
    padding: 66px 0 52px;
    background: radial-gradient(ellipse at 20% 0%, #14181d 0%, #000 65%);
    border-bottom: 1px solid var(--et-border-color);
}

/* A survey grid behind the title, the same drafting language the
   schematic below it uses. */
.page-head::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 175, 55, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.page-head .container { position: relative; }

.crumb {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    letter-spacing: 1.4px;
    color: var(--et-text-dim);
    margin-bottom: 16px;
}

.crumb a:hover { color: var(--et-gold); }
.crumb i { font-size: 9px; opacity: .6; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border: 1px solid var(--et-gold);
    border-radius: 50px;
    font-size: 11.5px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--et-gold);
    background: rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.eyebrow i { color: var(--et-green); }

.page-head h1 { font-size: clamp(28px, 4.6vw, 44px); color: #f0f2f4; letter-spacing: -0.5px; line-height: 1.25; }
.page-head .lede { margin-top: 15px; color: #9aa0a6; max-width: 70ch; line-height: 1.9; font-size: 15.5px; }

/* ===================== SECTION ===================== */
section.band { padding: 58px 0 76px; }

/* ===================== THE DRAWING =====================
   A drafting sheet: ruled border, title block, and a schematic
   that draws itself once. Every page supplies only geometry. */
.sheet {
    position: relative;
    background: var(--et-surface);
    border: 1px solid var(--et-border-color);
    border-radius: 12px;
    padding: 26px 26px 0;
    margin-bottom: 46px;
    overflow: hidden;
}

.sheet::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 175, 55, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, .035) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.sheet-head {
    position: relative;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-bottom: 18px;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--et-border-color);
}

.sheet-code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 2.4px;
    color: var(--et-gold);
}

.sheet-title { font-size: 15px; font-weight: 700; color: var(--et-text-main); }
.sheet-sub { font-size: 12.5px; color: var(--et-text-dim); }

.dgm {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* ---- drawing primitives ---- */
.dgm .box {
    fill: var(--et-surface-2);
    stroke: var(--et-border-color);
    stroke-width: 1.4;
}

.dgm .box-gold { stroke: var(--et-gold); fill: rgba(212, 175, 55, .07); }
.dgm .box-green { stroke: var(--et-green); fill: rgba(68, 189, 50, .07); }

.dgm .link {
    fill: none;
    stroke: var(--et-border-color);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dgm .link-gold { stroke: var(--et-gold); }
.dgm .link-green { stroke: var(--et-green); }
.dgm .dash { stroke-dasharray: 5 5; }

/* A charge running the path: the drawing reads as a system that
   is carrying something, not a static picture. */
.dgm .flow {
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-dasharray: 13 150;
    stroke-dashoffset: 163;
    animation: dgm-flow 3.4s cubic-bezier(.45, 0, .55, 1) infinite;
}

@keyframes dgm-flow { to { stroke-dashoffset: 0; } }

.dgm .pad { fill: var(--et-gold); }
.dgm .pad-green { fill: var(--et-green); }

.dgm text {
    fill: var(--et-text-main);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 12px;
}

.dgm .t-sm { font-size: 10.5px; fill: var(--et-text-dim); }
.dgm .t-code { font-family: 'Consolas', 'Courier New', monospace; font-size: 10px; fill: var(--et-gold); letter-spacing: 1px; }
.dgm .t-gold { fill: var(--et-gold); }
.dgm .t-green { fill: var(--et-green); }
.dgm .t-bold { font-weight: 700; }

/* Dimension lines, the way a drawing marks a span. */
.dgm .dim { stroke: var(--et-text-dim); stroke-width: 1; opacity: .55; }
.dgm .dim-tick { stroke: var(--et-text-dim); stroke-width: 1; opacity: .55; }

.dgm-legend {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    padding: 16px 0 22px;
    border-top: 1px dashed var(--et-border-color);
    margin-top: 6px;
}

.dgm-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--et-text-dim);
}

.dgm-legend i { font-size: 8px; }
.dgm-legend .k-gold { color: var(--et-gold); }
.dgm-legend .k-green { color: var(--et-green); }
.dgm-legend .k-dim { color: var(--et-text-dim); }

/* ===================== POINTS ===================== */
.points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 46px;
}

.point {
    background: var(--et-surface);
    border: 1px solid var(--et-border-color);
    border-radius: 12px;
    padding: 26px 24px;
    transition: .3s;
}

.point:hover { transform: translateY(-4px); border-color: var(--et-gold); }

.point .n {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--et-gold);
    display: block;
    margin-bottom: 12px;
}

.point h3 { font-size: 16px; color: var(--et-text-main); margin-bottom: 10px; line-height: 1.5; }
.point p { font-size: 14px; color: var(--et-text-dim); line-height: 1.85; }

/* ===================== CTA ===================== */
.cta-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px;
    padding: 30px 32px;
    border: 1px solid var(--et-border-color);
    border-radius: 14px;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(212, 175, 55, .09), transparent 58%),
        radial-gradient(ellipse at 88% 100%, rgba(68, 189, 50, .09), transparent 58%),
        var(--et-surface);
}

.cta-strip h2 { font-size: clamp(18px, 2.4vw, 23px); color: var(--et-text-main); margin-bottom: 7px; }
.cta-strip p { font-size: 14px; color: var(--et-text-dim); line-height: 1.8; max-width: 56ch; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.28s;
    white-space: nowrap;
}

.btn-gold { background: var(--et-gold); color: var(--et-black); }
.btn-gold:hover { background: var(--et-green); color: var(--et-black); transform: translateY(-3px); box-shadow: 0 12px 26px rgba(68, 189, 50, 0.3); }

.btn-ghost { border-color: var(--et-gold); color: var(--et-gold); background: rgba(0, 0, 0, 0.35); }
.btn-ghost:hover { border-color: var(--et-green); color: var(--et-green); transform: translateY(-3px); }

/* A page that is only an outline says so rather than implying
   the detail is elsewhere. */
.draft-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 30px;
    padding: 15px 18px;
    border: 1px dashed var(--et-border-color);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--et-text-dim);
}

.draft-note i { color: var(--et-gold); margin-top: 4px; flex-shrink: 0; }

/* ===================== FOOTER ===================== */
.site-footer {
    background-color: var(--et-black);
    color: #bbb;
    padding: 50px 0 20px;
    border-top: 5px solid var(--et-gold);
}

.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
.footer-section { flex: 1; min-width: 230px; }
.footer-section h4 { color: var(--et-gold); margin-bottom: 22px; font-size: 17px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-section p { font-size: 14px; line-height: 1.6; color: #ccc; }
.footer-links li { margin-bottom: 11px; }
.footer-links a { color: #ccc; font-size: 14px; display: inline-flex; align-items: center; gap: 10px; }
.footer-links a:hover { color: var(--et-green); }
.footer-links i { color: var(--et-gold); width: 15px; }

.footer-bottom { text-align: center; border-top: 1px solid #1e1e1e; margin-top: 38px; padding-top: 20px; font-size: 13px; color: #777; }
.footer-bottom span { color: var(--et-green); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 991px) {
    .menu-toggle { display: block; }

    .nav-links {
        position: fixed;
        top: 80px; left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--et-black);
        border-bottom: 3px solid var(--et-gold);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    .nav-links.open { max-height: 460px; }
    .nav-links > li > a { padding: 16px 22px; border-bottom: 1px solid #1c1c1c; border-radius: 0; }
    .nav-links > li:last-child { padding: 14px 22px; }
}

@media (max-width: 620px) {
    .sheet { padding: 20px 16px 0; }
    .cta-strip { padding: 26px 20px; }
}

/* =================================================
   ARABIC / RTL
   The base sheet is written left-to-right, so this
   block mirrors only the rules that carry a side.
   ================================================= */
[dir="rtl"] body { font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; }
[dir="rtl"] .navbar { left: auto; right: 0; }
[dir="rtl"] .page-head { background: radial-gradient(ellipse at 80% 0%, #14181d 0%, #000 65%); }
[dir="rtl"] .sheet-code, [dir="rtl"] .point .n { font-family: 'Consolas', 'Courier New', monospace; }

/* The drawings are laid out on fixed coordinates. Left to right
   keeps anchors and spans where they were drawn; Arabic runs
   inside still shape and order correctly on their own. */
[dir="rtl"] .dgm text { direction: ltr; }

@media (max-width: 991px) {
    [dir="rtl"] .nav-links { left: auto; right: 0; }
}

/* A fact the page cannot invent — an accreditation number, an hour
   count, a price. Visible on purpose, so an unfilled one is never
   mistaken for a claim. */
.ph {
    display: inline-block;
    padding: 1px 8px;
    border: 1px dashed var(--et-gold);
    border-radius: 4px;
    background: rgba(212, 175, 55, 0.12);
    color: var(--et-gold);
    font-weight: 700;
    font-size: 0.94em;
}

/* Parts of a drawing arrive in the order the system works in, so the
   schematic reads as a sequence rather than appearing all at once.
   Each part sets its own --d delay. */
.dgm .step {
    opacity: 0;
    animation: dgm-in .55s cubic-bezier(.16, 1, .3, 1) var(--d, 0s) forwards;
}

@keyframes dgm-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dgm .step { opacity: 1; animation: none; }
    .dgm .flow { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: .5; }
    .point:hover, .module:hover, .subject:hover { transform: none; }
}
