/* ==========================================================================
   Yusuf Serhat Özkan — portfolio
   Palette: dark plum bg #151120 · light text #EAE7F3 · violet accent #A78BFA,
   plus a small set of pastel hues reserved for mono labels and indices
   ========================================================================== */

/* --- Self-hosted fonts (variable, subsetted; no third-party requests) ---- */

/* Inter latin */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Inter latin-ext */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono latin */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* JetBrains Mono latin-ext */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #151120;
  --fg: #EAE7F3;
  --fg-soft: #C3BED2;
  --muted: #9B94AD;
  --accent: #A78BFA;
  --accent-strong: #BCA6FC;
  --metric: #C4B5FD;
  --surface: #1D182A;
  --line: rgba(234, 231, 243, 0.1);
  --line-strong: rgba(234, 231, 243, 0.18);
  --tag-border: rgba(234, 231, 243, 0.13);
  --c-violet: #A78BFA;
  --c-cyan: #67E8F9;
  --c-green: #6EE7B7;
  --c-amber: #FCD34D;
  --c-pink: #F9A8D4;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --maxw: 1040px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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

h1, h2, h3, p, ul, ol {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 32px);
}

/* --- Skip link ---------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.skip-link:focus {
  top: 10px;
}

/* --- Sticky nav --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 17, 32, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
}

.brand {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--fg);
  transition: color 0.18s ease;
}

.brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: clamp(14px, 2.5vw, 26px);
  list-style: none;
  padding: 0;
}

.nav-links a {
  font-size: 0.84375rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

@media (max-width: 420px) {
  .nav-links {
    gap: 11px;
  }
  .nav-links a {
    font-size: 0.78125rem;
  }
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--bg);
}

.btn-mono {
  font-family: var(--mono);
  font-size: 0.84rem;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.ext {
  font-size: 0.78em;
  opacity: 0.55;
  transform: translateY(-1px);
  transition: opacity 0.18s ease;
}

.btn:hover .ext {
  opacity: 1;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding-top: clamp(84px, 16vh, 150px);
  padding-bottom: clamp(72px, 12vh, 120px);
}

.hero-name {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.hero-headline {
  margin-top: 22px;
  max-width: 17.5em;
  font-size: clamp(2.05rem, 1.1rem + 4vw, 3.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.hero-subline {
  margin-top: 24px;
  max-width: 40em;
  font-size: 1.0625rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.6s cubic-bezier(0.2, 0.6, 0.2, 1) backwards;
  }
  .hero > *:nth-child(2) { animation-delay: 0.07s; }
  .hero > *:nth-child(3) { animation-delay: 0.14s; }
  .hero > *:nth-child(4) { animation-delay: 0.21s; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Sections ----------------------------------------------------------- */

.section {
  padding-block: clamp(64px, 9vw, 96px);
  border-top: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: clamp(32px, 5vw, 44px);
}

.section-index {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* Each section's index gets its own pastel hue; skill-group labels cycle
   through the same palette. */
#about .section-index     { color: var(--c-violet); }
#projects .section-index  { color: var(--c-cyan); }
#skills .section-index    { color: var(--c-green); }
#education .section-index { color: var(--c-amber); }
#contact .section-index   { color: var(--c-pink); }

.skill-group:nth-child(5n + 1) .skill-label { color: var(--c-violet); }
.skill-group:nth-child(5n + 2) .skill-label { color: var(--c-cyan); }
.skill-group:nth-child(5n + 3) .skill-label { color: var(--c-green); }
.skill-group:nth-child(5n + 4) .skill-label { color: var(--c-amber); }
.skill-group:nth-child(5n + 5) .skill-label { color: var(--c-pink); }

/* --- About -------------------------------------------------------------- */

.about-text {
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg-soft);
}

/* --- Projects ----------------------------------------------------------- */

.project-list {
  list-style: none;
  padding: 0;
}

.project {
  padding-block: 34px;
  border-top: 1px solid var(--line);
}

.project:last-child {
  padding-bottom: 8px;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
}

.project-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 1.17rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.badge {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 5px;
  padding: 2px 8px;
  white-space: nowrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.project-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.project-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.project-date,
.edu-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.project-desc {
  margin-top: 12px;
  max-width: 70ch;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--fg-soft);
}

.project-metric {
  margin-top: 16px;
  max-width: 70ch;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--metric);
}

/* --- Tags --------------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  list-style: none;
  padding: 0;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* --- Skills ------------------------------------------------------------- */

.skills {
  display: grid;
  gap: 28px;
}

.skill-group .tags {
  margin-top: 10px;
}

.skill-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

@media (min-width: 720px) {
  .skill-group {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 0 28px;
    align-items: start;
  }
  .skill-label {
    padding-top: 7px;
  }
  .skill-group .tags {
    margin-top: 0;
  }
}

/* --- Education ---------------------------------------------------------- */

.edu-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
}

.edu-school {
  font-size: 1.17rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.edu-degree {
  margin-top: 4px;
  font-size: 0.98rem;
  color: var(--fg-soft);
}

.edu-coursework-label {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.edu .tags {
  margin-top: 10px;
}

/* --- Contact ------------------------------------------------------------ */

.contact-line {
  max-width: 32ch;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding-block: 26px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Scroll reveal (activated only when JS is present) ------------------ */

html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
