/* ============================================================
   Mustafa Bilen — Portfolio
   Theme: Pure black, minimal, editorial
   ============================================================ */

:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --bg-card: #0d0d0d;
  --line: #1a1a1a;
  --line-strong: #2a2a2a;
  --text: #f5f5f5;
  --text-dim: #9a9a9a;
  --text-muted: #5a5a5a;
  --accent: #ff3b30;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  --max: 1280px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

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

/* Subtle film grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--pad);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.scrolled {
  background: rgba(0, 0, 0, 0.85);
  border-bottom-color: var(--line);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .nav-links {
    gap: 1.1rem;
  }
  .nav-links a {
    font-size: 0.78rem;
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--pad) clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(0.3) contrast(1.05) brightness(0.65);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.95) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.1) 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow span {
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 1.75rem;
}

.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--text-dim);
  background: linear-gradient(90deg, var(--text) 0%, var(--text-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-dim);
  max-width: 540px;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--text);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.hero-scroll {
  position: absolute;
  right: var(--pad);
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  z-index: 2;
}

.scroll-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--text-muted), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  animation: scrollLine 2.4s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

@media (max-width: 640px) {
  .hero-scroll { display: none; }
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}

.marquee-track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2rem;
  white-space: nowrap;
  padding-right: 2rem;
  animation: marquee-scroll 20s linear infinite;
  will-change: transform;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  letter-spacing: -0.01em;
  color: var(--text);
}

.marquee-track span {
  display: inline-block;
}

.marquee-track span:nth-child(4n + 2),
.marquee-track span:nth-child(4n + 4) {
  color: var(--text-muted);
}

@keyframes marquee-scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

@media (max-width: 640px) {
  .marquee-track {
    animation-duration: 14s;
    gap: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Marquee animasyonu dekoratif değil — kimliğin bir parçası,
   bu yüzden reduced motion'da da çalışmaya devam etsin (yavaşlatılmış) */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: marquee-scroll 60s linear infinite !important;
  }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.section-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.section-num.light {
  color: var(--text-muted);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about-text .lead {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.about-text .lead strong {
  font-weight: 600;
  color: var(--text);
}

.about-text p:not(.lead) {
  color: var(--text-dim);
  font-size: 1.02rem;
  margin-bottom: 1rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.tags li {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-soft);
  transition: all 0.2s ease;
}

.tags li:hover {
  color: var(--text);
  border-color: var(--text);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.stat {
  background: var(--bg);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.2s ease;
}

.stat:hover {
  background: var(--bg-soft);
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

/* ============================================================
   PROJECTS
   ============================================================ */
.project-list {
  display: flex;
  flex-direction: column;
}

.project {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: clamp(2rem, 5vh, 3rem) 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: padding 0.3s ease;
}

.project:last-child {
  border-bottom: 1px solid var(--line);
}

.project::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s ease;
}

.project:hover::before {
  width: 3px;
}

.project-index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  padding-top: 0.5rem;
}

.project-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.project-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.project-head h3 sup {
  font-size: 0.4em;
  vertical-align: super;
  color: var(--text-muted);
}

.project-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.project-desc {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.project-desc strong {
  color: var(--text);
  font-weight: 600;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--bg-soft);
  transition: all 0.2s ease;
}

.project-link:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--bg-card);
  transform: translateY(-1px);
}

.project-link svg {
  transition: transform 0.2s ease;
}

.project-link:hover svg {
  transform: translate(2px, -2px);
}

@media (max-width: 640px) {
  .project {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .project-index {
    padding-top: 0;
  }
}

/* ============================================================
   ETHOS / BENCH IMAGE
   ============================================================ */
.ethos {
  position: relative;
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  align-items: stretch;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ethos-image {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  max-height: 460px;
}

.ethos-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(0.6) contrast(1.1) brightness(0.85);
  transition: transform 1s ease, filter 0.5s ease;
}

.ethos:hover .ethos-image img {
  transform: scale(1.04);
  filter: grayscale(0.3) contrast(1.1) brightness(0.95);
}

.ethos-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.ethos-content {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.ethos-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.ethos-content h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-dim);
}

.ethos-content p {
  color: var(--text-dim);
  font-size: clamp(0.95rem, 1.1vw, 1rem);
  max-width: 520px;
  line-height: 1.6;
}

.ethos-keys {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.ethos-keys > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

.ethos-keys strong {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.15em;
}

.ethos-keys span {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 880px) {
  .ethos {
    grid-template-columns: 1fr;
  }
  .ethos-image {
    min-height: 220px;
    max-height: 280px;
  }
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-lead {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.contact-link {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  transition: background 0.2s ease, padding 0.2s ease;
  min-width: 0;
}

.contact-link:hover {
  background: var(--bg-soft);
  padding-left: 1.75rem;
}

.contact-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

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

@media (max-width: 560px) {
  .contact-link {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
  }
  .contact-link:hover {
    padding-left: 1.25rem;
  }
  .contact-value {
    font-size: 0.98rem;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--pad);
}

.footer-row {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   GLOBAL RESPONSIVE OVERRIDES
   ============================================================ */

/* Tablet & smaller */
@media (max-width: 880px) {
  .section {
    padding: clamp(3.5rem, 9vh, 5rem) var(--pad);
  }
  .hero-title {
    font-size: clamp(2.2rem, 9vw, 4rem);
  }
  .hero-sub {
    font-size: 1rem;
  }
  .section-head {
    gap: 0.9rem;
  }
}

/* Phones */
@media (max-width: 640px) {
  :root {
    --pad: 1.1rem;
  }

  body {
    font-size: 15px;
  }

  .nav {
    padding: 0.9rem var(--pad);
  }
  .nav-logo {
    font-size: 0.85rem;
  }
  .nav-logo .dot {
    width: 6px;
    height: 6px;
  }
  .nav-links {
    gap: 1rem;
  }
  .nav-links a {
    font-size: 0.78rem;
  }

  .hero {
    padding-bottom: 3rem;
    align-items: flex-end;
  }
  .hero-bg img {
    object-position: center 25%;
  }
  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.97) 100%);
  }
  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
    margin-bottom: 1.25rem;
  }
  .hero-sub {
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
  }
  .hero-cta {
    width: 100%;
    gap: 0.6rem;
  }
  .btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0.85rem 1.2rem;
    font-size: 0.88rem;
  }
  .eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    margin-bottom: 1rem;
  }

  .marquee {
    padding: 0.85rem 0;
  }
  .marquee-track {
    font-size: 1.4rem;
    gap: 1.25rem;
  }

  .section-head {
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
  }
  .section-head h2 {
    font-size: 1.6rem;
  }

  .about-text .lead {
    font-size: 1.1rem;
  }
  .about-text p:not(.lead) {
    font-size: 0.98rem;
  }
  .tags {
    margin-top: 1.5rem;
  }
  .tags li {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
  }
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 1.25rem 1.1rem;
  }
  .stat-num {
    font-size: 1.6rem;
  }
  .stat-label {
    font-size: 0.7rem;
  }

  .project {
    padding: 1.75rem 0;
  }
  .project-head h3 {
    font-size: 1.4rem;
  }
  .project-tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
  }
  .project-desc {
    font-size: 0.97rem;
    margin-bottom: 1.1rem;
  }
  .project-link {
    font-size: 0.8rem;
    padding: 0.5rem 0.85rem;
  }

  .ethos-content {
    padding: 1.75rem 1.25rem 2rem;
  }
  .ethos-content h2 {
    font-size: 1.4rem;
  }
  .ethos-content p {
    font-size: 0.95rem;
  }
  .ethos-keys {
    gap: 1rem;
  }
  .ethos-keys span {
    font-size: 1rem;
  }
  .ethos-keys strong {
    font-size: 0.7rem;
  }

  .contact-lead {
    font-size: 1.4rem;
  }

  .footer {
    padding: 1.5rem var(--pad);
  }
  .footer-row {
    font-size: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .nav-links {
    gap: 0.75rem;
  }
  .nav-links a {
    font-size: 0.72rem;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .about-stats {
    grid-template-columns: 1fr;
  }
  .section-head h2 {
    font-size: 1.4rem;
  }
}
