/* Shamshad Khalil — personal portfolio */

:root {
  --bg: #0a0b0d;
  --bg-alt: #101216;
  --surface: #15171c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f1ea;
  --muted: #a8a59c;
  --gold: #e0b25a;
  --gold-dim: rgba(224, 178, 90, 0.14);
  --teal: #5ec8b6;
  --danger-safe: #f4f1ea;
  --radius: 16px;
  --wrap: 1120px;
  --header-h: 4.25rem;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", Times, serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

@font-face {
  font-family: "Instrument Serif";
  src: url("./assets/fonts/InstrumentSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("./assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("./assets/fonts/Outfit-Variable.woff2") format("woff2-variations"),
       url("./assets/fonts/Outfit-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #f0c97a;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  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: -4rem;
  z-index: 100;
  background: var(--gold);
  color: #16140f;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 0.75rem;
  color: #16140f;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 11, 13, 0.92);
}

.header-inner {
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

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

.logo-mark {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.logo-name {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.nav-toggle {
  display: none;
  cursor: pointer;
  padding: 0.45rem;
  margin-right: -0.45rem;
  border-radius: 8px;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 1.25rem;
  height: 0.85rem;
}

.nav-toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.35rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 450;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.nav-github {
  color: var(--gold) !important;
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.nav-github:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  padding: 4.5rem 0 5rem;
  overflow: hidden;
}

.hero-glow {
  pointer-events: none;
  position: absolute;
  inset: -10% -20% auto -20%;
  height: 28rem;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(224, 178, 90, 0.16), transparent 55%),
    radial-gradient(ellipse at 90% 40%, rgba(94, 200, 182, 0.1), transparent 50%);
  z-index: -1;
}

.hero-inner {
  max-width: 42rem;
  margin-left: max(1rem, calc((100% - var(--wrap)) / 2));
  margin-right: auto;
  width: min(42rem, calc(100% - 2rem));
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-role {
  margin: 1rem 0 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 400;
  color: var(--muted);
}

.hero-lede {
  margin: 1.35rem 0 0;
  color: #d2cfc6;
  max-width: 38rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: #16140f;
}

.btn-primary:hover {
  background: #f0c97a;
  color: #16140f;
}

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

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--gold);
  background: var(--gold-dim);
}

/* Sections */

.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

.section-head h2,
.contact-inner h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.85rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-lede {
  margin: 0.85rem 0 0;
  color: var(--muted);
}

/* Services */

.service-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem 1.4rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.service-card:hover {
  border-color: var(--border-strong);
  background: #191b21;
}

.service-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.service-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

.service-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 550;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Projects */

.project-list {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.project {
  display: grid;
  gap: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.project-media {
  background: #0e0f12;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
}

.project:hover .project-media img {
  transform: scale(1.025);
}

.project-body {
  padding: 0 1.25rem 1.4rem;
}

.project-meta h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.project-body > p {
  margin: 0.9rem 0 0;
  color: #d2cfc6;
}

.tech-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}

.tech-row li {
  font-size: 0.8rem;
  color: var(--teal);
  background: rgba(94, 200, 182, 0.08);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
}

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

.project-links a:hover {
  text-decoration: underline;
}

/* Covers for projects without screenshots */

.cover {
  aspect-ratio: 16 / 10;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.4rem 1.35rem;
  overflow: hidden;
}

.cover-kicker {
  margin: 0;
  position: relative;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.cover-title {
  margin: 0.2rem 0 0;
  position: relative;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
}

.cover-whale {
  color: var(--teal);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(224, 178, 90, 0.16), transparent 50%),
    linear-gradient(160deg, #12161c 0%, #0c1114 60%, #0a1416 100%);
}

.cover-chart {
  position: absolute;
  inset: 12% 0 28%;
  width: 100%;
  height: auto;
  color: var(--teal);
  opacity: 0.85;
}

.cover-erp {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(94, 200, 182, 0.12), transparent 50%),
    linear-gradient(160deg, #141217 0%, #121016 100%);
}

.cover-modules {
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.cover-modules li {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  text-align: center;
}

/* Skills */

.skill-groups {
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: 1fr;
}

.skill-group h3 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.skill-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-group li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.92rem;
}

/* Contact */

.section-contact {
  padding-bottom: 5.5rem;
}

.contact-inner {
  max-width: 38rem;
  margin-left: max(1rem, calc((100% - var(--wrap)) / 2));
  margin-right: auto;
  width: min(38rem, calc(100% - 2rem));
}

.contact-inner .btn {
  margin-top: 1.5rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.4rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

/* Responsive */

@media (min-width: 640px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .project-body {
    padding: 0 1.6rem 1.7rem;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 6.5rem 0 7rem;
  }

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

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

  .project {
    grid-template-columns: 1.15fr 1fr;
    align-items: stretch;
    gap: 0;
  }

  .project:nth-child(even) .project-media {
    order: 2;
  }

  .project-media,
  .project-media img,
  .cover {
    height: 100%;
    min-height: 18rem;
  }

  .project-media img {
    aspect-ratio: auto;
    height: 100%;
  }

  .project-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2rem 2.1rem;
  }
}

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

  .nav-toggle {
    display: inline-flex;
    z-index: 60;
  }

  .site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    top: var(--header-h);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1rem 1.25rem;
    background: rgba(10, 11, 13, 0.97);
    border-bottom: 1px solid var(--border);
  }

  .site-nav a {
    padding: 0.8rem 0.4rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
    color: var(--text);
  }

  .nav-github {
    margin-top: 0.75rem;
    border: 1px solid var(--border-strong);
    text-align: center;
    justify-content: center;
  }

  .nav-checkbox:checked ~ .site-nav {
    display: flex;
  }

  .nav-checkbox:checked + .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(6.2px) rotate(45deg);
  }

  .nav-checkbox:checked + .nav-toggle .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-checkbox:checked + .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6.2px) rotate(-45deg);
  }

  body:has(.nav-checkbox:checked) {
    overflow: hidden;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .project:hover .project-media img {
    transform: none;
  }
}
