/* ============================================================
   Marwan Harajli — harajli.com
   Editorial typography with engineering precision + color blocks.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,400..700,30..100;1,9..144,400..700,30..100&display=swap');

:root {
  --paper: #f7f4ec;
  --paper-warm: #f1ecdf;
  --paper-card: #fdfbf5;

  --ink: #1a1a18;
  --ink-soft: #2c2c28;
  --muted: #6a6a60;
  --muted-2: #8a8a7e;
  --rule: #d4cfbe;
  --rule-soft: #e5e0cf;

  --navy: #0b2d42;
  --navy-2: #143c54;
  --navy-deep: #051a28;
  --gold: #c9a86a;
  --gold-deep: #a8895a;
  --gold-glow: rgba(201, 168, 106, 0.22);
  --gold-soft: #ead9b4;

  --terracotta: #c87a5a;
  --terracotta-deep: #9c5a40;
  --terracotta-soft: #ebc5b2;

  --teal: #3a6862;
  --teal-deep: #2a4e48;
  --teal-soft: #b8d0cc;

  --plum: #7a4a5a;
  --plum-soft: #d0b8c0;

  --live: #4a9450;

  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', sans-serif;
  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Monaco, Consolas, monospace;

  --max: 1120px;
  --col: 720px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16.5px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
  position: relative;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.07  0 0 0 0 0.05  0 0 0 0 0.04  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.55;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(40, 30, 20, 0.05) 100%);
}

/* ============================================================ */
/* Page                                                         */
/* ============================================================ */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 56px 72px;
  position: relative;
}

/* ============================================================ */
/* Masthead                                                     */
/* ============================================================ */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 80px;
  gap: 16px;
}

.masthead-left, .masthead-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.masthead .dot {
  color: var(--gold);
  font-weight: 700;
  transform: translateY(-1px);
}

/* ============================================================ */
/* Content column                                               */
/* ============================================================ */

.content {
  max-width: var(--col);
  margin: 0 auto;
  position: relative;
}

/* ============================================================ */
/* Hero                                                         */
/* ============================================================ */

.hero {
  margin: 0 0 24px;
  position: relative;
  animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-rule {
  width: 72px;
  height: 1px;
  background: var(--gold);
  margin-bottom: 32px;
  position: relative;
}

.hero-rule::before, .hero-rule::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--gold);
}

.hero-rule::before { left: 0; }
.hero-rule::after { right: 0; }

.hero-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 36px;
}

.hero-mark {
  width: clamp(150px, 20vw, 200px);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 26px rgba(11, 45, 66, 0.14));
}

.display {
  font-family: var(--serif);
  font-size: clamp(52px, 8.5vw, 100px);
  line-height: 0.94;
  letter-spacing: -0.026em;
  color: var(--ink);
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 40;
  margin-bottom: 36px;
}

.hero-row .display { margin-bottom: 0; }

.display em {
  font-style: italic;
  color: var(--navy);
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(18px, 2.3vw, 23px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 36em;
  font-weight: 400;
  font-variation-settings: 'opsz' 32, 'SOFT' 50;
  letter-spacing: -0.006em;
  margin-bottom: 28px;
}

/* ============================================================ */
/* Status pills (top utility row)                               */
/* ============================================================ */

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 80px;
  animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: 0.1s;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-card);
  white-space: nowrap;
}

.pill--live {
  border-color: var(--navy);
  color: var(--navy);
  background: white;
  padding-left: 12px;
}

.pill-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(74, 148, 80, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 148, 80, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 148, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 148, 80, 0); }
}

/* ============================================================ */
/* Section                                                      */
/* ============================================================ */

.section {
  margin: 0 0 84px;
  animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: 0.2s;
}

.section + .section { animation-delay: 0.3s; }
.section + .section + .section { animation-delay: 0.4s; }
.section + .section + .section + .section { animation-delay: 0.5s; }

.section-mark {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.section-mark::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.section-mark .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--navy);
  text-transform: uppercase;
  font-weight: 700;
}

/* ============================================================ */
/* Entries (work)                                               */
/* ============================================================ */

.entries {
  list-style: none;
}

.entry {
  border-bottom: 1px solid var(--rule-soft);
}

.entry:last-child { border-bottom: none; }

.entry-link {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 24px;
  padding: 22px 0;
  text-decoration: none;
  color: var(--ink);
  align-items: center;
  position: relative;
  transition: padding 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.entry-link:hover { padding-left: 10px; }

.entry-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-name {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: -0.014em;
  font-variation-settings: 'opsz' 60, 'SOFT' 40;
  transition: color 0.25s;
}

.entry-link:hover .entry-name { color: var(--gold-deep); }

.entry-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid currentColor;
  background: transparent;
}

.entry-tag.tag--consulting { color: var(--gold-deep); border-color: var(--gold); background: rgba(201, 168, 106, 0.08); }
.entry-tag.tag--product { color: var(--terracotta-deep); border-color: var(--terracotta); background: rgba(200, 122, 90, 0.06); }
.entry-tag.tag--oss { color: var(--teal-deep); border-color: var(--teal); background: rgba(58, 104, 98, 0.06); }

.entry-desc {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 400;
}

.entry-arrow {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--muted-2);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.25s;
  justify-self: end;
}

.entry-link:hover .entry-arrow { transform: translateX(6px); color: var(--gold-deep); }

/* ============================================================ */
/* Tech pills cluster                                           */
/* ============================================================ */

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-pill {
  display: inline-block;
  padding: 8px 13px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--navy);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* ============================================================ */
/* Prose                                                        */
/* ============================================================ */

.prose {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 400;
  font-variation-settings: 'opsz' 24, 'SOFT' 55;
  max-width: 36em;
}

.prose p { margin-bottom: 18px; }
.prose p:last-child { margin-bottom: 0; }

.prose a {
  color: var(--navy);
  text-decoration: none;
  background-image: linear-gradient(to top, var(--gold-glow) 0%, var(--gold-glow) 24%, transparent 24%);
  transition: background 0.25s ease;
  padding: 0 2px;
  margin: 0 -2px;
}

.prose a:hover {
  background-image: linear-gradient(to top, var(--gold-glow) 0%, var(--gold-glow) 100%);
}

/* ============================================================ */
/* Engagement cards                                             */
/* ============================================================ */

.ecards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  list-style: none;
}

.ecard {
  display: block;
  padding: 26px 26px 24px;
  background: var(--paper-card);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
  overflow: hidden;
}

.ecard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-color, var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ecard:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 45, 66, 0.08);
  border-color: var(--rule);
}

.ecard:hover::before {
  transform: scaleX(1);
}

.ecard--build { --accent-color: var(--navy); }
.ecard--gold { --accent-color: var(--gold); }
.ecard--sage { --accent-color: #6a7a5a; }
.ecard--terracotta { --accent-color: var(--terracotta); }
.ecard--teal { --accent-color: var(--teal); }
.ecard--plum { --accent-color: var(--plum); }

.ecard-title {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.2;
  color: var(--navy);
  font-weight: 500;
  font-variation-settings: 'opsz' 48, 'SOFT' 40;
  letter-spacing: -0.012em;
  margin-bottom: 8px;
}

.ecard-desc {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* ============================================================ */
/* Contact list                                                 */
/* ============================================================ */

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

.contact-list li {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 16px;
  align-items: baseline;
}

.contact-list li:last-child { border-bottom: none; }

.contact-key {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-top: 4px;
}

.contact-list a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--serif);
  font-size: 18px;
  font-variation-settings: 'opsz' 24, 'SOFT' 50;
}

.contact-list a:hover {
  border-bottom-color: var(--gold);
  color: var(--navy-deep);
}

/* ============================================================ */
/* CTA                                                          */
/* ============================================================ */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--navy);
  margin-top: 8px;
  transition: color 0.35s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-101%);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: -1;
}

.cta:hover::before { transform: translateX(0); }

.cta:hover { color: var(--navy-deep); border-color: var(--gold); }

.cta .arrow {
  font-family: var(--mono);
  font-size: 14px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cta:hover .arrow { transform: translateX(5px); }

/* ============================================================ */
/* Footer                                                       */
/* ============================================================ */

.footer {
  max-width: var(--col);
  margin: 96px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  gap: 16px;
  flex-wrap: wrap;
}

.footer-back {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  transition: color 0.25s;
}

.footer-back:hover { color: var(--navy); }

.footer-back .arrow {
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: inline-block;
}

.footer-back:hover .arrow { transform: translateX(-4px); }

/* ============================================================ */
/* Selection / Animations                                       */
/* ============================================================ */

::selection { background: var(--gold); color: var(--navy-deep); }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================ */
/* Responsive                                                   */
/* ============================================================ */

@media (max-width: 880px) {
  .page { padding: 24px 36px 64px; }
  .masthead { margin-bottom: 64px; }
  .status-pills { margin-bottom: 64px; }
  .section { margin-bottom: 72px; }
}

@media (max-width: 640px) {
  .page { padding: 20px 22px 56px; }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 14px;
    margin-bottom: 48px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .masthead-left, .masthead-right { gap: 8px; }

  .hero { margin-bottom: 24px; }
  .hero-row {
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
    margin-bottom: 28px;
  }
  .hero-mark { width: 116px; }

  .display { font-size: clamp(42px, 12vw, 64px); letter-spacing: -0.022em; }
  .lead { font-size: 17px; line-height: 1.5; }

  .status-pills { margin-bottom: 56px; gap: 6px; }
  .pill { font-size: 9.5px; padding: 6px 12px; letter-spacing: 0.12em; }

  .section { margin-bottom: 56px; }

  .section-mark { gap: 12px; margin-bottom: 22px; }
  .section-mark::before { width: 22px; }
  .section-mark .label { font-size: 10.5px; letter-spacing: 0.2em; }

  .entry-link {
    grid-template-columns: 1fr 24px;
    gap: 16px;
    padding: 20px 0;
    align-items: start;
  }
  .entry-link:hover { padding-left: 6px; }
  .entry-name { font-size: 21px; }
  .entry-desc { font-size: 14.5px; }
  .entry-arrow { font-size: 16px; padding-top: 6px; }
  .entry-tag { font-size: 9px; padding: 2px 7px; }

  .tech-pills { gap: 6px; }
  .tech-pill { font-size: 12.5px; padding: 7px 11px; }

  .ecards { grid-template-columns: 1fr; gap: 12px; }
  .ecard { padding: 22px 22px 20px; }
  .ecard-title { font-size: 21px; }
  .ecard-desc { font-size: 14.5px; }

  .prose { font-size: 17px; line-height: 1.55; }
  .prose p { margin-bottom: 14px; }

  .contact-list li { grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 0; }
  .contact-key { font-size: 10px; padding-top: 4px; }
  .contact-list a { font-size: 16.5px; }

  .cta { padding: 14px 22px; font-size: 11px; gap: 12px; }

  .footer { margin-top: 56px; }
  .footer-row { font-size: 9.5px; gap: 12px; }
}

@media (max-width: 380px) {
  .page { padding: 18px 18px 48px; }
  .display { font-size: clamp(36px, 13vw, 52px); }
  .hero-mark { width: 96px; }
  .entry-name, .ecard-title { font-size: 19px; }
}

/* Card grid: 5 cards in 2 columns; 5th sits naturally in last row */
.ecards {
  align-items: stretch;
}

/* ============================================================ */
/* Print                                                        */
/* ============================================================ */

@media print {
  body::before, body::after { display: none; }
  body { background: white; }
  .ecards, .pill, .tech-pill { background: white; }
}
