:root {
  color-scheme: light;
  --ink: #102027;
  --muted: #667085;
  --paper: #f6f1e7;
  --panel: #fffdf7;
  --line: #d8d0c1;
  --teal: #177e89;
  --coral: #d95d39;
  --green: #588157;
  --yellow: #f2c14e;
  --blue: #2d6cdf;
  --shadow: 0 22px 70px rgba(16, 32, 39, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(217, 93, 57, 0.08) 0 20%, transparent 20% 100%),
    linear-gradient(90deg, rgba(16, 32, 39, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 32, 39, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  color: var(--ink);
  font-family:
    Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.7;
}

body[dir="rtl"] {
  font-family:
    "Segoe UI", Tahoma, Arial, sans-serif;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(16, 24, 32, 0.1);
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
.main-nav,
.hero-actions,
.contact-actions,
.filters,
.project-meta,
.ticker,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(242, 193, 78, 0.36) 48% 100%),
    var(--ink);
  color: var(--yellow);
  font-weight: 900;
}

.main-nav {
  gap: clamp(10px, 2vw, 24px);
  color: var(--muted);
  font-size: 0.95rem;
}

.main-nav a:hover,
.text-link:hover,
.project-card a:hover {
  color: var(--coral);
}

.lang-toggle,
.filter,
.button {
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.lang-toggle {
  min-width: 48px;
  height: 40px;
  background: var(--panel);
}

.section {
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
  padding-block: clamp(54px, 8vw, 96px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 92px);
}

.hero::after {
  content: "</>";
  position: absolute;
  inset-inline-end: 0;
  bottom: 34px;
  z-index: -1;
  color: rgba(16, 32, 39, 0.07);
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(5rem, 18vw, 14rem);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 24px;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.98;
}

h2 {
  max-width: 13ch;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.hero-lede {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions,
.contact-actions,
.filters {
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding-inline: 18px;
}

.button.primary {
  background: var(--ink);
  color: #ffffff;
}

.button.secondary,
.filter,
.lang-toggle {
  background: var(--panel);
  color: var(--ink);
}

.button:hover,
.filter:hover,
.lang-toggle:hover {
  transform: translateY(-1px);
}

.profile-panel {
  position: relative;
  display: grid;
  gap: 20px;
  padding: clamp(20px, 4vw, 34px);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-panel::before {
  content: "github://waseeld";
  position: absolute;
  inset-inline-end: 22px;
  bottom: -14px;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 900;
}

.panel-topline {
  display: flex;
  gap: 7px;
}

.panel-topline span {
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.panel-topline span:nth-child(1) {
  background: var(--coral);
}

.panel-topline span:nth-child(2) {
  background: var(--yellow);
}

.panel-topline span:nth-child(3) {
  background: var(--green);
}

.avatar {
  width: min(220px, 58vw);
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 8px;
  object-fit: cover;
}

.profile-name {
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 900;
}

.profile-bio {
  margin-bottom: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.stats-grid div,
.service-list article,
.project-card,
.blog-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stats-grid div {
  padding: 12px 0;
  border-width: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.stats-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.stats-grid dd {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
}

.terminal-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
}

.terminal-card span {
  color: var(--yellow);
}

.terminal-card strong {
  color: #ffffff;
  font-size: 0.95rem;
}

.ticker {
  width: 100%;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 18px;
  border-block: 1px solid rgba(16, 24, 32, 0.12);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 8px, transparent 8px 18px),
    var(--ink);
  color: #ffffff;
}

.ticker span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #f7f7f2;
}

.intro,
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1.15fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}

.lab-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 0;
}

.lab-card {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lab-card:nth-child(1) {
  border-top: 7px solid var(--blue);
}

.lab-card:nth-child(2) {
  border-top: 7px solid var(--coral);
}

.lab-card:nth-child(3) {
  border-top: 7px solid var(--green);
}

.lab-number {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}

.intro > p,
.contact > div:last-child {
  color: var(--muted);
  font-size: 1.12rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.filter {
  min-height: 38px;
  padding-inline: 14px;
  color: var(--muted);
}

.filter.active {
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
}

.project-grid,
.service-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.service-list article,
.blog-preview {
  padding: 22px;
}

.project-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--teal), var(--coral), var(--yellow));
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(16, 32, 39, 0.45);
  box-shadow: 0 18px 40px rgba(16, 32, 39, 0.12);
}

.featured-project {
  grid-column: span 2;
  min-height: 280px;
  background:
    linear-gradient(135deg, rgba(23, 126, 137, 0.12), transparent 52%),
    var(--panel);
}

.project-meta {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.82rem;
}

.project-card p,
.service-list p,
.blog-preview p {
  color: var(--muted);
}

.project-card a {
  margin-top: auto;
  color: var(--teal);
  font-weight: 900;
}

.service-list article:nth-child(1) {
  border-top: 5px solid var(--teal);
}

.service-list article:nth-child(2) {
  border-top: 5px solid var(--coral);
}

.service-list article:nth-child(3) {
  border-top: 5px solid var(--green);
}

.blog-preview {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: center;
  border-inline-start: 8px solid var(--yellow);
}

.series-preview {
  align-items: start;
}

.blog-preview + .blog-preview {
  margin-top: 16px;
}

.notes-preview {
  border-inline-start-color: var(--teal);
}

.series-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.series-list a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
}

.series-list a:hover {
  color: var(--coral);
  border-color: rgba(16, 32, 39, 0.34);
}

.date,
.text-link {
  color: var(--teal);
  font-weight: 900;
}

.site-footer {
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
  padding-block: 26px 38px;
  color: var(--muted);
}

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

  .hero,
  .intro,
  .contact,
  .blog-preview {
    grid-template-columns: 1fr;
  }

  .lab-strip {
    grid-template-columns: 1fr;
  }

  h1,
  h2 {
    max-width: 100%;
  }

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

  .featured-project {
    grid-column: span 1;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .project-grid,
  .service-list,
  .lab-strip,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: 2.75rem;
  }
}
