/*
Theme Name: Saeid Portfolio
Theme URI: https://saeidagheli.com
Author: Saeid Agheli
Description: Clean, colorful, professional multi-page portfolio theme for a Senior Endpoint Administrator.
Version: 2.1.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: saeid-portfolio
*/

:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fd;
  --text: #16202e;
  --muted: #5b6b7f;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef0fe;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --emerald: #059669;
  --amber: #d97706;
  --orange: #f97316;
  --rose: #e11d48;
  --grad: linear-gradient(120deg, #f97316, #a855f7 55%, #4f46e5);
  --border: #e3e9f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 32, 46, .05);
  --shadow-lg: 0 12px 32px rgba(79, 70, 229, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-bar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; height: 66px; gap: 16px;
}
.brand {
  justify-self: start;
  font-weight: 700; font-size: 19px; letter-spacing: -.01em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nav-links { display: flex; gap: 26px; list-style: none; justify-self: center; }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; position: relative; padding-bottom: 4px; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: var(--grad); border-radius: 2px; transition: width .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  justify-self: end; padding: 9px 20px !important; font-size: 14.5px !important;
  background: linear-gradient(120deg, #f97316, #ea580c) !important;
  box-shadow: 0 4px 14px rgba(249, 115, 22, .35) !important;
}
.nav-cta:hover { box-shadow: 0 6px 20px rgba(249, 115, 22, .45) !important; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; justify-self: end; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: .2s; }

/* ---------- Hero ---------- */
.hero {
  padding: 92px 0 76px;
  background:
    radial-gradient(600px 320px at 12% 0%, rgba(249, 115, 22, .10), transparent 65%),
    radial-gradient(520px 300px at 88% 12%, rgba(79, 70, 229, .10), transparent 65%),
    radial-gradient(420px 260px at 55% 100%, rgba(124, 58, 237, .07), transparent 65%),
    var(--bg);
}
.hero-grid { display: flex; align-items: center; gap: 60px; }
.hero-photo { position: relative; flex: none; }
.hero-photo::before {
  content: ""; position: absolute; inset: -5px;
  border-radius: 50%; background: var(--grad);
}
.hero-photo img {
  position: relative;
  width: 300px; height: 300px; object-fit: cover;
  border-radius: 50%; border: 4px solid #fff;
  box-shadow: 0 16px 40px rgba(79, 70, 229, .22);
}
.hero-eyebrow {
  display: inline-block; font-weight: 600; font-size: 14px; letter-spacing: .05em;
  text-transform: uppercase; margin-bottom: 14px;
  color: #c2410c; background: #fff3ea;
  border: 1px solid #fed7b8; border-radius: 24px; padding: 6px 16px;
}
.hero h1 {
  font-size: 48px; line-height: 1.12; letter-spacing: -.02em; margin-bottom: 16px;
  color: var(--text);
}
.hero-tagline { font-size: 19px; color: var(--muted); max-width: 580px; margin-bottom: 18px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 16px; height: 16px; fill: var(--accent); flex: none; }
.hero-meta span:nth-child(2) svg { fill: var(--emerald); }
.hero-meta span:nth-child(3) svg { fill: var(--amber); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.btn {
  display: inline-block; padding: 13px 26px; border-radius: 10px;
  font-weight: 600; font-size: 15.5px; transition: .15s;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(190, 90, 90, .35); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(190, 90, 90, .45); }
.btn-outline { border-color: #cfd8e6; color: var(--text); background: #fff; }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }

.socials { display: flex; gap: 10px; margin-left: 6px; }
.socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--border); color: var(--muted); background: #fff; transition: .15s;
}
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Inner page header ---------- */
.page-head {
  padding: 72px 0 56px;
  background:
    radial-gradient(600px 320px at 10% 0%, rgba(249, 115, 22, .10), transparent 65%),
    radial-gradient(520px 300px at 90% 20%, rgba(79, 70, 229, .10), transparent 65%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-head h1 {
  font-size: 42px; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.page-head p { color: var(--muted); font-size: 18px; max-width: 620px; }
.page-head .btn { margin-top: 22px; }

/* ---------- Stats band ---------- */
.stats { background: var(--grad); padding: 40px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-num { font-size: 36px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.stat-label { color: rgba(255, 255, 255, .85); font-size: 15px; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 8px;
}
.section-head h2 { font-size: 34px; letter-spacing: -.02em; margin-bottom: 10px; }
.section-head h2::after {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--orange), var(--accent)); margin-top: 14px;
}
.section-head p { color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: start; }
.about-text p + p { margin-top: 16px; }
.facts {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); border-top: 4px solid; border-image: var(--grad) 1;
  border-top-left-radius: 0; border-top-right-radius: 0;
}
.facts dt { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.facts dd { margin-bottom: 16px; font-weight: 500; }
.facts dd:last-child { margin-bottom: 0; }

/* ---------- Service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); transition: .18s; border-top: 4px solid var(--accent);
}
.card:nth-child(2) { border-top-color: var(--cyan); }
.card:nth-child(3) { border-top-color: var(--emerald); }
.card:nth-child(4) { border-top-color: var(--violet); }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; fill: var(--accent); }
.card:nth-child(2) .card-icon { background: #e0f5fa; }
.card:nth-child(2) .card-icon svg { fill: var(--cyan); }
.card:nth-child(3) .card-icon { background: #e2f6ee; }
.card:nth-child(3) .card-icon svg { fill: var(--emerald); }
.card:nth-child(4) .card-icon { background: #f1e9fd; }
.card:nth-child(4) .card-icon svg { fill: var(--violet); }
.card h3 { font-size: 19px; margin-bottom: 8px; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: 15.5px; }

/* ---------- Experience timeline ---------- */
.timeline { border-left: 2px solid #d8ddf5; padding-left: 32px; max-width: 760px; }
.tl-item { position: relative; padding-bottom: 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -39px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent);
}
.tl-date {
  display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 20px; padding: 3px 14px;
  text-transform: uppercase; letter-spacing: .04em;
}
.tl-item h3 { font-size: 21px; margin: 10px 0 2px; letter-spacing: -.01em; }
.tl-org { color: var(--cyan); font-weight: 600; margin-bottom: 10px; }
.tl-item p { color: var(--muted); font-size: 15.5px; }

.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 760px; margin-top: 40px; }
.edu {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; box-shadow: var(--shadow); border-left: 4px solid var(--violet);
}
.edu:nth-child(2) { border-left-color: var(--cyan); }
.edu .tl-date { display: inline-block; margin-bottom: 8px; }
.edu h4 { font-size: 16.5px; }
.edu p { color: var(--muted); font-size: 15px; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: .18s; }
.project:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.project h3 { font-size: 17px; margin-bottom: 8px; letter-spacing: -.01em; }
.project p { color: var(--muted); font-size: 14.5px; }
.project-tag { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 20px; padding: 4px 13px; margin-bottom: 14px; }
.project:nth-child(1) .project-tag { color: var(--accent); background: var(--accent-soft); }
.project:nth-child(2) .project-tag { color: var(--cyan); background: #e0f5fa; }
.project:nth-child(3) .project-tag { color: var(--emerald); background: #e2f6ee; }
.project:nth-child(4) .project-tag { color: var(--amber); background: #fdf1e2; }
.project:nth-child(5) .project-tag { color: var(--violet); background: #f1e9fd; }
.project:nth-child(6) .project-tag { color: var(--rose); background: #fdeaef; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 48px; }
.skill-group h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.skill-group:nth-child(odd) h3 { color: var(--orange); }
.skill-group:nth-child(even) h3 { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border-radius: 24px; padding: 8px 18px; font-size: 14.5px; font-weight: 500;
  color: var(--text); border: 1.5px solid #dbe2ec; background: #fff;
  box-shadow: var(--shadow); transition: .15s;
}
.chip:hover { border-color: var(--orange); transform: translateY(-1px); }
.certs-note {
  margin-top: 44px; background: var(--grad); border-radius: var(--radius);
  padding: 30px 34px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; box-shadow: var(--shadow-lg);
}
.certs-note strong { font-size: 19px; color: #fff; }
.certs-note p { color: rgba(255, 255, 255, .85); font-size: 15px; }
.certs-note .btn { background: #fff; color: var(--accent); box-shadow: none; }
.certs-note .btn:hover { transform: translateY(-2px); color: var(--accent-dark); }

/* ---------- Articles ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: .18s;
  display: flex; flex-direction: column; border-top: 4px solid var(--cyan);
}
.post-card:nth-child(2) { border-top-color: var(--violet); }
.post-card:nth-child(3) { border-top-color: var(--emerald); }
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.post-date { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.post-card h3 { font-size: 18px; line-height: 1.4; margin-bottom: 10px; letter-spacing: -.01em; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { color: var(--muted); font-size: 14.5px; flex: 1; }
.post-more { margin-top: 14px; font-weight: 600; font-size: 14.5px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }
.contact-list { list-style: none; }
.contact-list li { display: flex; gap: 16px; margin-bottom: 22px; align-items: flex-start; }
.contact-ico { width: 46px; height: 46px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.contact-list li:nth-child(1) .contact-ico { background: var(--accent-soft); }
.contact-list li:nth-child(1) .contact-ico svg { fill: var(--accent); }
.contact-list li:nth-child(2) .contact-ico { background: #e2f6ee; }
.contact-list li:nth-child(2) .contact-ico svg { fill: var(--emerald); }
.contact-list li:nth-child(3) .contact-ico { background: #fdeaef; }
.contact-list li:nth-child(3) .contact-ico svg { fill: var(--rose); }
.contact-ico svg { width: 20px; height: 20px; }
.contact-list .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.contact-list .val { font-weight: 500; }
.contact-list .val a { color: var(--text); }
.contact-list .val a:hover { color: var(--accent); }

/* Contact Form 7 */
.contact-form .wpcf7-form label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 18px; }
.contact-form .wpcf7-form input[type="text"],
.contact-form .wpcf7-form input[type="email"],
.contact-form .wpcf7-form input[type="tel"],
.contact-form .wpcf7-form textarea {
  width: 100%; margin-top: 7px; padding: 13px 15px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 15.5px; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.contact-form .wpcf7-form input:focus,
.contact-form .wpcf7-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.contact-form .wpcf7-form textarea { min-height: 150px; resize: vertical; }
.contact-form .wpcf7-form input[type="submit"],
.contact-form .wpcf7-form button[type="submit"] {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--grad); color: #fff; border: 0; border-radius: 10px;
  padding: 14px 34px; font-family: inherit; font-weight: 600; font-size: 15.5px;
  line-height: 1.4; letter-spacing: .01em; cursor: pointer; transition: .15s;
  box-shadow: 0 4px 14px rgba(190, 90, 90, .35);
}
.contact-form .wpcf7-form input[type="submit"]:hover,
.contact-form .wpcf7-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(190, 90, 90, .45);
}
.contact-form .wpcf7-form button[type="submit"] .arrow::before { content: "\2192"; font-size: 17px; line-height: 1; }
.contact-form .wpcf7-form button[type="submit"]:hover .arrow::before { transform: translateX(2px); }
.contact-form .wpcf7-form button[type="submit"] .arrow { display: inline-flex; transition: .15s; }
.contact-form .wpcf7-spinner { margin-left: 12px; }
.wpcf7-not-valid-tip { color: #c0392b; font-size: 13.5px; margin-top: 4px; }
.wpcf7-response-output { border-radius: 10px !important; padding: 12px 16px !important; margin: 18px 0 0 !important; }

/* ---------- Blog (single / archive) ---------- */
.entry { max-width: 760px; margin: 0 auto; padding: 72px 24px; }
.entry-header { margin-bottom: 36px; }
.entry-header h1 { font-size: 38px; letter-spacing: -.02em; line-height: 1.2; margin: 8px 0 12px; }
.entry-meta { color: var(--muted); font-size: 15px; }
.entry-content h2 { font-size: 26px; margin: 40px 0 14px; letter-spacing: -.01em; }
.entry-content h3 { font-size: 21px; margin: 32px 0 12px; }
.entry-content p { margin-bottom: 18px; }
.entry-content ul, .entry-content ol { margin: 0 0 18px 26px; }
.entry-content li { margin-bottom: 6px; }
.entry-content img { border-radius: var(--radius); margin: 24px 0; }
.entry-content pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 20px; overflow-x: auto; font-size: 14px; margin-bottom: 18px; }
.entry-content code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.entry-content blockquote { border-left: 3px solid var(--accent); padding-left: 20px; color: var(--muted); margin-bottom: 18px; }
.back-link { display: inline-block; margin-bottom: 24px; font-weight: 600; font-size: 15px; }

.archive-list { max-width: 760px; margin: 0 auto; padding: 72px 24px; }
.archive-list > h1 { font-size: 34px; margin-bottom: 40px; letter-spacing: -.02em; }
.archive-item { border-bottom: 1px solid var(--border); padding: 28px 0; }
.archive-item h2 { font-size: 22px; letter-spacing: -.01em; margin: 4px 0 8px; }
.archive-item h2 a { color: var(--text); }
.archive-item h2 a:hover { color: var(--accent); }
.archive-item p { color: var(--muted); font-size: 15.5px; }

/* ---------- Footer ---------- */
.site-footer { background: #131a33; color: #9aa5c4; padding: 44px 0; border-top: 4px solid; border-image: var(--grad) 1; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.site-footer .socials a { border-color: #2c3557; color: #9aa5c4; background: transparent; }
.site-footer .socials a:hover { border-color: #fff; color: #fff; }
.footer-note { font-size: 14.5px; }
.footer-note a { color: #cbd5e1; }

/* ---------- Brand-colored social icons ---------- */
.socials a:nth-child(1) { color: #0a66c2; border-color: #b9d7f1; background: #eaf3fb; } /* LinkedIn */
.socials a:nth-child(2) { color: #24292f; border-color: #d3d9df; background: #f2f4f6; } /* GitHub */
.socials a:nth-child(3) { color: #ff6b00; border-color: #ffd2b0; background: #fff2e7; } /* Credly */
.socials a:nth-child(4) { color: #ea4335; border-color: #f6c5c0; background: #fdedeb; } /* Email */
.socials a:nth-child(1):hover { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.socials a:nth-child(2):hover { background: #24292f; border-color: #24292f; color: #fff; }
.socials a:nth-child(3):hover { background: #ff6b00; border-color: #ff6b00; color: #fff; }
.socials a:nth-child(4):hover { background: #ea4335; border-color: #ea4335; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero h1 { font-size: 38px; }
  .hero-grid { flex-direction: column; text-align: center; align-items: center; gap: 36px; }
  .hero-tagline { margin-inline: auto; }
  .hero-meta, .hero-actions { justify-content: center; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .projects, .posts { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .nav-cta { display: none; }
  .nav-bar { grid-template-columns: 1fr auto; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0; }
  .hero h1 { font-size: 32px; }
  .cards, .projects, .posts, .skill-groups, .edu-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--border);
    padding: 8px 0; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 12px 24px; }
  .nav-links a::after { display: none; }
}
