/* =========================================================
   Hamed Noroozi — Resume • Blog • Portfolio
   (Resume/Portfolio keep original dark theme)
   ========================================================= */

/* ---------- THEME (Dark by default) ---------- */
:root {
  --bg: #0b0c0e;
  --bg-grad1: rgba(230,126,34,.10);
  --bg-grad2: rgba(59,130,246,.10);
  --card: #121418;
  --surface: #161a1f;

  --text: #f6f7f9;
  --muted: #9aa3af;

  --brand: #e67e22;
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;

  --border: rgba(255,255,255,.08);
  --ring: rgba(230,126,34,.35);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --maxw: 1100px;

  --li: #0a66c2;
  --wa: #25d366;

  --glass-dark: rgba(20,22,26,.55);
  --glass-light: rgba(255,255,255,.65);
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-grad1: rgba(230,126,34,.06);
    --bg-grad2: rgba(59,130,246,.06);
    --card: #ffffff;
    --surface: #fcfcfd;

    --text: #0b0c0e;
    --muted: #4b5563;

    --border: rgba(0,0,0,.06);
    --ring: rgba(230,126,34,.22);
    --shadow: 0 10px 30px rgba(0,0,0,.08);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 800px at 10% -10%, var(--bg-grad1), transparent 60%),
    radial-gradient(800px 600px at 110% 10%, var(--bg-grad2), transparent 60%),
    var(--bg);
  color: var(--text);
  font: clamp(14px, 1.6vw, 16px)/1.55 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.wrap { max-width: var(--maxw); margin: 40px auto; padding: 0 20px 80px; }

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ---------- Top bar (logo only) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px calc(max(20px, (100vw - var(--maxw)) / 2));
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  background: var(--glass-dark);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: light) { .topbar { background: var(--glass-light); } }
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: .2px; }
#brand-logo {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  object-fit: contain;
}

/* ---------- Cards & Sections (Resume styling) ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(0,0,0,.4); }

section h2 {
  margin: 26px 0 12px;
  font-size: 12px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Hero (Resume) ---------- */
.hero {
  display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center;
  background: linear-gradient(180deg, var(--card), var(--surface));
  border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.avatar {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, #ffb472 0%, var(--brand) 60%, #b85a12 100%);
  color: #fff; font-weight: 800; font-size: 28px; letter-spacing: .4px;
  box-shadow: 0 0 0 6px var(--ring);
  user-select: none;
}
.name { margin: 0; font-size: clamp(18px, 3vw, 28px); font-weight: 800; letter-spacing: .3px; }
.role { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.contact { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); }
.contact a { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; }
.contact a:hover { border-bottom-color: currentColor; }
.hero > div { min-width: 0; }

/* ---------- Impact / Timeline / Skills / Projects (Resume) ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.stat h3 { margin: 0; font-size: clamp(16px, 2.6vw, 20px); line-height: 1.15; }
.stat p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.timeline { position: relative; }
.timeline:before {
  content: ""; position: absolute; left: 24px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--brand), transparent); opacity: .7;
}
.tl-item { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; position: relative; margin-top: 22px; }
.tl-item:before {
  content: ""; position: absolute; left: 17px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--brand); box-shadow: 0 0 0 6px var(--ring); z-index: 0; pointer-events: none;
}
.tl-head { grid-column: 2; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; position: relative; z-index: 1; margin: 0 0 12px; }
.tl-role { font-weight: 700; }
.tl-org { color: var(--muted); font-style: italic; }
.tl-meta { white-space: nowrap; color: var(--muted); font-size: 13px; }
.tl-body { grid-column: 2; position: relative; z-index: 1; }
.tl-body ul { list-style-position: outside; padding-left: 20px; margin: 0; }
.tl-body li { margin: 8px 0; }

.skills { display: grid; grid-template-columns: 1fr; gap: 12px; }
.skill-line { display: grid; grid-template-columns: 160px 1fr; gap: 10px; align-items: start; }
.skill-line-head { font-weight: 700; color: var(--text); }
.skill-line-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  color: var(--text); font-size: 13px;
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-title { margin: 0 0 8px; }
.project-summary { margin: 10px 0 0; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 1px 10px rgba(0,0,0,.15);
  color: var(--text); font-size: 12px; letter-spacing: .2px;
}
.tag.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-blue); box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.project-thumb { width: 100%; height: auto; border-radius: 10px; display: block; margin-bottom: 10px; border: 1px solid var(--border); }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); text-decoration: none; color: var(--text); font-size: 13px; }
.btn-link svg { width: 18px; height: 18px; }

.actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn { appearance: none; border: 1px solid transparent; background: var(--brand); color: #fff; font-weight: 700; padding: 10px 14px; border-radius: 12px; cursor: pointer; box-shadow: var(--shadow); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn:active { transform: translateY(1px); }
.cta-card { padding: 20px; }
.cta-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn.brand { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 700; text-decoration: none; color: #fff; border: 1px solid var(--border); }
.btn.brand svg { width: 18px; height: 18px; }
.btn.brand.linkedin { background: var(--li); }
.btn.brand.whatsapp { background: var(--wa); }
.btn.brand.pdf { background: var(--brand); }
.btn.brand:hover { filter: brightness(1.05); }

/* ---------- Router / Accessibility ---------- */
.route { display: none; }
.route.active { display: block; }
.sr-only { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* =========================================================
   HOME (NEW STYLE)
   ========================================================= */
.profile-card {
  text-align: center;
  background: #fff;              /* light card look for contrast */
  color: #333;
  padding: 2rem 1rem;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}
.profile-card .name { color: #111; margin: 0 0 4px; }
.profile-card .role { color: #666; margin: 0 0 12px; }
.profile-card .socials-row { margin-top: 10px; gap: 12px; }

.socials-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.social-chip {
  width: 64px; height: 64px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f2f2f3; color: #222;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transition: transform .15s ease, filter .2s ease, background .2s ease, color .2s ease;
}
.social-chip:hover { transform: translateY(-2px); filter: brightness(1.03); }
.social-chip svg { width: 26px; height: 26px; }
.social-chip span:last-child { display: none; } /* hide label text */

.feature-grid { display: grid; gap: 1.5rem; margin-top: 2rem; }
.feature-block {
  display: block; text-align: center;
  background: #fff; color: #333;
  padding: 1.8rem; border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;                 /* no underline */
}
.feature-block h2 { margin-bottom: .5rem; font-size: 1.5rem; color: #111; }
.feature-block p { color: #555; }
.feature-block:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.feature-block:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }

/* =========================================================
   BLOG (list)
   ========================================================= */
.medium-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .medium-list { grid-template-columns: 1fr 1fr; } }
.medium-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.medium-thumb { position: relative; width: 140px; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg,#30343a,#23272e); flex: 0 0 auto; border: 1px solid var(--border); }
.medium-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.medium-thumb .fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 28px; color: var(--muted); }
.medium-body h3 { margin: 0 0 6px; line-height: 1.25; }
.medium-body h3 a { color: var(--text); text-decoration: none; }
.medium-body h3 a:hover { color: var(--brand); }
.medium-meta { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; }
.medium-preview { margin: 6px 0 10px; color: var(--muted); }
.medium-cta { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); text-decoration: none; border-bottom: 1px dashed rgba(230,126,34,.45); padding-bottom: 2px; }
.medium-cta:hover { border-bottom-style: solid; }

/* ---------- Wider layout for Resume + Portfolio ---------- */
body.route-wide .wrap { max-width: 80vw; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 920px) {
  .hero { grid-template-columns: 72px 1fr; }
  .avatar { width: 72px; height: 72px; font-size: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .skill-line { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .timeline:before { left: 18px; }
  .tl-item { grid-template-columns: 36px 1fr; }
  .tl-item:before { left: 12px; width: 12px; height: 12px; box-shadow: 0 0 0 4px var(--ring); }
}
@media (max-width: 600px) {
  .stats, .grid, .medium-list { grid-template-columns: 1fr; }
}

/* ---------- Contact layout fixes ---------- */
#contact { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.contact .contact-item { white-space: nowrap; overflow-wrap: anywhere; }
.contact .sep { opacity: .6; }
@media (max-width: 520px) { .contact .contact-item { white-space: normal; word-break: break-word; } }
