/* =========================================================================
   Doğa Bircan Deviren — CV / Portfolio
   Dusk Arcane · single dark theme · zero-build static
   ========================================================================= */

/* ----- Self-hosted display font ----- */
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ----- Design tokens ----- */
:root {
  /* Dusk Arcane palette */
  --bg:        #14121f;
  --bg-deep:   #0f0d17;
  --surface:   #1e1b2e;
  --surface-2: #26223a;
  --text:      #ded9ec;
  --muted:     #9a94b3;
  --accent:    #e0b56b;   /* candle gold */
  --accent-2:  #4fb3a6;   /* muted teal */
  --border:    #322c47;
  --good:      #7fcf9a;   /* + Added   */
  --change:    #d8b466;   /* ~ Changed */
  --fix:       #79a8d8;   /* fixed     */

  /* Typography */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;

  /* Layout */
  --container: 72rem;
  --pad-x: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ----- Reset-ish ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #f0cd8f; }
ul { margin: 0; padding: 0; }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 600; }

/* ----- Accessibility helpers ----- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 100;
  background: var(--accent);
  color: #1a1508;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

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

/* ----- Painterly grain overlay ----- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .site-header, .site-footer { position: relative; z-index: 1; }

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.7rem var(--pad-x);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.nav__glyph { color: var(--accent); }
.nav__menu {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  align-items: center;
}
.nav__menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  padding: 0.35rem 0.1rem;
  transition: color 0.18s var(--ease);
}
.nav__menu a:hover,
.nav__menu a.is-active { color: var(--text); }
.nav__menu a.is-active { color: var(--accent); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px; height: 38px;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
}
.nav__bars, .nav__bars::before, .nav__bars::after {
  content: "";
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav__bars::before { transform: translateY(-6px); }
.nav__bars::after  { transform: translateY(4px); }
.nav__bars { position: relative; }
.nav__bars::before, .nav__bars::after { position: absolute; left: 0; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 12vh, 8rem) clamp(3rem, 9vh, 6rem);
  border-bottom: 1px solid var(--border);
}
.hero__glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 130%;
  z-index: 0;
  background:
    radial-gradient(40% 55% at 22% 18%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(46% 60% at 82% 30%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 72%),
    radial-gradient(60% 70% at 50% 100%, color-mix(in srgb, #3a2f5e 55%, transparent), transparent 75%);
  filter: blur(6px);
}
.hero__inner { position: relative; z-index: 1; max-width: 54rem; }

.hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.4rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.badge__key { color: var(--accent); font-weight: 700; }
.badge--status { color: var(--text); }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 70%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  font-optical-sizing: auto;
}
.hero__role {
  font-family: var(--font-mono);
  color: var(--accent-2);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  margin: 0 0 1.4rem;
}
.hero__role .sep { color: var(--muted); margin-inline: 0.35rem; }
.hero__blurb {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 2rem;
  font-size: 1.075rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 0.72rem 1.3rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: #1a1508;
  font-weight: 600;
}
.btn--primary:hover { background: #eec684; color: #1a1508; transform: translateY(-2px); }
.btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.btn--ghost:hover { border-color: var(--accent-2); color: var(--text); transform: translateY(-2px); }

/* =========================================================================
   Sections
   ========================================================================= */
.section { padding-block: clamp(3.5rem, 9vh, 6rem); }
.section--alt { background: var(--bg-deep); border-block: 1px solid var(--border); }

.section__head { margin-bottom: 2.4rem; max-width: 46rem; }
.section__kicker {
  font-family: var(--font-mono);
  color: var(--accent-2);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem;
  text-transform: lowercase;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -0.01em;
}
.section__lede { color: var(--muted); margin: 0.7rem 0 0; }

/* =========================================================================
   Skills
   ========================================================================= */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.6rem 2rem;
}
.skillgroup__title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-2) 35%, var(--border));
  color: color-mix(in srgb, var(--accent-2) 55%, var(--text));
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.chip__logo {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  fill: currentColor;
}
.chips--sm .chip { font-size: 0.78rem; padding: 0.28rem 0.6rem; }

/* =========================================================================
   Changelog / Patch notes
   ========================================================================= */
.changelog {
  list-style: none;
  display: grid;
  gap: 1.4rem;
  position: relative;
}
.release {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 1.8rem) clamp(1.2rem, 3vw, 2rem);
  padding-left: clamp(1.4rem, 3vw, 2.2rem);
}
/* version rail node */
.release::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(var(--border), transparent);
}
.release:first-child::before {
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
}
.release__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.3rem 1rem;
  margin-bottom: 1rem;
}
.release__ver {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}
.release__num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}
.release:not(:first-child) .release__num { color: var(--muted); }
.tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag--latest {
  color: #1a1508;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.release__title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
}
.release__at { color: var(--muted); font-weight: 400; }
.release__date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.notes { list-style: none; display: grid; gap: 0.5rem; }
.note {
  position: relative;
  padding-left: 1.7rem;
  color: var(--text);
}
.note::before {
  position: absolute;
  left: 0; top: 0;
  font-family: var(--font-mono);
  font-weight: 700;
}
.note--add::before    { content: "+"; color: var(--good); }
.note--change::before { content: "~"; color: var(--change); }
.note--fix::before    { content: "△"; color: var(--fix); font-size: 0.8em; top: 0.15em; }
.note__label {
  /* visually hidden but read by screen readers */
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   Projects
   ========================================================================= */
.projects {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
}
.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 14px 34px -18px rgba(0,0,0,0.8);
}
.card__media {
  display: block;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--surface-2);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.card__title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.card__pitch { color: var(--muted); margin: 0; font-size: 0.96rem; flex: 1; }
.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.2rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.card__links a { text-decoration: none; }
.card__links a:hover { text-decoration: underline; }

/* =========================================================================
   Contact
   ========================================================================= */
.contact { max-width: 40rem; }
.contact__cta { margin: 1.6rem 0; }
.contact__cta .btn { font-size: 1rem; }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  list-style: none;
}
.contact__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.contact__links a:hover { transform: translateY(-2px); border-color: var(--accent-2); color: var(--accent-2); }
.contact__links svg { flex-shrink: 0; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
  background: var(--bg-deep);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.site-footer p { margin: 0; }
.site-footer__note { font-family: var(--font-mono); }

/* =========================================================================
   Reveal on scroll (progressive enhancement; only when .js present)
   ========================================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================================================================
   Responsive: mobile nav
   ========================================================================= */
@media (max-width: 640px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem var(--pad-x) 1rem;
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu li { width: 100%; }
  .nav__menu a { display: block; width: 100%; padding: 0.8rem 0; font-size: 1rem; }
  .nav { position: relative; }

  .release__head { grid-template-columns: 1fr; }
  .release__date { text-align: left; }
}

/* =========================================================================
   Reduced motion — kill all movement, keep the mood static
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero__glow { filter: none; }
  .status-dot { animation: none; }
}
