/* ============================================================
   Dr. Feras Awaysheh: personal academic site (draft)
   Design tokens, light/dark theme switch and scroll-in motion; the look
   follows the reference page (dark teal, serif headings, gold marker on
   the active menu item).
   ============================================================ */

:root,
[data-theme="dark"] {
  --bg:          #0a2a31;
  --bg-alt:      #0d323a;
  --surface:     #103a43;
  --surface-2:   #14444e;
  --text:        #e8f1f2;
  --text-muted:  #a8c2c6;
  --border:      #215a66;
  --accent:      #72c4d1;
  --accent-soft: rgba(114, 196, 209, .12);
  --gold:        #e6b43c;
  --hero-from:   #06191e;
  --hero-to:     #0c3039;
  --shadow:      0 14px 40px rgba(0, 0, 0, .35);
  --header-bg:   rgba(8, 33, 40, .92);
}

[data-theme="light"] {
  --bg:          #f4f8f8;
  --bg-alt:      #e8f1f2;
  --surface:     #ffffff;
  --surface-2:   #eef5f6;
  --text:        #0f2a30;
  --text-muted:  #46606a;
  --border:      #cbdde0;
  --accent:      #0b6b7c;
  --accent-soft: rgba(11, 107, 124, .09);
  --gold:        #d99a14;
  --hero-from:   #0b2a31;
  --hero-to:     #14505c;
  --shadow:      0 12px 32px rgba(15, 42, 48, .12);
  --header-bg:   rgba(244, 248, 248, .94);
}

:root {
  --wrap: 1120px;
  --radius: 14px;
  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-0: clamp(1rem, .96rem + .2vw, 1.08rem);
  --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.3rem + .75vw, 1.95rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 2.9rem);
  --step-4: clamp(2.5rem, 1.9rem + 3vw, 4.1rem);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .6em; text-wrap: balance; }
p { margin: 0 0 1.1em; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--gold); color: #1a1405; padding: .6rem 1rem; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: .75rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 2px solid var(--accent); border-radius: 12px;
  box-shadow: inset 0 -4px 0 var(--gold);
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem; letter-spacing: .03em; color: var(--text);
  transition: border-color .2s, color .2s;
}
.brand:hover .brand-mark { border-color: var(--gold); color: var(--accent); }

.primary-nav { display: none; }
.nav-list { display: flex; align-items: stretch; gap: .15rem; list-style: none; margin: 0; padding: 0; height: var(--header-h); }
.nav-list > li { position: relative; display: flex; align-items: stretch; }

.nav-link {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 0 .8rem; color: var(--text); text-decoration: none;
  font-size: .95rem; font-weight: 500; white-space: nowrap;
  box-shadow: inset 0 3px 0 transparent;
  transition: box-shadow .2s, color .2s;
}
.nav-link:hover { color: var(--accent); box-shadow: inset 0 3px 0 var(--border); }
.nav-link[aria-current="page"] { box-shadow: inset 0 3px 0 var(--gold); }

.sub-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; margin-left: -.55rem; padding: 0;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.sub-toggle svg { width: .75rem; height: .75rem; transition: transform .2s; }
.has-sub.open .sub-toggle svg { transform: rotate(180deg); }

.sub-menu {
  list-style: none; margin: 0; padding: .4rem;
  position: absolute; top: 100%; left: 0; min-width: 14rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.has-sub:hover > .sub-menu,
.has-sub.open > .sub-menu,
.has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sub-menu a {
  display: block; padding: .6rem .8rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .95rem;
}
.sub-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.sub-menu a[aria-current="page"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--gold); }

.header-tools { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: 50%; color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
[data-theme="dark"] .icon-moon, :root:not([data-theme]) .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.nav-toggle .bars { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; transition: transform .2s; }
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--bg-alt); }
.nav-open .mobile-nav { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: .5rem 0 1rem; }
.mobile-nav a { display: block; padding: .7rem .25rem; color: var(--text); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border); }
.mobile-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 3px 0 0 var(--gold); padding-left: .75rem; }
.mobile-nav .sub a { padding-left: 1.5rem; font-weight: 400; color: var(--text-muted); }
.mobile-nav .sub a[aria-current="page"] { padding-left: 1.5rem; color: var(--accent); }

@media (min-width: 1040px) {
  .primary-nav { display: block; }
  .nav-toggle, .mobile-nav { display: none !important; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #eef6f7;
  background:
    radial-gradient(90% 120% at 78% 20%, rgba(114, 196, 209, .22), transparent 60%),
    repeating-linear-gradient(100deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 120px),
    linear-gradient(160deg, var(--hero-from), var(--hero-to));
}
.hero-inner { display: grid; gap: 2.5rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { font-size: var(--step-4); color: #fff; margin-bottom: .35em; }
.hero .role { font-size: var(--step-1); font-weight: 500; color: #fff; margin: 0 0 .15em; }
.hero .affil { color: #bcd6da; margin: 0 0 1.4rem; }
.hero .tagline { font-family: var(--serif); font-size: var(--step-2); line-height: 1.3; color: #d6ebee; max-width: 30ch; margin-bottom: 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-photo { justify-self: center; width: min(360px, 82%); }
.photo-frame {
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 24px 60px rgba(0, 0, 0, .5);
  border-bottom: 5px solid var(--gold);
}
.photo-frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 8%; }

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.25fr .75fr; }
  .hero-photo { justify-self: end; }
}

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .98rem;
  text-decoration: none; border: 2px solid var(--gold);
  transition: transform .15s, background .2s, color .2s;
}
.btn-primary { background: var(--gold); color: #1a1405; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.section .btn-ghost { color: var(--text); border-color: var(--border); }
.section .btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- sections ---------- */
.section { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: var(--step-3); color: var(--accent); margin-bottom: .2em; }
.section-sub { color: var(--text-muted); font-size: var(--step-1); margin-bottom: 1.6rem; }
.prose { max-width: 72ch; }
.prose p:last-child { margin-bottom: 0; }
.subhead { font-size: var(--step-2); margin: 2.6rem 0 1.2rem; }
.section .subhead:first-of-type { margin-top: 2rem; }

/* education */
.entries { display: grid; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid; gap: .4rem 2rem; padding: 1.4rem 1.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.entry h3 { font-size: var(--step-1); margin: 0; }
.entry .meta { color: var(--accent); font-weight: 500; font-size: .95rem; margin: 0; }
.entry p { margin: 0; color: var(--text-muted); }
.entry h3 a { color: var(--text); text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.entry h3 a:hover { color: var(--accent); }
.series h3 { margin-bottom: .4rem; }
.rows { list-style: none; margin: .6rem 0 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .2rem 1rem; align-items: baseline; padding: .75rem 0; border-top: 1px solid var(--border); margin: 0; }
.rows .yr { font-family: var(--serif); font-size: 1.35rem; color: var(--accent); }
.rows .role { display: block; font-weight: 500; color: var(--text); }
.rows .where { display: block; font-size: .92rem; color: var(--text-muted); }
.entry ul { margin: .6rem 0 0; padding-left: 1.2rem; color: var(--text); }
.entry li { margin-bottom: .35rem; }

.expertise { display: grid; gap: 1rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 760px) { .expertise { grid-template-columns: 1fr 1fr; } }
.expertise li { padding: 1.1rem 1.3rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--radius); }
.expertise strong { color: var(--accent); font-weight: 600; }

/* contact */
.contact-links { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.2rem; }

/* contact groups */
.contact-grid { display: grid; gap: 1.6rem; }
.contact-group h3 { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .7rem; }
.contact-group .contact-links { margin-top: 0; }

/* ---------- inner pages ---------- */
.page-hero {
  color: #eef6f7; padding-block: clamp(2.5rem, 5vw, 4rem);
  background:
    radial-gradient(80% 140% at 85% 0%, rgba(114, 196, 209, .2), transparent 60%),
    linear-gradient(160deg, var(--hero-from), var(--hero-to));
}
.page-hero h1 { font-size: var(--step-4); color: #fff; margin-bottom: .25em; }
.page-hero .subtitle { font-family: var(--serif); font-size: var(--step-2); line-height: 1.3; color: #d6ebee; max-width: 38ch; margin: 0; }
.page-body { padding-block: clamp(2rem, 5vw, 4rem); }

.todo {
  max-width: 62ch; padding: 1.2rem 1.4rem; border: 2px dashed var(--gold); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text);
}
.todo strong { color: var(--gold); display: block; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: .3rem; }
[data-theme="light"] .todo strong { color: #8a5d00; }
.todo p { margin: 0; }

.fact-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1rem; max-width: 760px; }
.lead-line { font-size: var(--step-1); max-width: 62ch; margin-bottom: 1.4rem; }
.btn-primary-light { background: var(--gold); color: #1a1405; }
.btn-primary-light:hover { transform: translateY(-2px); }

/* panels, lists and tables for CV-based pages */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin: 0 0 2rem; }
.plain-list { list-style: none; display: grid; gap: .8rem; }
.plain-list li { position: relative; padding-left: 1.3rem; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5rem; height: .5rem; border-radius: 2px; background: var(--gold); }
.num-list { list-style: none; counter-reset: n; display: grid; gap: .9rem; }
.num-list li { counter-increment: n; display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; }
.num-list li::before { content: counter(n) "."; font-family: var(--serif); font-size: 1.15rem; color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 2rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.data-table th { text-align: left; padding: .8rem 1rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: #fff; background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); white-space: nowrap; }
.data-table td { padding: .8rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table td:first-child { font-weight: 500; }

/* research vision */
.vision { display: grid; gap: 2.5rem; }
@media (min-width: 1000px) { .vision { grid-template-columns: 250px minmax(0, 1fr); align-items: start; } }
.toc { position: sticky; top: calc(var(--header-h) + 1.25rem); display: none; font-size: .92rem; }
@media (min-width: 1000px) { .toc { display: block; } }
.toc h2 { font-family: var(--sans); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .8rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: .4rem .9rem; color: var(--text-muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--accent); border-left-color: var(--accent); }

.vision-intro { max-width: 72ch; }
.vision-intro .lead { font-size: var(--step-1); }

.rl {
  margin-top: 2rem; padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
.rl h2 { font-size: var(--step-2); color: var(--accent); margin-bottom: .8rem; }
.rl p { max-width: 72ch; }
.keywords { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-bottom: 1.4rem !important; max-width: none !important; }
.keywords > strong { color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin-right: .3rem; }
.chip { display: inline-block; padding: .2rem .75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: .85rem; }
.dir-label { font-weight: 600; margin: 1.6rem 0 .6rem !important; }
.directions { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .5rem 2rem; }
@media (min-width: 760px) { .directions { grid-template-columns: 1fr 1fr; } }
.directions li { position: relative; padding-left: 1.2rem; }
.directions li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5rem; height: .5rem; border-radius: 2px; background: var(--gold); }
.objective { margin: 0 !important; padding: 1rem 1.2rem; border-left: 4px solid var(--gold); background: var(--accent-soft); border-radius: 0 10px 10px 0; max-width: none !important; }
.objective strong { color: var(--accent); }

.themes { margin-top: 3rem; max-width: 72ch; }
.themes h2, .more h2 { font-size: var(--step-2); color: var(--accent); margin-top: 3rem; }
.more { max-width: 72ch; }
.more ul { padding-left: 0; list-style: none; display: grid; gap: .9rem; margin: 0 0 1.4rem; }
.more li { padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.more li strong { color: var(--accent); }
.closing { margin-top: 2.5rem; padding: 1.6rem 1.8rem; border-radius: 18px; background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); color: #fff; font-family: var(--serif); font-size: var(--step-1); line-height: 1.4; max-width: none; }
.closing p { margin: 0; }
.closing strong { font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-block: 2rem; color: var(--text-muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.footer-nav a { color: var(--text-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---------- motion ---------- */
[data-motion] .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
[data-motion] .reveal.in { opacity: 1; transform: none; }

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

@media print {
  /* show everything, including blocks that would normally fade in on scroll */
  [data-motion] .reveal { opacity: 1 !important; transform: none !important; }
  .site-header, .hero-actions, .toc, .header-tools { display: none !important; }
  body { background: #fff; color: #000; }
  .hero, .page-hero { background: none; color: #000; }
  .hero h1, .page-hero h1, .hero .tagline, .hero .role, .hero .affil, .page-hero .subtitle { color: #000; }
}
