/* ==========================================================
   Sadi Abdullah — personal site
   Typographic, photo-less identity. Warm neutral palette,
   one accent color, a serif for headings, system sans for body.
   Layout: fixed identity/nav pane + wide scrolling content pane.
   ========================================================== */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/fraunces-variable.woff2?v=20261101') format('woff2');
}

:root {
  --ink: #201d19;
  --ink-soft: #55504a;
  --ink-faint: #716b5a;
  --paper: #faf8f4;
  --paper-alt: #f1ece3;
  --line: #e4ddd1;
  --accent: #a84a28;
  --accent-soft: #f1ded2;
  --accent-on-tint: #8f3b1c; /* darker than --accent: keeps WCAG AA (4.5:1) when used as text on --accent-soft */

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --sidebar-w: 340px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(2.5rem, 6vw, 4rem);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece7df;
    --ink-soft: #c3bcb0;
    --ink-faint: #8e8779;
    --paper: #16140f;
    --paper-alt: #1d1a14;
    --line: #322d24;
    --accent: #e08a5e;
    --accent-soft: #352418;
    --accent-on-tint: #e08a5e;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
}
p:last-child { margin-bottom: 0; }
/* Left-aligned body text keeps a ragged right edge by design: justified
   text at this column width creates uneven word gaps, which reads worse
   than a natural rag. hyphens: auto lets long words break across the line
   end instead of jumping whole to the next line, which tightens the rag
   without justification's gap problem; text-wrap: pretty (where supported)
   additionally avoids a short orphan word stranding on the last line. */

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 4px;
  z-index: 100; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Two-pane layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ---------- Sidebar (identity + nav, sticky on desktop) ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2.25rem, 6vh, 3.5rem) var(--gutter) clamp(1.5rem, 4vh, 2.5rem) var(--gutter);
}

h1.wordmark {
  font-size: 1.7rem;
  margin: 0 0 0.35rem;
}
.wordmark a {
  color: var(--ink);
  text-decoration: none;
}
.sidebar-role {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-on-tint);
  background: var(--accent-soft);
  border-radius: 99px;
  padding: 0.32rem 0.8rem;
  margin-bottom: 1.3rem;
}
.hero-badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-on-tint);
  display: inline-block;
}

.sidebar-lede {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.92rem;
}
.sidebar-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding-left: 1.2rem;
  transition: color 0.2s var(--ease);
}
.sidebar-nav a::before {
  content: "";
  position: absolute; left: 0; top: 0.5em;
  width: 0.7rem; height: 1px;
  background: var(--ink-faint);
  transition: width 0.2s var(--ease), background 0.2s var(--ease);
}
.sidebar-nav a:hover,
.sidebar-nav a.active { color: var(--ink); }
.sidebar-nav a.active::before {
  width: 1.4rem;
  background: var(--accent);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.86rem;
}
.sidebar-bottom a {
  color: var(--ink-soft);
  text-decoration: none;
}
.sidebar-bottom a:hover { color: var(--accent); }

.sidebar-contact-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-copy-btn {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  line-height: 1.2;
}
.sidebar-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Toast feedback for 1-tap copy email */
.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
  z-index: 1000;
}
.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Content pane ---------- */
.content {
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) 2rem;
  max-width: 760px;
}

section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
section:first-of-type { padding-top: 0; border-top: none; }

.section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}

section h2 {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline {
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Experience ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.9rem;
}
.timeline-entry {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 1.25rem;
}
.timeline-dates {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding-top: 0.2rem;
  white-space: nowrap;
}
.timeline-role { font-size: 1.05rem; margin-bottom: 0.15rem; }
.timeline-org {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.timeline-desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.earlier-career {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--line);
}
.earlier-career h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}
.earlier-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.earlier-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.earlier-list .role-org strong { color: var(--ink); font-weight: 600; }
.earlier-list .dates { color: var(--ink-faint); white-space: nowrap; }

/* ---------- Projects ---------- */
.project {
  padding: 2rem 0;
}
.project + .project { border-top: 1px dashed var(--line); }
.project:first-child { padding-top: 0; }
.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.project h3 { margin-bottom: 0; font-size: 1.3rem; }
.project-place {
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 1.1rem 0;
  padding: 0.85rem 1rem;
  background: var(--paper-alt);
  border-radius: 8px;
  font-size: 0.88rem;
}
.project-stats strong {
  color: var(--ink);
  font-weight: 700;
}
.project-stack {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 0.75rem;
}

/* ---------- Skills ---------- */
.skills-group { margin-bottom: 1.75rem; }
.skills-group:last-child { margin-bottom: 0; }
.skills-group h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.skill-tag {
  font-size: 0.88rem;
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
}
.skill-tag.core {
  background: var(--ink);
  color: var(--paper);
}
.skill-tag.familiar {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ---------- Education ---------- */
.edu-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.edu-list li strong { display: block; color: var(--ink); }
.edu-list li span { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.content-footer {
  padding: 2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* ---------- Responsive: collapse to a single stacked column ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem var(--gutter) 2.25rem;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
  .sidebar-nav a::before { display: none; }
  .sidebar-bottom { flex-direction: row; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
  .content { max-width: none; }
}

@media (max-width: 560px) {
  .timeline-entry { grid-template-columns: 1fr; gap: 0.3rem; }
  .earlier-list li { flex-direction: column; gap: 0.1rem; }
  .project-head { flex-direction: column; align-items: flex-start; }
}
