/* =========================================================
   hamidraza.me — "Clean" design
   One typeface, one accent, lots of white space.
   Light by default, dark via system setting or the toggle.
   ========================================================= */

:root {
  --bg: #FFFFFF;
  --soft: #F5F6F8;
  --line: #E6E8EC;
  --fg: #0E1116;
  --muted: #5F6672;
  --accent: #2952E3;
  --accent-soft: #EEF2FE;
  --ok: #16A34A;
  --bad: #DC2626;
  --shadow: 0 10px 30px rgba(15, 17, 22, .10);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0D10; --soft: #15171C; --line: #25282F; --fg: #F2F3F5; --muted: #9AA0AB;
    --accent: #7C9BFF; --accent-soft: #1A2140; --ok: #4ADE80; --bad: #F87171;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0C0D10; --soft: #15171C; --line: #25282F; --fg: #F2F3F5; --muted: #9AA0AB;
  --accent: #7C9BFF; --accent-soft: #1A2140; --ok: #4ADE80; --bad: #F87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 32px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; margin-right: auto; }
.brand img { width: 32px; height: 32px; border-radius: 50%; background: var(--soft); }
.nav { display: flex; gap: 4px; }
.nav a { font-size: 14.5px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; }
.nav a:hover { color: var(--fg); background: var(--soft); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--font); padding: 12px 20px; border-radius: 12px; text-decoration: none; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; transition: transform .15s, opacity .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }

/* ---------- hero ---------- */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; padding-block: 72px 64px; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; margin: 22px 0 18px; text-wrap: balance; }
.hero h1 span { color: var(--accent); }
.lede { font-size: clamp(16.5px, 1.5vw, 18.5px); color: var(--muted); max-width: 50ch; margin: 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.facts { display: flex; gap: 28px; flex-wrap: wrap; margin: 40px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; }
.facts dt { order: 2; font-size: 13.5px; color: var(--muted); }
.facts dd { order: 1; margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stage { position: relative; height: clamp(320px, 38vw, 460px); border-radius: 24px; background: radial-gradient(70% 70% at 50% 45%, var(--accent-soft), var(--soft) 75%); overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .fallback { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .4s; }
.stage .fallback svg { width: 62%; height: auto; }
.stage.is-3d .fallback { opacity: 0; pointer-events: none; }

/* ---------- sections ---------- */
.sec { padding-block: 88px; border-top: 1px solid var(--line); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; margin: 0; }
.sec-head p { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- projects ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; flex-wrap: wrap; }
.seg button { font: 500 14px var(--font); color: var(--muted); background: none; border: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg button small { opacity: .7; margin-left: 4px; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card[hidden] { display: none; }
.card h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.card p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.card .stack { color: var(--muted); }
.card .links { display: flex; gap: 14px; font-weight: 600; }
.card .links a { color: var(--accent); text-decoration: none; }
.card .links a:hover { text-decoration: underline; }
.card .links span { color: var(--muted); font-weight: 500; }

/* project cover: every project sits in the same soft frame */
.cover { position: relative; container-type: inline-size; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--soft); }
.cover .win { position: absolute; left: 7%; top: 9%; width: 100%; bottom: -8%; border-radius: 12px 0 0 0; background: var(--bg); box-shadow: var(--shadow), 0 0 0 1px var(--line); overflow: hidden; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .cover .win { transform: translate(-2.5%, -3%); }
.cover .bar { display: flex; align-items: center; gap: 1.6cqw; height: 7.4cqw; padding: 0 3cqw; font: 500 3.1cqw/1 var(--font); color: var(--muted); border-bottom: 1px solid var(--line); }
.cover .bar i { width: 2.2cqw; height: 2.2cqw; border-radius: 50%; background: var(--line); flex: none; }
.cover .bar span { margin-left: 2cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover .shot { display: block; width: 100%; height: auto; max-width: none; }
.cover .body { padding: 7cqw 10cqw 0 6cqw; display: grid; gap: 3cqw; }
.cover .body b { font: 800 8.4cqw/1.05 var(--font); letter-spacing: -.02em; }
.cover .body code { font: 3.4cqw/1.4 ui-monospace, Consolas, monospace; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover .langs { display: flex; gap: .6cqw; height: 2.2cqw; border-radius: 1.1cqw; overflow: hidden; }
.cover .langs i { display: block; height: 100%; background: var(--muted); }
.cover .langs i:nth-child(1) { background: var(--accent); }
.cover .langs i:nth-child(2) { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cover .legend { display: flex; gap: 4cqw; font: 500 3.1cqw/1 var(--font); color: var(--muted); }
.cover .legend span { display: flex; align-items: center; gap: 1.3cqw; }
.cover .legend span::before { content: ""; width: 2cqw; height: 2cqw; border-radius: 50%; background: var(--muted); }
.cover .legend span:nth-child(1)::before { background: var(--accent); }
.cover .legend span:nth-child(2)::before { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cover .lock { width: 7cqw; height: 7cqw; color: var(--accent); }
.cover .orgs { display: flex; flex-wrap: wrap; gap: 1.6cqw; }
.cover .orgs span { font: 500 3.2cqw/1 var(--font); padding: 1.6cqw 2.4cqw; border: 1px solid var(--line); border-radius: 1.6cqw; }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.service { padding-top: 20px; border-top: 2px solid var(--fg); }
.service h3 { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.service p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- testimonials (shown only when config has items) ---------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.quote { margin: 0; padding: 28px; border-radius: 20px; background: var(--soft); }
.quote blockquote { margin: 0 0 16px; font-size: 17px; }
.quote figcaption { font-size: 14px; color: var(--muted); }
.quote figcaption b { color: var(--fg); }

/* ---------- about + experience ---------- */
.about { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; }
.about .side { display: grid; gap: 18px; align-content: start; }
.about .side img { width: 88px; height: auto; border-radius: 20px; background: var(--soft); }
.about .side p { margin: 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { font-size: 13.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--soft); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline li:first-child { padding-top: 0; }
.timeline small { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.timeline h3 { margin: 0; font-size: 17px; font-weight: 700; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 15px; max-width: 60ch; }
.sub { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 40px 0 14px; }
.about .sub:first-child { margin-top: 0; }

/* ---------- contact ---------- */
.contact-sec { border-top: 0; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; background: var(--soft); border-radius: 28px; padding: clamp(24px, 5vw, 56px); }
.contact h2 { font-size: clamp(30px, 3.8vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 0 0 14px; }
.contact p { color: var(--muted); margin: 0 0 24px; max-width: 42ch; }
.mail { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: 17px; }
.mail a { text-decoration: none; word-break: break-all; }
.mail a:hover { color: var(--accent); }
.contact-info { display: grid; gap: 4px; margin-top: 22px; color: var(--muted); font-size: 15px; }
.contact-info a { text-decoration: none; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form input, .form textarea { font: 15.5px var(--font); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form textarea { min-height: 130px; resize: vertical; }
.form .btn { justify-self: start; }
.form-status { margin: 0; font-size: 14px; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--bad); }

/* ---------- footer ---------- */
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 36px 48px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap, .about, .contact { grid-template-columns: minmax(0, 1fr); }
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .projects, .services { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .hero .wrap { padding-block: 40px; }
  .sec { padding-block: 64px; }
  .hire { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
