/* ============================================================
   Muhammad Abdullah — Portfolio
   Editorial, print-inspired design. Warm paper, ink, one green.
   ============================================================ */

:root {
  --paper: #faf8f4;
  --paper-alt: #f2efe9;
  --card: #ffffff;
  --ink: #1c1a16;
  --ink-soft: #4f4a42;
  --muted: #857e72;
  --line: #e3ded3;
  --line-soft: #ece8de;
  --accent: #2f5d4b;
  --accent-deep: #234839;
  --accent-wash: #eef2ec;

  --font-serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  --container: 1080px;
  --radius: 4px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

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

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

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.9rem, 7vw, 5.4rem);
  line-height: 1.04;
  font-weight: 480;
  letter-spacing: -0.015em;
  max-width: 15ch;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.kicker {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kicker::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--accent);
}

.meta-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 2px;
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-nav.scrolled {
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
}

.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:not(.nav-cta):hover {
  color: var(--ink);
}

.nav-links a:not(.nav-cta):hover::after {
  transform: scaleX(1);
}

.nav-cta {
  padding: 9px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink) !important;
  font-size: 0.88rem;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.nav-cta::after {
  display: none;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--paper) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 1.75px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.9px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.9px) rotate(-45deg);
}

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

.hero {
  padding: 72px 0 112px;
}

.hero h1 {
  margin-bottom: 52px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 72px;
  align-items: start;
}

.lede {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0;
  max-width: 32em;
}

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

.button {
  display: inline-block;
  padding: 13px 28px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.button:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.button:active {
  transform: translateY(1px);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.ghost:hover {
  border-color: var(--ink);
  background: transparent;
}

.hero-meta {
  list-style: none;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.hero-meta a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  margin-right: 14px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hero-meta a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Photo — full portrait, natural 3:4 ratio, full color */
.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 0%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 28px 56px -36px rgba(28, 26, 22, 0.45);
}

.hero-photo figcaption {
  margin-top: 12px;
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-photo figcaption::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */

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

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

.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 56px;
}

.section-no {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.section-note {
  margin-left: auto;
  max-width: 300px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: right;
  display: none;
}

@media (min-width: 860px) {
  .section-note {
    display: block;
  }
}

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

.project {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}

.project-list {
  border-bottom: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
  gap: 40px;
}

.project h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
  transition: color 0.25s ease;
}

.project-client {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: -6px 0 14px;
}

.project-client a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.project-client a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.project-main p {
  max-width: 36em;
}

.project:hover h3 {
  color: var(--accent);
}

.project-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 6px;
}

.project-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-wash);
  padding: 5px 12px;
  border-radius: 999px;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.chips li {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  background: var(--card);
}

/* More work */
.more-work {
  margin-top: 64px;
}

.more-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 24px;
}

.more-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
}

.more-list li {
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 2px;
}

.more-list span {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.97rem;
}

.more-list small {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

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

.timeline {
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 1px solid var(--line);
}

.time {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  padding-top: 5px;
}

.entry h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.org {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.entry > p:last-child {
  max-width: 40em;
}

/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

.about-text p {
  margin-bottom: 20px;
  font-size: 1.02rem;
}

.about-text .aside {
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.about-cols {
  display: grid;
  gap: 28px;
}

.about-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
}

.about-box h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 20px;
}

.skill-list div {
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

.skill-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.skill-list dt {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 3px;
}

.skill-list dd {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.edu {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.edu:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.degree {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--ink);
}

.school {
  font-size: 0.9rem;
  color: var(--muted);
}

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

.contact {
  text-align: center;
  background: var(--ink);
  color: rgba(250, 248, 244, 0.75);
  border-top: 0;
}

.contact .section-no {
  color: #9dbfac;
}

.contact h2 {
  color: var(--paper);
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  margin: 10px 0 20px;
}

.contact-lede {
  max-width: 32em;
  margin: 0 auto 40px;
  font-size: 1.05rem;
}

.contact .button {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
  font-size: 0.97rem;
}

.contact .button:hover {
  background: #fff;
  border-color: #fff;
}

.contact-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 48px;
  margin-top: 56px;
  font-size: 0.95rem;
  color: var(--paper);
}

.contact-links a {
  color: var(--paper);
  border-bottom: 1px solid rgba(250, 248, 244, 0.3);
  transition: border-color 0.2s ease;
}

.contact-links a:hover {
  border-color: var(--paper);
}

.contact-links .meta-label {
  color: #9dbfac;
  margin-bottom: 4px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner a {
  color: var(--ink-soft);
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------
   Reveal animation
   ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------
   Blog
   ------------------------------------------------------------ */

.blog-head {
  padding: 88px 0 0;
}

.blog-title {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
}

.blog-sub {
  margin-top: 16px;
  color: var(--muted);
  max-width: 38em;
}

.blog-section {
  padding-top: 72px;
}

.blog-list {
  list-style: none;
}

.blog-list li {
  border-top: 1px solid var(--line);
}

.blog-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.blog-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 40px;
  padding: 32px 0;
}

.blog-date {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  padding-top: 6px;
}

.blog-row h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  transition: color 0.25s ease;
}

.blog-row p {
  color: var(--ink-soft);
  max-width: 44em;
}

.blog-row:hover h2 {
  color: var(--accent);
}

.blog-empty {
  padding: 60px 0;
  color: var(--muted);
}

/* Single post */
.post {
  padding: 72px 0 110px;
}

.post-container {
  max-width: 760px;
}

.post h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 18px;
}

.post-meta {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.78;
}

.post-body h2 {
  font-size: 1.6rem;
  margin: 2.2em 0 0.7em;
}

.post-body h3 {
  font-size: 1.25rem;
  margin: 1.8em 0 0.6em;
}

.post-body p {
  margin: 0 0 1.3em;
}

.post-body a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.post-body a:hover {
  border-color: var(--accent);
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.3em;
  padding-left: 1.5em;
}

.post-body li {
  margin-bottom: 0.5em;
}

.post-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-soft);
}

.post-body code {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-alt);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 2px 6px;
}

.post-body pre {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 22px 24px;
  overflow-x: auto;
  margin: 0 0 1.6em;
}

.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.86rem;
  color: inherit;
}

.post-body img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 0 0 1.6em;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3em 0;
}

@media (max-width: 700px) {
  .blog-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 26px 0;
  }
}

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

@media (max-width: 920px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .hero-photo {
    max-width: 320px;
  }

  .hero h1 {
    margin-bottom: 40px;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .more-list {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 80px 0;
  }

  .hero {
    padding: 56px 0 80px;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 22px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 22px 18px;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 1rem;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-cta {
    border: 0;
    padding: 13px 0;
    color: var(--accent) !important;
  }

  .section-head {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
