/* ==========================================
   Ali Al Juffali - Personal Site
   Modern. Warm. Refined.
   ========================================== */

:root {
  --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --bg: #FEFCFA;
  --bg-card: #FFFFFF;
  --bg-alt: #F7F4F0;
  --bg-gradient: linear-gradient(135deg, #FEFCFA 0%, #F7F4F0 100%);

  --text: #2D2418;
  --text-secondary: #6B5D4D;
  --text-muted: #9C8E7E;

  --accent: #C4703E;
  --accent-light: #F0DFD0;
  --accent-hover: #A85C2F;

  --border: #EDE8E1;
  --border-light: #F4F0EB;

  --shadow-sm: 0 1px 3px rgba(45, 36, 24, 0.06), 0 1px 2px rgba(45, 36, 24, 0.04);
  --shadow-md: 0 4px 12px rgba(45, 36, 24, 0.08), 0 2px 4px rgba(45, 36, 24, 0.04);
  --shadow-lg: 0 12px 32px rgba(45, 36, 24, 0.10), 0 4px 8px rgba(45, 36, 24, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --max-width: 720px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.75; padding: 0 var(--space-md); min-height: 100vh; }
.container { max-width: var(--max-width); margin: 0 auto; }

header { padding: var(--space-lg) 0 var(--space-md); margin-bottom: var(--space-lg); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-sm); }
.site-name { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.03em; transition: color 0.2s ease; }
.site-name:hover { color: var(--accent); }
nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
nav a { font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); text-decoration: none; padding: 0.4rem 0.85rem; border-radius: var(--radius-sm); transition: all 0.2s ease; cursor: pointer; }
nav a:hover { color: var(--text); background: var(--bg-alt); }
nav a.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; color: var(--text); }
h1 { font-size: 2rem; margin-bottom: var(--space-md); }
h2 { font-size: 1.3rem; margin-top: var(--space-lg); margin-bottom: var(--space-sm); }
h3 { font-size: 1.1rem; margin-top: var(--space-md); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }
strong { font-weight: 700; color: var(--text); }

blockquote { border-left: 3px solid var(--accent); padding: var(--space-sm) var(--space-md); background: var(--bg-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-secondary); margin: var(--space-md) 0; font-style: italic; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-alt); padding: 0.2em 0.5em; border-radius: 5px; color: var(--accent); }
pre { background: var(--bg-alt); padding: var(--space-md); border-radius: var(--radius-md); overflow-x: auto; margin: var(--space-md) 0; border: 1px solid var(--border); }
pre code { background: none; padding: 0; font-size: 0.82rem; line-height: 1.6; color: var(--text); }
hr { border: none; border-top: 1px solid var(--border); margin: var(--space-lg) 0; }
img { max-width: 100%; border-radius: var(--radius-md); }

/* Home */
.intro { margin-bottom: var(--space-xl); padding: var(--space-lg); background: var(--bg-gradient); border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.intro h1 { font-size: 2.2rem; margin-bottom: var(--space-xs); }
.intro .subtitle { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; max-width: 580px; }
.section-label { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--space-sm); }

/* Blog list */
.post-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); }
.post-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); transition: all 0.25s ease; text-decoration: none; display: block; }
.post-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.post-card-with-image { display: grid; grid-template-columns: 1fr 180px; gap: var(--space-md); align-items: center; }
.post-card-image { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm); }
.post-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.35rem; }
.post-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.35; letter-spacing: -0.02em; }
.post-card:hover .post-title { color: var(--accent); }
.post-summary { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.6; }

/* Blog post */
.post-header { margin-bottom: var(--space-lg); }
.post-header .post-date { margin-bottom: var(--space-xs); }
.post-header h1 { font-size: 2.2rem; line-height: 1.2; max-width: 640px; }
.hero-image { width: 100%; height: auto; max-height: 400px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: var(--space-lg); box-shadow: var(--shadow-md); }
.post-content { line-height: 1.85; }
.post-content p { margin-bottom: 1.5rem; font-size: 1.02rem; }
.post-content h2 { margin-top: 2.5rem; color: var(--text); }
.post-content img { margin: var(--space-md) 0; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.post-content figure { margin: var(--space-md) 0; }
.post-content figcaption { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-top: var(--space-xs); font-style: italic; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-sm); }
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); transition: all 0.25s ease; }
.project-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; color: var(--text); text-decoration: none; display: block; margin-bottom: 0.35rem; }
.project-card:hover .project-name { color: var(--accent); }
.project-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.project-tags { margin-top: var(--space-sm); display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tag { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; color: var(--accent); background: var(--accent-light); padding: 0.25em 0.7em; border-radius: 20px; }

/* CV */
.cv-section { margin-bottom: var(--space-lg); }
.cv-entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-sm); transition: box-shadow 0.2s ease; }
.cv-entry:hover { box-shadow: var(--shadow-sm); }
.cv-entry-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: var(--space-xs); }
.cv-role { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: var(--text); }
.cv-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); background: var(--bg-alt); padding: 0.2em 0.6em; border-radius: 20px; }
.cv-org { font-size: 0.9rem; color: var(--accent); font-weight: 500; margin-top: 0.15rem; }
.cv-desc { font-size: 0.9rem; margin-top: var(--space-xs); color: var(--text-secondary); line-height: 1.65; }

/* Footer */
footer { margin-top: var(--space-xl); padding: var(--space-md) 0; border-top: 1px solid var(--border); margin-bottom: var(--space-lg); text-align: center; }
footer p { font-size: 0.82rem; color: var(--text-muted); }
footer a { color: var(--text-muted); font-weight: 500; }
footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
  html { font-size: 16px; }
  header { padding-top: var(--space-md); flex-direction: column; align-items: flex-start; }
  h1 { font-size: 1.6rem; }
  .intro { padding: var(--space-md); }
  .intro h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.7rem; }
  .post-card-with-image { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .cv-entry-header { flex-direction: column; }
}
