/* =========================================================
   Fadi Abbas — personal homepage
   Light-warm theme, system-driven, generous typography.
   ========================================================= */

:root {
  --bg: #FAFAF7;
  --bg-tinted: #F2EFE7;
  --surface: #FFFFFF;
  --ink: #14171F;
  --ink-soft: #2A2F3A;
  --muted: #5A6172;
  --muted-2: #8A8F99;
  --border: #E5E1D8;
  --border-strong: #D3CEC0;
  --accent: #B8451F;          /* burnt sienna */
  --accent-soft: #F5E6DC;
  --accent-ink: #7A2D14;
  --shadow-sm: 0 1px 2px rgba(20, 23, 31, 0.04), 0 1px 3px rgba(20, 23, 31, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 23, 31, 0.06), 0 2px 4px rgba(20, 23, 31, 0.04);
  --shadow-lg: 0 12px 32px rgba(20, 23, 31, 0.08), 0 4px 12px rgba(20, 23, 31, 0.04);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1080px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: currentColor; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: none;
  letter-spacing: -0.01em;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: block;
  flex-shrink: 0;
}
.brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name { font-size: 15.5px; font-weight: 600; }
.brand-handle {
  font-size: 11.5px;
  color: var(--muted);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0;
  font-weight: 500;
}
.nav-list {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}
.nav-list a:hover { color: var(--ink); border-bottom-color: transparent; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(8px, 7vw, 80px) 0 clamp(48px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 400px at 100% -20%, rgba(184, 69, 31, 0.06), transparent 60%),
    radial-gradient(700px 360px at -10% 110%, rgba(184, 69, 31, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 2; max-width: 880px; }

/* ---------- Hero portrait (faded background) ---------- */
.hero-portrait {
  position: absolute;
  top: 50%;
  right: 25px;
  transform: translateY(calc(-50% - 50px));
  width: clamp(300px, 32vw, 480px);
  height: auto;
  opacity: 0.20;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  filter: contrast(0.95);
}
@media (max-width: 880px) {
  .hero-portrait { display: none; }
}

/* ---------- Word rain (hero ambient) ---------- */
.word-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.word-rain .word {
  position: absolute;
  top: 0;
  font-family: var(--font-sans);
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(20, 23, 31, 0.085);
  white-space: nowrap;
  will-change: transform, opacity;
  animation-name: word-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes word-fall {
  0%   { transform: translate3d(0, -40px, 0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate3d(0, 100vh, 0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .word-rain { display: none; }
}
@media (max-width: 720px) {
  .word-rain { display: none; }
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--ink);
}
.accent {
  color: var(--accent-ink);
  font-style: italic;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 0 32px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.btn.primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}
.btn.primary:hover {
  background: var(--accent-ink);
  border-bottom-color: transparent;
  transform: translateY(-1px);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn.ghost:hover {
  border-color: var(--ink);
  border-bottom-color: var(--ink);
  transform: translateY(-1px);
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section-tinted { background: var(--bg-tinted); }

.section-head { max-width: 720px; margin: 0 0 40px; }

.kicker {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--ink);
}
.h2.no-margin { margin: 0; }

.section-sub {
  color: var(--muted);
  font-size: 16.5px;
  margin: 0;
  max-width: 620px;
}

/* Two-column section layout (about, background) */
.two-col {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 56px;
  align-items: start;
}
.col-label { position: sticky; top: 96px; }
.col-label .kicker { margin: 0; }

.prose, .prose-lead {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.75;
  max-width: 65ch;
}
.prose-lead {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 22px;
}

/* ---------- Ventures grid ---------- */
.venture-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 880px) {
  .venture-grid { grid-template-columns: 1fr 1.2fr; }
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab:hover {
  color: var(--ink);
  background: rgba(20, 23, 31, 0.04);
}
.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tab.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.tab.is-active:hover { background: var(--ink); color: var(--bg); }

.tab-panels { position: relative; }
.tab-panel[hidden] { display: none; }
.tab-panel { animation: panel-fade .25s ease; }
@keyframes panel-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tab-panel { animation: none; }
}

/* ---------- Featured pair (Conjure + Weeknote) ---------- */
.featured-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (min-width: 880px) {
  .featured-pair { grid-template-columns: 1fr 1fr; }
  .featured-pair.single { grid-template-columns: 1fr; }
}

/* ---------- Project grid ---------- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Inline code (used in feature lists) */
.feature-list code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  background: rgba(184, 69, 31, 0.08);
  color: var(--accent-ink);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.card.featured {
  padding: 32px;
}
.card.subtle {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
}
.card.subtle:hover { box-shadow: var(--shadow-sm); background: var(--surface); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.card-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.featured .card-title { font-size: 26px; }

.card-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin: 6px 0 14px;
}

.card-body {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.65;
  margin: 0 0 18px;
}

.feature-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.feature-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.feature-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.stack {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(184, 69, 31, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.card-link {
  margin-top: auto;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}
.card-link span { transition: transform .15s ease; display: inline-block; }
.card-link:hover { color: var(--accent-ink); border-bottom-color: transparent; }
.card-link:hover span { transform: translateX(3px); }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
}
.tag-live {
  background: #E6F4EA;
  color: #1E6B3A;
  border: 1px solid #CDE9D5;
}
.tag-alpha {
  background: #FFF4E5;
  color: #9A5A00;
  border: 1px solid #F4DDB5;
}
.tag-beta {
  background: #E8F1FB;
  color: #1E4E8B;
  border: 1px solid #CFE0F3;
}
.tag-pilot {
  background: #FEF3E2;
  color: #8B4A0B;
  border: 1px solid #F7DDB2;
}
.tag-private {
  background: #EEEEF0;
  color: #4A4F5A;
  border: 1px solid #DEDFE2;
}
.tag-solo {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
}
.tag-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* ---------- Background list ---------- */
.bg-list { margin: 0; }
.bg-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.bg-row:last-child { border-bottom: none; }
.bg-row dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 2px;
}
.bg-row dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}
.bg-row dd strong { color: var(--ink); font-weight: 600; }
.bg-row dd p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 820px) {
  .contact-card { grid-template-columns: 1.1fr 1fr; align-items: center; }
}
.contact-card .kicker { color: #E8A87C; }
.contact-card .h2 { color: var(--bg); }
.contact-card .section-sub { color: rgba(245, 241, 232, 0.75); margin-top: 14px; }

.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.contact-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  color: var(--bg);
  border: 1px solid rgba(245, 241, 232, 0.1);
  background: rgba(245, 241, 232, 0.03);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.contact-links a:hover {
  background: rgba(245, 241, 232, 0.08);
  border-color: rgba(245, 241, 232, 0.25);
  border-bottom-color: rgba(245, 241, 232, 0.25);
  transform: translateX(2px);
}
.contact-label { font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.contact-handle { color: rgba(245, 241, 232, 0.7); font-size: 14px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
}
.footer-inner { display: flex; justify-content: center; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .card, .btn, .card-link span, .contact-links a { transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive cleanup ---------- */
@media (max-width: 720px) {
  .nav-list { gap: 18px; }
  .nav-list a { font-size: 14px; }
  .two-col { grid-template-columns: 1fr; gap: 20px; }
  .col-label { position: static; }
  .bg-row { grid-template-columns: 1fr; gap: 6px; }
  .meta-row { gap: 8px; }
  .chip { font-size: 12.5px; padding: 6px 11px; }
  .card.featured { padding: 24px; }
}
