/* ============================================================
   Emir Kahraman — pure black, monochrome
   Animated background. No color, no boxes.
   ============================================================ */

:root {
  --bg:        #000000;
  --text:      #ffffff;
  --text-2:    rgba(255, 255, 255, 0.74);
  --muted:     rgba(255, 255, 255, 0.50);
  --dim:       rgba(255, 255, 255, 0.40);
  --rule:      rgba(255, 255, 255, 0.14);
  --rule-soft: rgba(255, 255, 255, 0.07);
  --wash:      rgba(255, 255, 255, 0.04);

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* exponential ease-out: instant response, soft settle (Emil / impeccable) */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.4, 0, 0.2, 1);

  --col: 680px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: #fff; color: #000; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--text);
}

/* ============================================================
   Background animation layers
   ============================================================ */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  /* faint radial vignette so particles fade at the edges */
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, #000 55%, transparent 95%);
          mask-image: radial-gradient(circle at 50% 40%, #000 0%, #000 55%, transparent 95%);
}

/* subtle film grain over everything */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -2%); }
  60% { transform: translate(-2%, -3%); }
  80% { transform: translate(2%, 4%); }
}

/* ============================================================
   Layout
   ============================================================ */
main {
  position: relative;
  z-index: 2;
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(72px, 14vh, 150px) 28px 96px;
}

/* ============================================================
   Intro — staggered load reveal
   ============================================================ */
.intro { padding-bottom: 40px; }
.intro > * { animation: rise 0.9s var(--ease) backwards; }
.intro .kicker { animation-delay: 0.05s; }
.intro h1     { animation-delay: 0.16s; }
.intro .lede  { animation-delay: 0.30s; }
.intro .meta  { animation-delay: 0.42s; }
.intro .cta   { animation-delay: 0.54s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
}

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.intro h1 {
  font-family: var(--sans);
  font-size: clamp(46px, 12vw, 96px);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--text);
}
.lede {
  max-width: 50ch;
  margin-top: 30px;
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--text-2);
}
.meta {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* quick-action links */
.cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cta a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 9px 16px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.14s var(--ease-press);
}
.cta a:hover { background: #fff; color: #000; border-color: #fff; }
.cta a:hover .work-go { color: #000; }
/* tactile press — the interface confirms it heard the tap */
.cta a:active { transform: scale(0.97); }
.cta a.cta--primary { background: #fff; color: #000; border-color: #fff; }
.cta a.cta--primary:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}

/* ============================================================
   Blocks — hairline-separated, no boxes
   ============================================================ */
.block {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 48px 0;
  border-top: 1px solid var(--rule);
}
.label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.label .num { color: var(--text); margin-right: 8px; }
.block-body > p { max-width: 60ch; }

.facts { margin-top: 26px; display: grid; gap: 16px; }
.facts dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 2px;
}
.facts dd { color: var(--text); font-weight: 500; }
.dim { color: var(--muted); font-weight: 400; }

/* ============================================================
   Work items — expandable, hairline accordion
   ============================================================ */
.work { list-style: none; }

.work-item {
  position: relative;
  margin-left: -18px;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.25s var(--ease);
}
.work li:first-child .work-item { border-top: 1px solid var(--rule-soft); }

/* animated left bar — grows on hover, stays while open */
.work-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: #fff;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.work-item:hover { background: var(--wash); }
.work-item:active { background: rgba(255, 255, 255, 0.06); }
.work-item:hover::before,
.work-item.open::before { transform: scaleY(1); }

/* the whole header is a button that toggles details */
.work-head {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  display: block;
  width: 100%;
  cursor: pointer;
  padding: 22px 48px 22px 18px;
}
.work-head:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: -1px;
}

.work-title { display: flex; align-items: baseline; gap: 10px; }
.work-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
  text-shadow: 0 0 0 transparent;
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
}
/* restrained lift on hover: brighten to pure white + a whisper of glow, not neon */
.work-item:hover .work-name,
.work-item.open .work-name {
  color: var(--text);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
}

.work-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1px 7px;
  white-space: nowrap;
}

.work-desc { display: block; margin-top: 8px; max-width: 64ch; color: var(--text-2); }
.work-stack {
  display: block;
  margin-top: 11px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* plus → cross toggle indicator */
.acc-x {
  position: absolute;
  top: 20px;
  right: 16px;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.35s var(--ease), color 0.2s var(--ease);
}
.work-item:hover .acc-x { color: var(--text); }
.work-item.open .acc-x { transform: rotate(45deg); color: var(--text); }

/* collapsible body — pure CSS grid-rows animation */
.work-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.work-body-inner {
  overflow: hidden;
  min-height: 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              visibility 0s 0.5s;
}
.work-item.open .work-body { grid-template-rows: 1fr; }
.work-item.open .work-body-inner {
  visibility: visible;
  opacity: 1;
  transform: none;
  /* content fades in slightly after the height has begun opening */
  transition: opacity 0.45s var(--ease) 0.12s, transform 0.45s var(--ease) 0.12s,
              visibility 0s;
}

.work-points {
  list-style: none;
  display: grid;
  gap: 9px;
  padding: 2px 16px 22px 18px;
}
.work-points li {
  position: relative;
  padding-left: 20px;
  max-width: 62ch;
  font-size: 14.5px;
  color: var(--text-2);
}
.work-points li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--dim);
}

/* mini case study: Problem / Solution / Proof */
.case {
  display: grid;
  gap: 13px;
  padding: 2px 16px 18px 18px;
}
.case > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
}
.case dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  padding-top: 4px;
}
.case dd {
  font-size: 14.5px;
  color: var(--text-2);
  max-width: 58ch;
}

.work-note {
  margin: 0 16px 22px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  max-width: 60ch;
}

.work-link {
  display: inline-block;
  margin: 0 16px 22px 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background-image: linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.3s var(--ease);
  padding-bottom: 2px;
}
.work-link:hover { background-size: 100% 1px; }
.work-link .work-go { color: var(--muted); }
.work-link:hover .work-go { color: var(--text); }

.work-go {
  font-family: var(--mono);
  color: var(--muted);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
/* external-link arrows nudge toward where they send you */
.cta a:hover .work-go,
.contact a:hover .work-go,
.work-link:hover .work-go { transform: translate(2px, -2px); }

/* ============================================================
   Experience
   ============================================================ */
.xp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.xp-role { color: var(--text); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.xp-org { color: var(--text-2); margin-top: 2px; }
.xp-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.xp-points {
  list-style: none;
  display: grid;
  gap: 9px;
  margin-top: 20px;
}
.xp-points li {
  position: relative;
  padding-left: 20px;
  max-width: 62ch;
  font-size: 14.5px;
  color: var(--text-2);
}
.xp-points li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--dim);
}
.xp-caption {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
}
.work--xp { margin-top: 10px; }
.work--xp .work-name { font-size: 17px; }

/* ============================================================
   Stack
   ============================================================ */
.stack-grid { display: grid; gap: 22px; }
.stack-head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 3px;
}
.stack-row { color: var(--text); font-family: var(--mono); font-size: 14px; }

/* ============================================================
   Contact
   ============================================================ */
.contact { list-style: none; display: grid; gap: 12px; }
.contact a {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  background-image: linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.3s var(--ease);
  padding-bottom: 2px;
}
.contact a:hover { background-size: 100% 1px; }
.contact .work-go { color: var(--muted); }
.contact a:hover .work-go { color: var(--text); }

/* ============================================================
   Footer
   ============================================================ */
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* ============================================================
   Scroll reveal
   Progressive enhancement: only hide content when JS is present
   to un-hide it, so the page is fully readable without scripts.
   ============================================================ */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.js [data-reveal].in { opacity: 1; transform: none; will-change: auto; }

/* anchor targets clear the top edge when smooth-scrolled to */
#work, #contact { scroll-margin-top: 32px; }

/* staggered entrance for project rows — each rises just after the last
   (legitimate per-list stagger, not a uniform per-section reflex) */
.js .work li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js [data-reveal].in .work li { opacity: 1; transform: none; }
.js [data-reveal].in .work li:nth-child(1) { transition-delay: 0.04s; }
.js [data-reveal].in .work li:nth-child(2) { transition-delay: 0.10s; }
.js [data-reveal].in .work li:nth-child(3) { transition-delay: 0.16s; }
.js [data-reveal].in .work li:nth-child(4) { transition-delay: 0.22s; }
.js [data-reveal].in .work li:nth-child(5) { transition-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  *, html { transition: none !important; scroll-behavior: auto; animation: none !important; }
  .js [data-reveal],
  .js .work li { opacity: 1; transform: none; }
  .grain { display: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  main { padding-top: 64px; }
  .block { grid-template-columns: 1fr; gap: 16px; padding: 38px 0; }
  .label { padding-top: 0; }
  .work-head { padding-right: 40px; }
  .acc-x { right: 12px; }
  .work-title { flex-wrap: wrap; }
  .case > div { grid-template-columns: 1fr; gap: 3px; }
  .case dt { padding-top: 0; }
}
