/* =========================================================
   Sondos Marshdeh - portfolio stylesheet
   Design system: neutral slate surfaces, hairline borders,
   one accent colour, restrained motion.
   ========================================================= */

:root {
  /* Surfaces + text */
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --text: #101828;
  --text-soft: #475467;
  --text-faint: #667085;

  /* Lines */
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  /* Accent */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff4ff;

  /* Chrome */
  --header-bg: rgba(255, 255, 255, 0.82);
  --focus-ring: rgba(37, 99, 235, 0.35);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Shape + depth */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md:
    0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 28px -18px rgba(16, 24, 40, 0.18);

  --container: 1080px;
  --section-y: 5.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e14;
    --bg-alt: #0f131b;
    --surface: #111622;
    --surface-alt: #141a25;
    --text: #e9edf5;
    --text-soft: #a3aebf;
    --text-faint: #8a94a6;

    --border: #222a38;
    --border-strong: #2e3847;

    --accent: #82a6ff;
    --accent-strong: #a8c1ff;
    --accent-soft: rgba(130, 166, 255, 0.12);

    --header-bg: rgba(11, 14, 20, 0.8);
    --focus-ring: rgba(130, 166, 255, 0.4);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px -20px rgba(0, 0, 0, 0.7);
  }
}

/* ---------------------------------------------------------
   Base
   --------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: var(--text);
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  letter-spacing: -0.032em;
}

h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
}

h3 {
  font-size: 1.09rem;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: min(var(--container), calc(100% - 2.5rem));
  margin-inline: auto;
}

.section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--border);
}

.section-alt {
  background: var(--bg-alt);
}

/* ---------------------------------------------------------
   Header + navigation
   --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.nav-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--text);
}

.logo-text {
  display: grid;
  line-height: 1.25;
}

.logo-name {
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo-role {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.main-nav a {
  position: relative;
  padding: 0.4rem 0.68rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.18s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0.68rem;
  right: 0.68rem;
  bottom: 0.05rem;
  height: 1.5px;
  border-radius: var(--radius-pill);
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: center;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.main-nav a:hover {
  color: var(--text);
}

.main-nav a.active {
  color: var(--text);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* ---------------------------------------------------------
   Buttons + small type utilities
   --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.68rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.btn-primary {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.btn-primary:hover {
  background: #1d2939;
  border-color: #1d2939;
}

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  border-color: var(--text-faint);
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.lead {
  font-size: 1.02rem;
  color: var(--text-soft);
  max-width: 60ch;
  padding-top: 1rem;
}

/* Tag pills (hero keywords, tech stacks, project meta) */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag,
.project-meta span {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.62rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-soft);
  font-family: var(--font-mono);
  margin-top: 0.5rem;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
  padding: 7rem 0 var(--section-y);
  border-top: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.hero-copy > * + * {
  margin-top: 1.1rem;
}

/* Desktop lead-in above the name; scaled down in the media queries below. */
.hero-copy h1 {
  margin-top: 3rem;
}

.hero-title-role {
  display: block;
  margin-top: 0.5rem;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.hero-keywords {
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.hero-keywords .tag-row {
  margin-top: 0.75rem;
}

.hero-panel {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 96px;
}

.profile-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Full frame, no crop: the photo keeps its own aspect ratio. */
.profile-card img {
  width: 100%;
  height: auto;
}

.profile-facts {
  margin: 0;
  display: grid;
}

.profile-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.44rem 0.9rem;
  border-top: 1px solid var(--border);
}

.profile-facts dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.profile-facts dd {
  margin: 0;
  font-size: 0.79rem;
  font-weight: 550;
  color: var(--text);
  text-align: right;
}

.social-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.social-row a {
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.social-row a:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-alt);
}

/* ---------------------------------------------------------
   Section headings
   --------------------------------------------------------- */

.section-head {
  max-width: 68ch;
  margin-bottom: 2.4rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.section-label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--border-strong);
}

.section-head h2 {
  margin-top: 0.7rem;
}

.section-desc {
  margin-top: 0.7rem;
  color: var(--text-soft);
  max-width: 62ch;
}

/* ---------------------------------------------------------
   Cards + grids
   --------------------------------------------------------- */

.grid-2,
.grid-3 {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card h3 {
  margin-bottom: 0.9rem;
}

/* Bulleted lists inside cards */

.list-marked {
  display: grid;
  gap: 0.6rem;
}

.list-marked li {
  position: relative;
  padding-left: 1.05rem;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

.list-marked li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.list-marked li strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Experience timeline
   --------------------------------------------------------- */

.timeline {
  border-left: 1px solid var(--border);
  padding-left: clamp(1.3rem, 3vw, 2.2rem);
  display: grid;
  gap: 2.6rem;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(clamp(1.3rem, 3vw, 2.2rem) * -1 - 4.5px);
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.section-alt .timeline-item::before {
  box-shadow: 0 0 0 4px var(--bg-alt);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
}

.timeline-role {
  font-size: 1.14rem;
}

.timeline-when {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.timeline-org {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
}

.timeline-org a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.timeline-org a:hover {
  border-bottom-color: currentColor;
}

.timeline-summary {
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  max-width: 72ch;
}

.timeline-points {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
  max-width: 78ch;
}

.timeline-points li {
  position: relative;
  padding-left: 1.05rem;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.62;
}

.timeline-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.64em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.timeline-item .tag-row {
  margin-top: 1.1rem;
}

/* ---------------------------------------------------------
   Projects
   --------------------------------------------------------- */

.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-item {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.45rem;
  transition: border-color 0.2s ease;
}

.project-item:hover {
  border-color: var(--border-strong);
}

.project-item h3 {
  font-size: 1.04rem;
}

.project-item p {
  color: var(--text-soft);
  font-size: 0.94rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: auto;
  padding-top: 0.55rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.project-links a::after {
  content: "↗";
  font-size: 0.78em;
  opacity: 0.75;
}

.project-links a:hover {
  border-bottom-color: currentColor;
}

.project-status {
  align-self: flex-start;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   Contact
   --------------------------------------------------------- */

.contact-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: center;
}

.contact-copy h2 {
  margin-top: 0.7rem;
}

.contact-copy p {
  margin-top: 0.8rem;
  color: var(--text-soft);
  max-width: 46ch;
}

.contact-copy .btn {
  margin-top: 1.4rem;
}

.contact-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.contact-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  transition: background-color 0.18s ease;
}

.contact-item + .contact-item {
  border-top: 1px solid var(--border);
}

a.contact-item:hover {
  background: var(--surface-alt);
}

.contact-item span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.contact-item strong {
  font-size: 0.93rem;
  font-weight: 550;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
}

.footer-row p {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-soft);
  transition: color 0.18s ease;
}

.footer-nav a:hover {
  color: var(--text);
}

/* ---------------------------------------------------------
   Sub pages (project detail listings)
   --------------------------------------------------------- */

.sub-hero {
  padding: clamp(2.6rem, 6vw, 4rem) 0 0;
}

.sub-hero h1 {
  margin-top: 0.7rem;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

.sub-hero p {
  margin-top: 0.9rem;
  color: var(--text-soft);
  max-width: 68ch;
}

.sub-hero + .section {
  border-top: 0;
  padding-top: 2.6rem;
}

.divider-title {
  grid-column: 1 / -1;
  margin: 1.8rem 0 0.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
  font-size: 1.3rem;
}

/* ---------------------------------------------------------
   Reveal on scroll
   --------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.revealed {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 980px) {
  :root {
    --section-y: 4rem;
  }

  /* The desktop hero lead-in is too tall for a phone screen. */
  .hero {
    padding-top: 3.5rem;
  }

  .hero-copy h1 {
    margin-top: 1.5rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-panel {
    position: static;
    grid-template-columns: minmax(0, 320px);
  }

  .grid-3,
  .grid-2,
  .project-grid,
  .contact-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-panel {
    align-items: start;
  }
}

@media (max-width: 820px) {
  .nav-row {
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    padding: 0.7rem 0;
  }

  /* Wrap rather than scroll sideways: every link stays reachable
     without a hidden-overflow affordance. */
  .main-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.1rem 0.15rem;
    margin-left: -0.68rem;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .container {
    width: min(var(--container), calc(100% - 1.6rem));
  }

  .hero {
    padding-top: 1.75rem;
  }

  .hero-copy h1 {
    margin-top: 0.25rem;
  }

  .card,
  .project-item {
    padding: 1.2rem;
  }

  .timeline-when {
    white-space: normal;
  }

  .social-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------
   Print (recruiters do print portfolios)
   --------------------------------------------------------- */

@media print {
  .site-header,
  .social-row,
  .hero-actions,
  .footer-nav {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .section {
    padding: 1.2rem 0;
    break-inside: avoid;
  }

  .card,
  .project-item,
  .contact-panel {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
