/* =========================================================
   Onur Ozan Sünger — "NETWORK"
   The portfolio as a graph. Calm graphite blueprint, one azure accent.
   Message-passing on hover · a forward-pass spine through the sections.
   ========================================================= */

:root {
  --bg:      #0b0e13;
  --bg-2:    #0f131a;
  --surface: rgba(150, 180, 220, 0.035);
  --ink:     #eaf0f8;   /* headings */
  --text:    #aeb8c7;   /* body */
  --muted:   #6b7689;
  --faint:   #424c5d;
  --line:    rgba(160, 185, 220, 0.10);
  --line-2:  rgba(160, 185, 220, 0.18);
  --accent:  #6aa6ff;   /* azure */
  --accent-d:#3f6fc4;
  --glow:    rgba(106, 166, 255, 0.5);

  --maxw: 980px;
  --measure: 680px;
  --pad: clamp(1.3rem, 4.5vw, 3rem);
  --rail: clamp(0px, 4vw, 46px);

  --ease: cubic-bezier(.2, .7, .2, 1);

  --f-disp: 'Space Grotesk', sans-serif;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.06rem);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: rgba(106, 166, 255, 0.25); color: var(--ink); }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }
.mono { font-family: var(--f-mono); }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.skip-link { position: fixed; left: -999px; top: 0; z-index: 99; background: var(--accent); color: #07121f; padding: .6rem 1rem; font-size: .85rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(160,185,220,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160,185,220,0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}
.bg-fade {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(80% 50% at 70% 8%, rgba(106,166,255,0.10), transparent 70%);
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); position: relative; z-index: 3; }
main { position: relative; z-index: 3; }

/* ---------- Header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem var(--pad);
  transition: background .4s var(--ease), padding .35s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.top.scrolled {
  padding: .8rem var(--pad);
  background: rgba(11, 14, 19, 0.7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--f-disp); font-weight: 600; font-size: 1rem; letter-spacing: -.01em; color: var(--ink); }
.brand-node { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--accent); background: rgba(106,166,255,0.2); transition: box-shadow .3s; }
.brand:hover .brand-node { box-shadow: 0 0 10px var(--glow); background: var(--accent); }

.links { display: flex; align-items: center; gap: 1.8rem; }
.links > a { font-size: .9rem; color: var(--muted); position: relative; transition: color .3s var(--ease); }
.links > a:hover { color: var(--ink); }
.links > a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.links > a:hover::after { width: 100%; }

.lang { display: inline-flex; align-items: center; gap: .35rem; padding-left: .3rem; }
.lang-dot { color: var(--faint); }
.lang-btn { font-family: var(--f-mono); font-size: .78rem; color: var(--faint); background: none; border: none; padding: 0; cursor: pointer; transition: color .25s var(--ease); }
.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: var(--accent); }

.menu-btn { display: none; flex-direction: column; gap: 6px; width: 28px; background: none; border: none; cursor: pointer; }
.menu-btn span { height: 1.5px; width: 24px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

.menu { position: fixed; inset: 0; z-index: 35; background: rgba(11,14,19,0.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; justify-content: center; gap: .4rem; padding: 0 var(--pad); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s; }
.menu.open { opacity: 1; visibility: visible; }
.menu > a { font-family: var(--f-disp); font-weight: 500; font-size: clamp(2rem, 9vw, 2.8rem); color: var(--ink); padding: .35rem 0; }
.menu-lang { display: flex; align-items: center; gap: .8rem; margin-top: 2rem; }
.menu-lang .lang-btn { font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 7rem 0 4rem; overflow: hidden; }
.net {
  position: absolute; top: 0; right: 0; bottom: 0; width: 64%; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 38%);
  mask-image: linear-gradient(90deg, transparent, #000 38%);
}
.net svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.node { pointer-events: auto; cursor: default; }

/* graph elements */
.edge { stroke: var(--line-2); stroke-width: 0.18; transition: stroke .3s, stroke-width .3s; }
.edge.hot { stroke: var(--accent); stroke-width: 0.4; }
.node-c { fill: var(--bg-2); stroke: var(--muted); stroke-width: 0.25; transition: fill .3s, stroke .3s, r .3s; }
.node.hub .node-c { stroke: var(--accent-d); }
.node-label { font-family: var(--f-mono); font-size: 2.1px; fill: var(--muted); transition: fill .3s; letter-spacing: 0.02px; }
.node.hub .node-label { fill: var(--text); }
.node:hover .node-c, .node.hot .node-c { fill: var(--accent); stroke: var(--accent); }
.node:hover .node-label, .node.hot .node-label { fill: var(--ink); }
.node:hover .node-c { filter: drop-shadow(0 0 1.4px var(--glow)); }

.hero-text { position: relative; z-index: 3; }
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.7rem; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--glow); }
.hero-name { font-family: var(--f-disp); font-weight: 600; font-size: clamp(3rem, 9vw, 6.6rem); line-height: 0.98; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 1.7rem; }
.hero-name .amber { color: var(--accent); }
.lede { font-size: clamp(1.1rem, 2vw, 1.5rem); line-height: 1.5; color: var(--ink); font-weight: 400; max-width: 22ch; margin-bottom: 2.2rem; }
.status { display: flex; flex-wrap: wrap; gap: .6rem; font-family: var(--f-mono); font-size: .82rem; color: var(--muted); margin-bottom: 2.4rem; }
.status .sep { color: var(--faint); }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; margin-bottom: 2.6rem; }
.hero-links a { font-size: .95rem; color: var(--muted); transition: color .3s var(--ease); }
.hero-links a:hover { color: var(--ink); }
.cta { color: var(--ink) !important; padding-bottom: 3px; border-bottom: 1px solid var(--accent); transition: color .3s, letter-spacing .3s var(--ease); }
.cta:hover { color: var(--accent) !important; letter-spacing: .01em; }
.fig { font-family: var(--f-mono); font-size: .72rem; color: var(--faint); letter-spacing: .04em; }

/* ---------- Flow (sections + forward-pass spine) ---------- */
.flow { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.flow::before { content: ""; position: absolute; top: 2rem; bottom: 2rem; left: calc(var(--pad) + var(--rail) * 0.5); width: 1px; background: var(--line); }
.sec { position: relative; padding: clamp(4rem, 8vw, 7rem) 0 clamp(4rem, 8vw, 7rem) var(--rail); }

.sh { position: relative; display: flex; align-items: baseline; gap: .9rem; margin-bottom: 2.4rem; }
.marker { position: absolute; left: calc(var(--rail) * -0.5 - var(--pad)); top: .35rem; left: calc(-1 * var(--rail) + (var(--rail) * 0.5) - 5px); width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--muted); transition: border-color .4s, box-shadow .4s, background .4s; }
.sec.active .marker { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(106,166,255,0.12), 0 0 14px var(--glow); }
.sh-k { font-family: var(--f-mono); font-size: .8rem; color: var(--accent); }
.sh-t { font-family: var(--f-disp); font-weight: 500; font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -.02em; color: var(--ink); }

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); }
.prose p { font-size: clamp(1.02rem, 1.3vw, 1.16rem); color: var(--text); margin-bottom: 1.3rem; }
.prose p:first-child { font-size: clamp(1.15rem, 1.7vw, 1.4rem); color: var(--ink); line-height: 1.55; }
.prose p:last-child { margin-bottom: 0; }

.meta-rows { margin-top: 3rem; border-top: 1px solid var(--line); }
.mrow { display: grid; grid-template-columns: 130px 1fr; gap: 1.4rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.mk { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: .15rem; }
.mv { color: var(--text); }
.mv.mono { font-family: var(--f-mono); font-size: .85rem; color: var(--text); line-height: 1.9; }

/* ---------- Lists ---------- */
.list { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 84px 1fr; gap: clamp(1rem, 3vw, 2.2rem); padding: clamp(1.6rem, 3vw, 2.4rem) clamp(.6rem, 1.6vw, 1.3rem); border-bottom: 1px solid var(--line); position: relative; border-radius: 12px; transition: background .4s var(--ease); }
.row::after { content: ""; position: absolute; left: 0; top: -1px; width: 2px; height: calc(100% + 2px); background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--ease); border-radius: 2px; }
.row:hover { background: var(--surface); }
.row:hover::after { transform: scaleY(1); }

.proj { grid-template-columns: 54px 1fr 26px; align-items: start; }
.yr { font-family: var(--f-mono); font-size: .95rem; color: var(--muted); transition: color .35s var(--ease); }
.row:hover .yr { color: var(--accent); }
.pn { font-family: var(--f-mono); font-size: .8rem; color: var(--faint); padding-top: .5rem; transition: color .35s var(--ease); }
.row:hover .pn { color: var(--accent); }

.rbody h3 { font-family: var(--f-disp); font-weight: 500; font-size: clamp(1.2rem, 2.1vw, 1.55rem); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); margin-bottom: .5rem; }
.proj:first-child .rbody h3 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
.rorg { font-family: var(--f-mono); font-size: .82rem; color: var(--muted); margin-bottom: .85rem; }
.rdesc { color: var(--text); max-width: 66ch; line-height: 1.68; }
.rdesc i { display: block; margin-top: .65rem; font-style: normal; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
.rtags { margin-top: .85rem; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }

.go { font-size: 1.2rem; color: var(--muted); align-self: center; transition: transform .4s var(--ease), color .4s; }
.go-mut { font-family: var(--f-mono); font-size: .8rem; }
.proj[href]:hover .go { color: var(--accent); transform: translate(3px, -3px); }

.more { margin-top: 2.2rem; font-family: var(--f-mono); font-size: .88rem; color: var(--muted); }
.more a { color: var(--ink); border-bottom: 1px solid var(--line-2); transition: color .3s, border-color .3s; }
.more a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Contact ---------- */
.contact-line { font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.45; color: var(--ink); max-width: 32ch; margin-bottom: 2.2rem; }
.contact-mail { display: inline-block; font-family: var(--f-disp); font-weight: 500; font-size: clamp(1.6rem, 6vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em; color: var(--ink); margin-bottom: 2.6rem; position: relative; word-break: break-word; transition: color .35s var(--ease); }
.contact-mail::after { content: ""; position: absolute; left: 0; bottom: 2px; height: 2px; width: 0; background: var(--accent); transition: width .5s var(--ease); }
.contact-mail:hover { color: var(--accent); }
.contact-mail:hover::after { width: 100%; }
.contact-links { display: flex; flex-wrap: wrap; gap: 1.7rem; font-family: var(--f-mono); font-size: .85rem; color: var(--muted); }
.contact-links a { transition: color .3s var(--ease); }
.contact-links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.foot { padding: 2.6rem 0; border-top: 1px solid var(--line); position: relative; z-index: 3; }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-family: var(--f-mono); font-size: .82rem; color: var(--muted); }
.foot-in a { transition: color .3s var(--ease); }
.foot-in a:hover { color: var(--accent); }

/* ---------- Reveal ---------- */
.lift { opacity: 0; transform: translateY(18px); transition: opacity .85s var(--ease), transform .85s var(--ease); }
.lift.in { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .net { width: 100%; opacity: 0.5; -webkit-mask-image: radial-gradient(120% 70% at 80% 25%, #000, transparent 70%); mask-image: radial-gradient(120% 70% at 80% 25%, #000, transparent 70%); }
  .hero { align-items: flex-end; padding-bottom: 6rem; }
}
@media (max-width: 720px) {
  .links > a, .lang { display: none; }
  .menu-btn { display: flex; }
  .flow::before { display: none; }
  .sec { padding-left: 0; }
  .marker { display: none; }
  .mrow { grid-template-columns: 1fr; gap: .4rem; }
  .row { grid-template-columns: 58px 1fr; padding: 1.5rem .4rem; }
  .proj { grid-template-columns: 40px 1fr; }
  .proj .go { display: none; }
  .net { opacity: 0.32; }
}
