/* =========================================================
   main.css: the foundation every section shares.

   1. Fonts           6. Buttons
   2. Brand colors    7. Header
   3. Base page       8. Hero
   4. Layout          9. Forms (shared by notes + contact)
   5. Text           10. Footer + phone tab bar
   ========================================================= */


/* ---------- 1. FONTS ---------- */
@import url("https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&family=Gowun+Dodum&family=Gaegu:wght@400;700&family=Baloo+Bhaijaan+2:wght@500;700&family=Tajawal:wght@400;500;700&display=swap");


/* ---------- 2. BRAND COLORS ----------
   Each color is a variable: define once, use everywhere.
   Light mode is the default list; dark mode overrides it. */
:root {
    --coral: #FF6F61;          /* the brand color */
    --coral-text: #E2554A;     /* coral for text on white (easier to read) */

    --bg: #FFFFFF;             /* page */
    --card: #FFFFFF;           /* cards, panels */
    --field: #FBF9F6;          /* form inputs */
    --text: #24201C;
    --muted: #756D66;
    --line: #EFEAE4;
    --section-tint: #FFF2E8;   /* the roles section background */
    --chip: #FFF2E8;           /* small labels like "Python" */
    --chip-text: #24201C;

    /* pastel paper colors (notes, covers) */
    --pink: #FCD8CF;
    --butter: #FFEACB;
    --sky: #DCE6FB;
    --lilac: #E9E4FA;

    /* the soft glows behind the hero and contact sections */
    --hero-bg:
        radial-gradient(ellipse 60% 70% at 85% 75%, rgba(248, 150, 120, 0.5), transparent 70%),
        radial-gradient(ellipse 50% 60% at 100% 20%, rgba(255, 200, 160, 0.55), transparent 70%),
        radial-gradient(ellipse 40% 50% at 0% 100%, rgba(233, 228, 250, 0.9), transparent 70%);
    --contact-bg:
        radial-gradient(ellipse 55% 80% at 100% 100%, rgba(248, 150, 120, 0.38), transparent 70%),
        radial-gradient(ellipse 40% 60% at 0% 100%, rgba(233, 228, 250, 0.8), transparent 70%);

    /* a very fine paper grain on top of the glows */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.15 0 0 0 0 0.05 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");

    --font-display: "Gowun Batang", Georgia, serif;
    --font-body: "Gowun Dodum", system-ui, sans-serif;
    --font-hand: "Gaegu", "Comic Sans MS", cursive;

    color-scheme: light;
}

:root[data-theme="dark"] {
    --coral-text: #FF6F61;
    --bg: #17141A;             /* warm near-black */
    --card: #221E24;
    --field: #1B181D;
    --text: #F4EDE8;
    --muted: #B5AAA7;
    --line: #3A3338;
    --section-tint: #1E1A21;   /* gray, not red */
    --chip: #2E2834;
    --chip-text: #F4EDE8;
    --hero-bg: radial-gradient(ellipse 70% 80% at 95% 100%, rgba(255, 111, 97, 0.20), transparent 70%);
    --contact-bg: radial-gradient(ellipse 55% 80% at 100% 100%, rgba(255, 111, 97, 0.18), transparent 70%);
    color-scheme: dark;
}

/* Arabic uses fonts that have Arabic letters */
:root[dir="rtl"] {
    --font-display: "Baloo Bhaijaan 2", Tahoma, sans-serif;
    --font-body: "Tajawal", Tahoma, sans-serif;
    --font-hand: "Baloo Bhaijaan 2", Tahoma, sans-serif;
}


/* ---------- 3. BASE PAGE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}

img, svg { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.sr-only {                       /* text only screen readers hear */
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* ---------- 4. LAYOUT ----------
   .wrap keeps content centered, max 960px, 20px side space on phones. */
.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding-inline: 20px;
}

main > section { padding-block: 56px; }


/* ---------- 5. TEXT ---------- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    text-wrap: balance;
}

/* clamp(min, grows with screen, max) = fits every screen */
h1 { font-size: clamp(38px, 9vw, 64px); }
h2 { font-size: clamp(30px, 6vw, 42px); }
h3 { font-size: 21px; }

.eyebrow {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.lead, .intro {
    max-width: 32em;
    color: var(--muted);
    font-size: 17px;
}

.accent { color: var(--coral-text); }
.center { text-align: center; }

.small-note {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

/* Arabic letters run bigger, so headings are scaled down */
[dir="rtl"] h1 { font-size: clamp(28px, 6.4vw, 46px); line-height: 1.45; }
[dir="rtl"] h2 { font-size: clamp(24px, 5vw, 34px); line-height: 1.4; }
[dir="rtl"] h3 { font-size: 18px; }
[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 14px; }


/* ---------- 6. BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--coral); color: #FFFFFF; }
.btn-ghost   { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }


/* ---------- 7. HEADER ---------- */
.top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.logo { color: var(--text); }       /* the logo's stem uses this color */
.logo svg { display: block; }

.links { display: flex; gap: 22px; font-size: 14px; }
.links a { position: relative; text-decoration: none; opacity: 0.85; }

/* the section you're reading is highlighted (set by nav.js) */
.links a.active { color: var(--coral); opacity: 1; font-weight: 700; }
.links a.active::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -6px;
    height: 2px; border-radius: 2px; background: var(--coral);
}

.settings { display: flex; align-items: center; gap: 8px; }

.icon-btn, .lang-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.icon-btn { width: 34px; }
.lang-btn { min-width: 52px; padding-inline: 14px; font-family: "Tajawal", system-ui, sans-serif; }

.icon-btn svg {
    width: 17px; height: 17px;
    fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round;
}
/* show the sun in dark mode, the moon in light mode */
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }


/* ---------- 8. HERO ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(64px, 11vw, 104px) 72px;
    background: var(--grain), var(--hero-bg);
}

/* the faint network map in the background */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../assets/network.svg") center / cover no-repeat;
    opacity: 0.18;              /* very faint: a texture, not a drawing */
    pointer-events: none;
}
[dir="rtl"] .hero::before { transform: scaleX(-1); }

.hero .wrap { position: relative; }   /* keeps text above the map */
.hero h1 { max-width: 620px; }
.hero .lead { margin: 16px 0 26px; }


/* ---------- 9. FORMS (shared) ---------- */
.card-form {
    display: grid;
    gap: 8px;
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(80, 60, 30, 0.08);
}
[data-theme="dark"] .card-form { box-shadow: none; }

.card-form label,
.card-form legend {
    font-size: 14px;
    color: var(--muted);
}

.card-form input[type="text"],
.card-form input[type="email"],
.card-form textarea,
.card-form select {
    width: 100%;
    margin-bottom: 8px;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 16px;            /* 16px stops phones from zooming in */
}

.card-form input:focus,
.card-form textarea:focus,
.card-form select:focus {
    outline: none;
    border-color: var(--coral);
}

.card-form textarea { resize: vertical; }
.card-form .btn { justify-self: start; }

.form-error  { margin: 0; min-height: 1em; font-size: 13px; color: #D93A2E; }
.form-status { margin: 0; min-height: 1em; font-size: 14px; color: var(--muted); }
[data-theme="dark"] .form-error { color: #FF8A80; }


/* ---------- 10. FOOTER + PHONE TAB BAR ---------- */
.site-footer {
    max-width: 960px;
    margin: 56px auto 0;
    padding: 28px 20px 0;
    display: grid;
    justify-items: center;
    gap: 14px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;          /* keeps all pills the same height */
    gap: 10px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.footer-links a:hover { border-color: var(--coral); transform: translateY(-2px); }

.footer-links svg {
    width: 17px; height: 17px;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

/* LinkedIn before you add the link: grey and not clickable */
.footer-links a.is-soon { color: var(--muted); pointer-events: none; }
.soon-badge {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--muted);
    font-size: 11px;
}

.made { margin: 0; font-size: 14px; color: var(--muted); }
.heart { color: var(--coral); }

/* Phone tab bar: hidden on big screens */
.tabs { display: none; }

@media (max-width: 759px) {
    .links { display: none; }        /* top menu hides on phones */

    .tabs {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
        display: flex; justify-content: space-around;
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--bg);
        border-top: 1px solid var(--line);
    }
    .tabs a { font-size: 12px; text-decoration: none; color: var(--muted); }
    .tabs a.active { color: var(--coral); font-weight: 700; }

    body { padding-bottom: 64px; }   /* room for the tab bar */
}
