/* hinthe.us — Hassan Jiddah. Static build. */

:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 10%;
  --muted-fg: 0 2% 35%;
  --border: 0 0% 92%;
  --card: 0 0% 98%;
  --card-border: 0 0% 94%;
  --primary: 210 90% 45%;
  --primary-fg: 210 90% 98%;
  --accent: 210 15% 92%;
  --accent-fg: 210 15% 15%;
  --secondary: 0 0% 88%;
  --elevate: rgba(0,0,0,.03);
  --radius: .5rem;
  --font-sans: 'Inter', 'Vazirmatn', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Vazirmatn', system-ui, sans-serif;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 768px) { .wrap { padding: 0 2rem; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: hsl(var(--background) / .95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: hsl(var(--border)); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
@media (min-width: 768px) { .header-inner { height: 5rem; } }
.logo img { height: 2rem; width: auto; }
@media (min-width: 768px) { .logo img { height: 2.5rem; } }

.nav-desktop { display: none; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .nav-desktop { display: flex; } }
.nav-desktop a {
  position: relative; font-size: .875rem; font-weight: 500;
  color: hsl(var(--muted-fg)); text-decoration: none;
  transition: color .15s ease;
}
.nav-desktop a:hover { color: hsl(var(--foreground)); }
.nav-desktop a[aria-current="page"] { color: hsl(var(--foreground)); }
.nav-desktop a::after {
  content: ""; position: absolute; left: 0; bottom: -.25rem; height: 1px;
  width: 0; background: hsl(var(--foreground)); transition: width .2s ease;
}
.nav-desktop a:hover::after, .nav-desktop a[aria-current="page"]::after { width: 100%; }

.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 0; background: none;
  color: inherit; cursor: pointer; border-radius: var(--radius);
}
@media (min-width: 768px) { .menu-btn { display: none; } }
.menu-btn:hover { background: var(--elevate); }

.nav-mobile { display: none; padding-bottom: 1rem; }
.nav-mobile.open { display: block; }
@media (min-width: 768px) { .nav-mobile, .nav-mobile.open { display: none; } }
.nav-mobile a {
  display: block; padding: .625rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; text-decoration: none;
  color: hsl(var(--muted-fg));
}
.nav-mobile a:hover { background: hsl(var(--accent)); color: hsl(var(--accent-fg)); }
.nav-mobile a[aria-current="page"] { background: hsl(var(--accent)); color: hsl(var(--accent-fg)); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 700;
  letter-spacing: -.025em; line-height: 1.05; margin-bottom: 1.5rem;
}
.page-title { font-size: clamp(2.25rem, 5vw, 3rem); font-weight: 700; margin-bottom: 1rem; }
.section-title { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 700; margin-bottom: 2rem; }
.lede { font-size: 1.25rem; color: hsl(var(--muted-fg)); margin: 0; }
.hero-sub {
  font-size: 1.125rem; color: hsl(var(--muted-fg));
  line-height: 1.7; margin: 0 0 2rem; max-width: 48rem;
}
@media (min-width: 768px) { .hero-sub { font-size: 1.25rem; } }
.eyebrow {
  font-size: .8125rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .06em; color: hsl(var(--muted-fg)); margin: 0 0 .75rem;
}
p { line-height: 1.7; }

/* ---------- layout ---------- */
main { min-height: 60vh; }
.page { padding: 4rem 0; }
@media (min-width: 768px) { .page { padding: 6rem 0; } }
.hero { display: flex; align-items: center; min-height: calc(100vh - 8rem); padding: 4rem 0; }
.prose-block { max-width: 48rem; }
.prose-block p { font-size: 1.0625rem; margin: 0 0 1.5rem; }
@media (min-width: 768px) { .prose-block p { font-size: 1.125rem; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.5rem; border-radius: var(--radius);
  font-size: .9375rem; font-weight: 500; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: opacity .15s ease;
  min-height: 2.75rem;
}
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); }
.btn-primary:hover { opacity: .9; }
.btn-outline { border-color: hsl(var(--border)); background: transparent; color: hsl(var(--foreground)); }
.btn-outline:hover { background: var(--elevate); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }

/* ---------- social row ---------- */
.social-row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.social-row a {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .875rem; color: hsl(var(--muted-fg)); text-decoration: none;
  transition: color .15s ease;
}
.social-row a:hover { color: hsl(var(--foreground)); }
.social-row svg { width: 1rem; height: 1rem; }

/* ---------- timeline ---------- */
.timeline { border-left: 2px solid hsl(var(--border)); padding-left: 2rem; margin: 0; }
.timeline-item { position: relative; padding-bottom: 3rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -2.6rem; top: .3rem;
  width: 1rem; height: 1rem; border-radius: 50%;
  background: hsl(var(--foreground)); border: 4px solid hsl(var(--background));
}
.role-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.role-title { font-size: 1.25rem; font-weight: 600; font-family: var(--font-sans); }
.role-org { font-size: .875rem; font-weight: 500; }
.role-period { font-size: .875rem; color: hsl(var(--muted-fg)); margin: .25rem 0 .5rem; }
.role-desc { margin: 0; }

/* ---------- cards ---------- */
.card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius); padding: 1.5rem;
}
.card + .card { margin-top: 1.5rem; }
.card h3 { font-size: 1.125rem; font-weight: 600; font-family: var(--font-sans); margin: 0 0 .5rem; }
.card-meta { font-size: .875rem; color: hsl(var(--muted-fg)); }

/* ---------- projects ---------- */
.project { padding-bottom: 3rem; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 3rem; }
.project:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.project-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .project-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.project-img { border-radius: var(--radius); overflow: hidden; background: hsl(var(--accent)); aspect-ratio: 16 / 10; }
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project h3 { font-size: 1.25rem; font-weight: 600; font-family: var(--font-sans); margin: 0 0 .75rem; }
.project ul { margin: 0 0 1rem; padding-left: 1.125rem; }
.project li { font-size: .9375rem; color: hsl(var(--muted-fg)); margin-bottom: .375rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag {
  padding: .25rem .5rem; font-size: .75rem; font-weight: 500;
  background: hsl(var(--accent)); color: hsl(var(--accent-fg)); border-radius: .25rem;
}

/* ---------- meta lists ---------- */
.meta-section { border-top: 1px solid hsl(var(--border)); padding-top: 3rem; max-width: 48rem; }
.meta-group { margin-bottom: 2rem; }
.meta-group:last-child { margin-bottom: 0; }
.meta-group p { margin: 0 0 .5rem; font-size: 1rem; }
.dim { color: hsl(var(--muted-fg)); }

/* ---------- contact ---------- */
.contact-list { display: flex; flex-direction: column; gap: 1.5rem; max-width: 36rem; }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-item svg { width: 1.25rem; height: 1.25rem; color: hsl(var(--muted-fg)); flex-shrink: 0; margin-top: .2rem; }
.contact-item a { font-size: 1.0625rem; font-weight: 500; text-decoration: none; }
.contact-item a:hover { color: hsl(var(--primary)); }
.contact-item .val { font-size: 1.0625rem; font-weight: 500; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid hsl(var(--border)); margin-top: 6rem; }
.footer-inner {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 2rem 0; text-align: center;
}
@media (min-width: 640px) { .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-inner p { font-size: .875rem; color: hsl(var(--muted-fg)); margin: 0; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: hsl(var(--muted-fg)); transition: color .15s ease; display: inline-flex; padding: .25rem; }
.footer-links a:hover { color: hsl(var(--foreground)); }
.footer-links svg { width: 1.25rem; height: 1.25rem; }

/* ---------- a11y ---------- */
:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; border-radius: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; padding: .75rem 1rem;
  background: hsl(var(--background)); color: hsl(var(--foreground)); z-index: 100;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================
   Accessibility modes — toggled from the header panel.
   State lives on <html> as data-a11y-* and in localStorage.
   ========================================================= */

/* --- larger text --- */
html[data-a11y-text="on"] { font-size: 118%; }
html[data-a11y-text="on"] .hero-title { font-size: clamp(2.25rem, 6vw, 3.75rem); }

/* --- high contrast --- */
html[data-a11y-contrast="on"] {
  --foreground: 0 0% 0%;
  --muted-fg: 0 0% 22%;
  --border: 0 0% 55%;
  --card: 0 0% 100%;
  --card-border: 0 0% 40%;
  --primary: 214 100% 30%;
  --accent: 210 25% 88%;
  --accent-fg: 0 0% 0%;
}
html[data-a11y-contrast="on"] .btn-outline { border-width: 2px; }
html[data-a11y-contrast="on"] .card { border-width: 2px; }
html[data-a11y-contrast="on"] .tag { border: 1px solid hsl(var(--card-border)); }

/* --- underline links --- */
html[data-a11y-links="on"] main a:not(.btn),
html[data-a11y-links="on"] .nav-desktop a,
html[data-a11y-links="on"] .footer-inner a { text-decoration: underline; text-underline-offset: 3px; }

/* --- reduced motion (user toggle or OS preference) --- */
html[data-a11y-motion="off"] *,
html[data-a11y-motion="off"] *::before,
html[data-a11y-motion="off"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- the panel itself --- */
.a11y-wrap { position: relative; display: inline-flex; }
.a11y-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 0; background: none;
  color: hsl(var(--muted-fg)); cursor: pointer; border-radius: var(--radius);
  transition: color .15s ease, background .15s ease;
}
.a11y-btn:hover { color: hsl(var(--foreground)); background: var(--elevate); }
.a11y-btn svg { width: 1.375rem; height: 1.375rem; }

.a11y-panel {
  position: absolute; right: 0; top: calc(100% + .5rem);
  width: 16rem; padding: .75rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  z-index: 60;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 {
  font-family: var(--font-sans); font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-fg)); margin: 0 0 .5rem; padding: 0 .25rem;
}
.a11y-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .5rem .25rem; font-size: .875rem;
}
.a11y-row label { cursor: pointer; flex: 1; }
.a11y-row input {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 2.25rem; height: 1.25rem; border-radius: 999px;
  background: hsl(var(--secondary)); border: 1px solid hsl(var(--border));
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: background .15s ease;
}
.a11y-row input::after {
  content: ""; position: absolute; top: 1px; left: 1px;
  width: 1rem; height: 1rem; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3);
  transition: transform .15s ease;
}
.a11y-row input:checked { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.a11y-row input:checked::after { transform: translateX(1rem); }
.a11y-reset {
  width: 100%; margin-top: .375rem; padding: .5rem;
  font-size: .8125rem; font-family: inherit; color: hsl(var(--muted-fg));
  background: none; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); cursor: pointer;
}
.a11y-reset:hover { background: var(--elevate); color: hsl(var(--foreground)); }


/* header right-hand cluster */
.header-right { display: flex; align-items: center; gap: .25rem; }
@media (min-width: 768px) { .header-right { gap: 1.25rem; } }
