/* abdulrahman.ly — colours and type follow the CV. */

:root {
  --bg: #ffffff;
  --text: #16181c;
  --text-2: #3b4148;
  --muted: #5a6068;
  --rule: #e4e7ea;
  --accent: #0f6e66;
  --accent-hover: #0b5852;
  --on-accent: #ffffff;
  --tint: #eaf3f1;
  --tint-edge: #d6e8e5;
  --bezel: #16181c;
  --bezel-ring: transparent;
  --screen: #ffffff;
  --shadow: rgba(15, 110, 102, 0.28);

  --font-head: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 20px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181c;
    --text: #eceef0;
    --text-2: #c9ced3;
    --muted: #9ca3ab;
    --rule: #2b3036;
    --accent: #5bbfb4;
    --accent-hover: #7fd0c6;
    --on-accent: #16181c;
    --tint: #1c2a28;
    --tint-edge: #24403c;
    --bezel: #050607;
    --bezel-ring: rgba(255, 255, 255, 0.12);
    --screen: #22262c;
    --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #16181c;
  --text: #eceef0;
  --text-2: #c9ced3;
  --muted: #9ca3ab;
  --rule: #2b3036;
  --accent: #5bbfb4;
  --accent-hover: #7fd0c6;
  --on-accent: #16181c;
  --tint: #1c2a28;
  --tint-edge: #24403c;
  --bezel: #050607;
  --bezel-ring: rgba(255, 255, 255, 0.12);
  --screen: #22262c;
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

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

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

strong {
  font-weight: 600;
  color: var(--text);
}

svg {
  flex: none;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 30px;
  height: 30px;
}

.nav ul {
  display: flex;
  gap: 2px;
  list-style: none;
}

.nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

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

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--muted);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun,
:root[data-theme-current="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme-current="dark"] .theme-toggle .icon-sun {
  display: block;
}

@media (max-width: 719px) {
  .nav {
    display: none;
  }
}

/* Icons inside text */

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero */

.hero {
  padding-block: clamp(56px, 10vw, 128px) clamp(64px, 9vw, 112px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left center;
}

.hero h1 {
  margin-top: 20px;
  font-weight: 700;
  font-size: clamp(2.5rem, 1.25rem + 6.2vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.about {
  max-width: 62ch;
  margin-top: 28px;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  border-color: var(--rule);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--text);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 36px;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.meta-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meta-row .icon {
  width: 16px;
  height: 16px;
}

.meta-row a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.meta-row a:hover {
  text-decoration: underline;
}

/* Sections */

.section {
  padding-block: clamp(64px, 9vw, 112px);
  border-top: 1px solid var(--rule);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.section-title {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  letter-spacing: -0.03em;
}

/* Projects */

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 36px);
  list-style: none;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-media {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding-top: 11%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--tint-edge);
}

.device {
  position: relative;
  flex: none;
  width: 56%;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border: 7px solid var(--bezel);
  border-radius: 15% / 7%;
  background: var(--screen);
  box-shadow: 0 0 0 1px var(--bezel-ring), 0 28px 48px -20px var(--shadow);
}

.device-island {
  position: absolute;
  top: 2.6%;
  left: 50%;
  z-index: 2;
  width: 30%;
  height: 3.4%;
  border-radius: 999px;
  background: var(--bezel);
  transform: translateX(-50%);
}

.device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Sits in the middle of the part of the screen that shows above the panel edge. */
.splash {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 66% 12px 12px;
  text-align: center;
}

.splash-name {
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(0.9375rem, 0.6rem + 0.9vw, 1.375rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.splash-domain {
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.01em;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding-top: 20px;
}

.project h3 {
  font-size: 1.25rem;
}

.project h3 a {
  color: var(--text);
  text-decoration: none;
}

.project h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: var(--radius);
}

.project h3 a:focus-visible {
  outline: none;
}

.project h3 a:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.project:hover h3 a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.project-summary {
  color: var(--text-2);
}

.project-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
}

.project-domain .icon {
  width: 15px;
  height: 15px;
}

.projects-note {
  max-width: 62ch;
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

@media (max-width: 759px) {
  .projects {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .project-media {
    aspect-ratio: 5 / 4;
    padding-top: 9%;
  }

  .device {
    width: 42%;
  }

  .splash-name {
    font-size: 1.25rem;
  }
}

/* Experience + sidebar */

.resume {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(40px, 6vw, 88px);
}

.jobs {
  list-style: none;
}

.job + .job {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.job-head,
.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
}

.job-head h3 {
  font-size: 1.25rem;
}

.job-detail {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.period {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-org {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.roles {
  margin-top: 18px;
  padding-left: 20px;
  border-left: 2px solid var(--rule);
  list-style: none;
}

.role + .role {
  margin-top: 24px;
}

.role h4 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
}

.points {
  margin-top: 10px;
  padding-left: 1.15em;
  list-style-type: disc;
  color: var(--text-2);
}

.points li + li {
  margin-top: 6px;
}

.points li::marker {
  color: var(--accent);
}

.aside {
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding-left: clamp(24px, 3vw, 40px);
  border-left: 1px solid var(--rule);
}

.aside-title {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

.skills div + div,
.awards li + li {
  margin-top: 14px;
}

.skills dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.skills dd {
  margin-top: 2px;
}

.skill,
.nowrap {
  white-space: nowrap;
}

.edu-degree,
.award-title {
  font-weight: 600;
}

.award-title a {
  font-weight: 600;
  text-decoration: none;
}

.award-title a:hover {
  text-decoration: underline;
}

.award-title .icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -0.1em;
}

.edu-school,
.award-detail {
  color: var(--muted);
  font-size: 0.9375rem;
}

.awards {
  list-style: none;
}

.langs div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
  border-bottom: 1px solid var(--rule);
}

.langs div:first-child {
  padding-top: 0;
}

.langs div:last-child {
  border-bottom: 0;
}

.langs dd {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 899px) {
  .resume {
    grid-template-columns: minmax(0, 1fr);
  }

  .aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 44px 40px;
    padding-top: 48px;
    padding-left: 0;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }
}

@media (max-width: 559px) {
  .aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-head,
  .role-head {
    flex-direction: column;
  }
}

/* Contact */

.contact-email {
  display: inline-block;
  max-width: 100%;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.375rem, 0.9rem + 3vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.contact-email:hover {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  list-style: none;
}

/* Footer */

.site-footer {
  padding-block: 28px 36px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* No-JS fallback */

.nojs {
  padding-block: 64px;
}

.nojs h1 {
  font-size: 2.5rem;
}

.nojs p {
  margin-top: 12px;
}

/* 404 */

.notfound {
  display: grid;
  min-height: 70vh;
  align-content: center;
  padding-block: 80px;
}

.notfound h1 {
  margin-top: 20px;
  font-weight: 700;
  font-size: clamp(2.25rem, 1.5rem + 4vw, 3.75rem);
  letter-spacing: -0.04em;
}

.notfound p {
  max-width: 48ch;
  margin-top: 16px;
  color: var(--text-2);
}

/* The one moment of motion: the hero settles in on load. */

@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow::before {
    animation: draw 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-inner > * {
    animation: settle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-inner > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero-inner > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .hero-inner > :nth-child(n + 4) {
    animation-delay: 0.18s;
  }
}

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

@keyframes draw {
  from {
    transform: scaleX(0);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
