/* =========================================================
   Arham Javed — Portfolio
   Design system: editorial dark, warm accent
   Fraunces (display) + Inter (UI/body)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --bg:        #0B0B0D;
  --bg-2:      #111114;
  --bg-3:      #16161A;
  --surface:   #1B1B20;
  --line:      rgba(255,255,255,.09);
  --line-2:    rgba(255,255,255,.16);
  --text:      #ECEAE4;
  --text-soft: #B7B4AC;
  --text-mute: #807D75;
  --accent:    #E0A24E;
  --accent-2:  #C8743C;
  --accent-soft: rgba(224,162,78,.14);

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Fluid type scale */
  --fs-eyebrow: .8rem;
  --fs-body: clamp(1rem, .96rem + .25vw, 1.125rem);
  --fs-lead: clamp(1.05rem, .98rem + .5vw, 1.3rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .7vw, 1.6rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2.4vw, 3.4rem);
  --fs-h1: clamp(2.4rem, 1.4rem + 4.6vw, 5rem);
  --fs-display: clamp(3rem, 1.6rem + 6vw, 7rem);

  /* Space */
  --space-section: clamp(4.5rem, 3rem + 8vw, 9rem);
  --container: 1180px;
  --gutter: clamp(1.25rem, .6rem + 3vw, 3rem);

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .7s;
  --radius: 16px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%,-120%);
  background: var(--accent); color: #1a1206; padding: .6rem 1.1rem; border-radius: 0 0 10px 10px;
  font-weight: 600; z-index: 200; transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translate(-50%,0); }

/* ---------- Texture & progress ---------- */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; background: transparent; }
.scroll-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110;
  transition: transform .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(11,11,13,.72); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav.is-hidden { transform: translateY(-105%); }
.nav__inner { max-width: var(--container); margin-inline: auto; padding: .85rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem; }
.nav__brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.nav__mark { font-family: var(--serif); color: var(--accent); font-size: 1.35rem; line-height: 1; }
.nav__name { font-size: .95rem; letter-spacing: .01em; }
.nav__links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav__links a { color: var(--text-soft); font-size: .92rem; position: relative; transition: color .25s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { width: 100%; }
.nav__cta { white-space: nowrap; }
.nav__menu-btn { display: none; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 10px; position: relative; }
.nav__menu-btn span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--text); transition: transform .3s var(--ease), opacity .3s; }
.nav__menu-btn span:nth-child(1){ top: 16px; } .nav__menu-btn span:nth-child(2){ bottom: 16px; }
.nav__menu-btn[aria-expanded="true"] span:nth-child(1){ transform: translateY(4px) rotate(45deg); }
.nav__menu-btn[aria-expanded="true"] span:nth-child(2){ transform: translateY(-4px) rotate(-45deg); }
.nav__mobile { display: none; flex-direction: column; gap: .25rem; padding: .5rem var(--gutter) 1.5rem;
  background: rgba(11,11,13,.96); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav__mobile a { padding: .85rem 0; border-bottom: 1px solid var(--line); color: var(--text-soft); }
.nav__mobile .btn { margin-top: 1rem; border-bottom: none; justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 100px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s, box-shadow .25s;
  will-change: transform;
}
.btn--accent { background: var(--accent); color: #1a1206; }
.btn--accent:hover { box-shadow: 0 10px 40px -10px rgba(224,162,78,.6); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--sm { padding: .6rem 1.1rem; font-size: .85rem; }
.btn--lg { padding: 1rem 2rem; font-size: 1.02rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Section shells ---------- */
.section { padding-block: var(--space-section); position: relative; z-index: 2; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section--impact { background: var(--bg-2); border-block: 1px solid var(--line); }
.kicker {
  font-size: var(--fs-eyebrow); letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 1rem;
  display: inline-flex; align-items: center; gap: .7rem;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--accent); display: inline-block; }
.section__title { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -.02em; max-width: 18ch; }
.section__intro { color: var(--text-soft); font-size: var(--fs-lead); max-width: 60ch; margin-top: 1.4rem; }
.section__intro a, .contact__lead a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding-top: 6rem; padding-bottom: 4rem; overflow: hidden; z-index: 2; }
.hero__glow {
  position: absolute; width: 60vw; height: 60vw; max-width: 800px; max-height: 800px;
  top: -10%; right: -5%; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(224,162,78,.16), transparent 62%);
  filter: blur(20px); transition: transform .4s var(--ease);
}
.hero__grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: clamp(2rem,5vw,5rem); align-items: center; }
.hero__eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .04em; font-size: .95rem; margin-bottom: 1.5rem; }
.hero__title { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -.025em; }
.hero__title .accent { color: var(--text-mute); display: block; margin-top: .2em; }
.hero__title .accent { color: #cfae7e; }
.hero__lead { color: var(--text-soft); font-size: var(--fs-lead); max-width: 56ch; margin-top: 1.8rem; }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.hero__proof { display: flex; flex-wrap: wrap; gap: clamp(1.5rem,4vw,3rem); margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.hero__proof li { display: flex; flex-direction: column; }
.hero__proof .num { font-family: var(--serif); font-size: clamp(2rem,1.4rem+2vw,2.8rem); font-weight: 500; color: var(--accent); line-height: 1; }
.hero__proof .lbl { font-size: .82rem; color: var(--text-mute); margin-top: .5rem; max-width: 14ch; }

/* Portrait */
.hero__portrait { justify-self: center; }
.portrait { position: relative; width: clamp(220px, 30vw, 360px); aspect-ratio: 4/5; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); background: var(--bg-3); }
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.04); transition: filter .6s var(--ease), transform .9s var(--ease); }
.portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,11,13,.5), transparent 45%); pointer-events: none; }
.portrait:hover img { filter: grayscale(.35) contrast(1.04); transform: scale(1.03); }
.portrait__fallback { display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 6rem; color: var(--accent); background: radial-gradient(circle at 50% 35%, var(--bg-3), var(--bg)); }
.portrait--empty img { display: none; }
.portrait--empty .portrait__fallback { display: flex; }

/* anchored sections clear the fixed nav when jumped to */
section[id], [id].hero { scroll-margin-top: 84px; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.5fr .9fr; gap: clamp(2rem,5vw,4.5rem); margin-top: 3rem; align-items: start; }
.about__lead p { margin-bottom: 1.3rem; color: var(--text-soft); font-size: var(--fs-lead); }
.about__lead p:first-child { color: var(--text); }
.about__facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; position: sticky; top: 90px; }
.about__facts h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin-bottom: 1.2rem; }
.about__facts dl div { padding: .85rem 0; border-top: 1px solid var(--line); }
.about__facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: .25rem; }
.about__facts dd { color: var(--text-soft); font-size: .95rem; }
.about__facts .btn { margin-top: 1.4rem; width: 100%; }

/* ---------- Metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.2rem; margin-top: 3rem; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem 1.5rem; transition: border-color .3s, transform .3s var(--ease); }
.metric:hover { border-color: var(--line-2); transform: translateY(-4px); }
.metric__num { font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem,1.6rem+2.6vw,3.6rem); color: var(--accent); line-height: 1; display: block; }
.metric__label { display: block; font-weight: 600; margin-top: .9rem; }
.metric__sub { display: block; color: var(--text-mute); font-size: .85rem; margin-top: .35rem; line-height: 1.5; }

/* ---------- Timeline ---------- */
.timeline { margin-top: 3.5rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline__item { position: relative; padding-left: 2.4rem; padding-bottom: 2.6rem; }
.timeline__item::before { content: ""; position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; margin-bottom: .35rem; }
.timeline__date { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.timeline__org { font-size: .85rem; color: var(--text-mute); display: inline-flex; align-items: center; gap: .5rem; }
.timeline__logo { height: 17px; width: auto; display: block; opacity: .82; transition: opacity .3s var(--ease); }
.timeline__logo--turing { height: 12px; }
.timeline__item:hover .timeline__logo { opacity: 1; }
.timeline__sub { font-size: .82rem; color: var(--text-mute); }
.timeline__item h3 { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h3); margin-bottom: .7rem; }
.timeline__item > p { color: var(--text-soft); margin-bottom: .8rem; max-width: 70ch; }
.timeline__item ul { display: grid; gap: .55rem; }
.timeline__item li { position: relative; padding-left: 1.3rem; color: var(--text-soft); max-width: 72ch; }
.timeline__item li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 1px; background: var(--accent); }

/* ---------- Case studies ---------- */
.cases { display: grid; gap: 1rem; margin-top: 3rem; }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .3s; }
.case:hover { border-color: var(--line-2); }
.case__head { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 1.2rem; align-items: center; padding: 1.6rem 1.8rem; text-align: left; }
.case__tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 600; }
.case__head h3 { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h3); margin-top: .5rem; line-height: 1.15; }
.case__result { color: var(--text-soft); font-size: .92rem; text-align: right; white-space: nowrap; }
.case__result strong { display: block; font-family: var(--serif); color: var(--accent); font-size: 1.5rem; }
.case__chev { width: 12px; height: 12px; border-right: 2px solid var(--text-mute); border-bottom: 2px solid var(--text-mute); transform: rotate(45deg); transition: transform .35s var(--ease); margin-top: -4px; }
.case__head[aria-expanded="true"] .case__chev { transform: rotate(-135deg); margin-top: 4px; }
.case__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.case__body > * { overflow: hidden; min-height: 0; }
.case__head[aria-expanded="true"] + .case__body { grid-template-rows: 1fr; }
.case__cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.8rem; padding: 0 1.8rem 1.9rem; }
.case__cols h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: .6rem; }
.case__cols p { color: var(--text-soft); font-size: .95rem; }

/* ---------- How I lead ---------- */
.lead__grid { display: grid; grid-template-columns: .9fr 1.3fr; gap: clamp(2rem,5vw,4rem); margin-top: 3rem; align-items: start; }
.lead__quote { position: sticky; top: 100px; }
.lead__quote p { font-family: var(--serif); font-weight: 400; font-size: clamp(1.4rem,1.1rem+1.4vw,2.1rem); line-height: 1.3; letter-spacing: -.01em; color: var(--text); border-left: 2px solid var(--accent); padding-left: 1.4rem; }
.lead__principles { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; }
.principle h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin-bottom: .5rem; color: var(--accent); }
.principle p { color: var(--text-soft); font-size: .96rem; }
.skills { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.skills li { border: 1px solid var(--line-2); border-radius: 100px; padding: .5rem 1.1rem; font-size: .88rem; color: var(--text-soft); transition: border-color .25s, color .25s; }
.skills li:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Poems ---------- */
.poems { display: grid; gap: 1rem; margin-top: 3rem; }
.poem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .3s; }
.poem:hover { border-color: var(--line-2); }
.poem__head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 1.8rem 1rem; text-align: left; }
.poem__head h3 { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h3); font-style: italic; }
.poem__chev { width: 11px; height: 11px; border-right: 2px solid var(--text-mute); border-bottom: 2px solid var(--text-mute); transform: rotate(45deg); transition: transform .35s var(--ease); }
.poem__head[aria-expanded="true"] .poem__chev { transform: rotate(-135deg); }
.poem__preview { padding: 0 1.8rem 1.6rem; }
.poem__preview p { font-family: var(--serif); font-style: italic; color: var(--text-soft); font-size: 1.05rem; line-height: 1.7; }
.poem__full { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.poem__full > pre { overflow: hidden; min-height: 0; }
.poem__head[aria-expanded="true"] ~ .poem__full { grid-template-rows: 1fr; }
.poem__head[aria-expanded="true"] ~ .poem__preview { display: none; }
.poem__full pre {
  font-family: var(--serif); white-space: pre-wrap; color: var(--text-soft);
  font-size: 1.02rem; line-height: 1.85; padding: 0 1.8rem 2rem; margin: 0;
}

/* ---------- Beyond ---------- */
.beyond__grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.2rem; margin-top: 3rem; }
.beyond__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; transition: border-color .3s, transform .3s var(--ease); }
.beyond__card:hover { border-color: var(--line-2); transform: translateY(-4px); }
.beyond__card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; margin-bottom: .6rem; color: var(--accent); }
.beyond__card p { color: var(--text-soft); }

/* ---------- Ways to work together ---------- */
.ww__grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.2rem; margin-top: 3rem; }
.ww__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem; transition: border-color .3s, transform .3s var(--ease); }
.ww__card:hover { border-color: var(--line-2); transform: translateY(-4px); }
.ww__num { font-family: var(--serif); color: var(--accent); font-size: 1rem; letter-spacing: .1em; opacity: .85; }
.ww__card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: .5rem 0 .6rem; }
.ww__card p { color: var(--text-soft); }
@media (max-width: 640px) { .ww__grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.section--contact { text-align: center; background: var(--bg-2); border-top: 1px solid var(--line); }
.section--contact .kicker, .section--contact .section__title { margin-inline: auto; }
.section--contact .section__title { max-width: none; }
.contact__lead { color: var(--text-soft); font-size: var(--fs-lead); max-width: 58ch; margin: 1.6rem auto 0; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2.5rem; }
.contact__email { margin-top: 2rem; }
.contact__email a { font-family: var(--serif); font-size: clamp(1.3rem,1rem+1.5vw,2rem); color: var(--text); border-bottom: 1px solid var(--accent-soft); transition: color .25s; }
.contact__email a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding-block: 2.5rem; border-top: 1px solid var(--line); position: relative; z-index: 2; }
.footer__inner { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: center; justify-content: space-between; color: var(--text-mute); font-size: .88rem; }
.footer__tag { color: var(--text-mute); }
.footer__top { color: var(--text-soft); transition: color .25s; }
.footer__top:hover { color: var(--accent); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__portrait { justify-self: start; order: -1; }
  .portrait { width: clamp(160px, 42vw, 240px); }
  .about__grid { grid-template-columns: 1fr; }
  .about__facts { position: static; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  .lead__grid { grid-template-columns: 1fr; }
  .lead__quote { position: static; }
  .lead__principles { grid-template-columns: 1fr 1fr; }
  .case__cols { grid-template-columns: 1fr; gap: 1.2rem; }
  .case__head { grid-template-columns: 1fr auto; }
  .case__result { grid-column: 1 / -1; text-align: left; order: 3; }
  .case__result strong { display: inline; font-size: 1.1rem; }
  .beyond__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav__links, .nav__cta { display: none; }
  .nav__menu-btn { display: block; margin-left: auto; }
  .nav.show-mobile .nav__mobile, .nav__mobile.is-open { display: flex; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .lead__principles { grid-template-columns: 1fr; }
  .hero__proof { gap: 1.4rem 2rem; }
  .case__head, .poem__head, .poem__preview, .poem__full pre, .case__cols { padding-inline: 1.3rem; }
  .case__head { padding-block: 1.3rem; }
}

@media (max-width: 380px) {
  .metrics { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
