/* ============================================
   Akif Yaldır — Portfolio
   Design tokens + shared shell (Agenlead style)
   Modern, dark-first, accent-driven
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Code:wght@400;500;600&family=Google+Sans+Text:wght@400;500;600&family=Google+Sans:wght@400;500;600;700;900&display=swap');

:root {
  /* Apple-style adaptive blue accent (light mode) */
  --accent: #0071E3;
  --accent-hover: #0062C4;
  --bg: #ffffff;
  --bg-2: #fff;
  --bg-3: #fbfbfd;
  --ink: #1d1d1f;
  --ink-dim: #6e6e73;
  --ink-faint: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.18);
  --g-sans: 'Google Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --g-text: 'Google Sans Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --g-code: 'Google Sans Code', ui-monospace, 'SF Mono', monospace;

  /* Legacy variables - mapped to new system for backward compatibility */
  --paper: var(--bg);
  --paper-soft: var(--bg-2);
  --paper-deep: var(--bg-3);
  --ink-soft: var(--ink-dim);
  --ink-muted: var(--ink-faint);
  --ink-whisper: var(--ink-faint);
  --rule: var(--line-strong);
  --rule-soft: var(--line);
  --sage: var(--accent);
  --sage-deep: var(--accent);
  --sage-tint: color-mix(in oklab, var(--accent) 15%, var(--bg));
  --terracotta: #C25D3A;
  --terracotta-tint: color-mix(in oklab, #C25D3A 15%, var(--bg));
  --gold: oklch(0.72 0.09 85);

  /* Legacy fonts - mapped to Google Sans */
  --serif: var(--g-sans);
  --sans: var(--g-text);
  --mono: var(--g-code);

  /* Layout */
  --container: 1280px;
  --container-tight: 1040px;
  --container-prose: 720px;
  --page-gutter: 32px;
  --page-gutter-mobile: 20px;
  --site-inline: var(--page-gutter);
  --card-padding: 28px;
  --card-padding-lg: 32px;
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-mode="dark"] {
  /* Brighter blue for dark surfaces — apple.com style */
  --accent: #2997FF;
  --accent-hover: #1A85F0;
  --bg: #000000;
  --bg-2: #000;
  --bg-3: #0a0a0c;
  --ink: #f5f5f7;
  --ink-dim: #a1a1a6;
  --ink-faint: #6e6e73;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);

  /* Legacy mappings for dark mode */
  --paper: var(--bg);
  --paper-soft: var(--bg-2);
  --paper-deep: var(--bg-3);
  --ink-soft: var(--ink-dim);
  --ink-muted: var(--ink-faint);
  --ink-whisper: var(--ink-faint);
  --rule: var(--line-strong);
  --rule-soft: var(--line);
  --sage-tint: color-mix(in oklab, var(--accent) 15%, var(--bg));
  --terracotta-tint: color-mix(in oklab, #C25D3A 15%, var(--bg));
}

@media (max-width: 768px) {
  :root {
    --site-inline: var(--page-gutter-mobile);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--g-text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow-x: clip;
  /* Stop the rubber-band "bounce" when scrolling past the top/bottom edge. */
  overscroll-behavior: none;
}

body {
  overflow-x: clip;
  overscroll-behavior: none;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* Typography utilities */
.eyebrow {
  font-family: var(--g-code);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.lede {
  font-family: var(--g-sans);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--ink-dim);
  font-weight: 400;
  letter-spacing: -0.005em;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-inline);
  padding-right: var(--site-inline);
}

.container-tight {
  width: 100%;
  max-width: var(--container-tight);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-inline);
  padding-right: var(--site-inline);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  box-sizing: border-box;
  font-family: var(--g-sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.625rem 2rem;
  min-height: 46px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: scale(1.02);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.btn--primary {
  color: #fff;
  font-weight: 600;
  background: var(--accent);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
}

.btn--secondary {
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.btn--secondary:hover {
  background: color-mix(in oklab, var(--ink) 6%, var(--bg));
}

.btn--text {
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn--text:hover:not(:disabled) {
  background: color-mix(in oklab, var(--ink) 6%, var(--bg));
  transform: none;
}

/* Square icon-only button (e.g. nav theme toggle) */
.btn--icon {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  flex-shrink: 0;
}

/* Nav */
#nav-mount {
  height: 48px;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--site-inline);
  font-family: var(--g-sans);
}

.nav .lg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 12.5px;
  color: var(--ink-dim);
  font-weight: 400;
}

.nav-links a {
  transition: color .25s ease;
  white-space: nowrap;
}

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

.nav .btn--sm {
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 16px;
  min-height: 36px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-cta-desktop {
    display: none;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  gap: 5px;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: color-mix(in oklab, var(--ink) 6%, var(--bg));
}

.hamburger-line {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px var(--site-inline);
  overflow-y: auto;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.mobile-menu-links a {
  font-family: var(--g-sans);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-dim);
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-menu-links a:first-child {
  border-top: 1px solid var(--line);
}

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
  color: var(--ink);
  padding-left: 12px;
}

.mobile-menu-links a.active {
  color: var(--accent);
}

.mobile-menu-cta {
  padding-top: 32px;
  margin-top: auto;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--g-code);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

.tag.accent {
  background: color-mix(in oklab, var(--accent) 12%, var(--bg));
  color: var(--accent);
  border-color: transparent;
}

.tag.terra {
  background: color-mix(in oklab, #C25D3A 12%, var(--bg));
  color: var(--terracotta);
  border-color: transparent;
}

/* Reveal — fade only, no vertical "dump" motion on scroll */
.reveal {
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(.2, .7, .2, 1);
}

.reveal.in {
  opacity: 1;
}

.reveal.d1 {
  transition-delay: .12s;
}

.reveal.d2 {
  transition-delay: .24s;
}

.reveal.d3 {
  transition-delay: .36s;
}

.reveal.d4 {
  transition-delay: .48s;
}

/* Section */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 24px;
  flex-wrap: wrap;
}

.section-head>* {
  min-width: 0;
}

.section-head h2 {
  font-family: var(--g-sans);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
}

.section-head h2 em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.section-head .eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head .counter {
  font-family: var(--g-code);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

@media (max-width: 640px) {
  .section-head {
    margin-bottom: 28px;
  }
}

/* Card */
.card {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease, border-color .35s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px color-mix(in oklab, var(--accent) 22%, transparent);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--line));
}

/* CTA */
.cta-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--g-sans);
}

/* Footer */
footer {
  background: var(--bg-2);
  margin-top: 80px;
  padding: 60px var(--site-inline) 30px;
  font-family: var(--g-sans);
  font-size: 12px;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
}

.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 30px;
}

.footer-grid h5 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-grid ul a:hover {
  color: var(--ink);
}

.footer-bottom {
  max-width: var(--container);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

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

@media (max-width: 768px) {
  footer {
    margin-top: 56px;
    padding: 48px var(--site-inline) 24px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}