/* =========================================================================
   Muhammet Tunacan — personal site
   Minimal, elegant, light. Zero external dependencies.
   ========================================================================= */

/* ---- Design tokens ---------------------------------------------------- */
:root {
  --bg:        #f6f4ef;   /* warm off-white            */
  --bg-soft:   #fbfaf7;   /* lifted surfaces           */
  --ink:       #17150f;   /* near-black, warm          */
  --ink-soft:  #3a382f;
  --muted:     #6f6c61;   /* secondary text            */
  --faint:     #9a978c;
  --line:      rgba(23, 21, 15, 0.12);
  --line-soft: rgba(23, 21, 15, 0.07);
  --accent:    #b08d57;   /* muted antique gold        */
  --accent-ink:#8a6c3c;
  --accent-wash: rgba(176, 141, 87, 0.12);

  --maxw: 1080px;
  --pad: clamp(1.25rem, 5vw, 3rem);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
           Arial, "Apple Color Emoji", sans-serif;

  --shadow-sm: 0 1px 2px rgba(23, 21, 15, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(23, 21, 15, 0.22);
  --shadow-lg: 0 24px 60px -22px rgba(23, 21, 15, 0.28);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

/* Hide the language checkbox itself */
.lang-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Layout helpers --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.site { position: relative; z-index: 1; }

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 100;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* =========================================================================
   Language toggle (pure CSS — works without JS)
   Default = Türkçe visible. Checked = English visible.
   ========================================================================= */
.site [lang="en"] { display: none; }
#lang-toggle:checked ~ .site [lang="tr"] { display: none; }
#lang-toggle:checked ~ .site [lang="en"] { display: revert; }

/* =========================================================================
   Ambient background — soft gold orbs + fine grain
   ========================================================================= */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.ambient__orb--1 {
  width: 46vw; height: 46vw;
  top: -14vw; right: -10vw;
  background: radial-gradient(circle at 30% 30%, rgba(176,141,87,0.30), transparent 70%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.ambient__orb--2 {
  width: 40vw; height: 40vw;
  bottom: -16vw; left: -12vw;
  background: radial-gradient(circle at 60% 40%, rgba(120,140,150,0.22), transparent 70%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.ambient__grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: multiply;
}

@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-4vw,3vw,0) scale(1.08); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(3vw,-2vw,0) scale(1.12); } }

/* =========================================================================
   Header
   ========================================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.header.is-scrolled {
  border-bottom-color: var(--line-soft);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand { display: inline-flex; align-items: center; }
.brand__mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2.7rem; height: 2.7rem;
  display: grid; place-items: center;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.brand:hover .brand__mark {
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 1.75rem); }
.nav__link {
  position: relative;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 0.25rem 0;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav__link:hover::after,
.nav__link:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* Language switch (the visible pill) */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  background: var(--bg-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switch__opt {
  position: relative;
  z-index: 1;
  width: 2rem;
  text-align: center;
  padding: 0.15rem 0;
  color: var(--faint);
  transition: color 0.3s var(--ease);
}
.lang-switch__thumb {
  position: absolute;
  z-index: 0;
  top: 0.25rem; left: 0.25rem;
  width: 2rem;
  height: calc(100% - 0.5rem);
  background: var(--ink);
  border-radius: 999px;
  transition: transform 0.35s var(--ease);
}
/* TR active by default */
.lang-switch__opt--tr { color: var(--bg); }
/* EN active when toggled */
#lang-toggle:checked ~ .site .lang-switch__thumb { transform: translateX(2rem); }
#lang-toggle:checked ~ .site .lang-switch__opt--tr { color: var(--faint); }
#lang-toggle:checked ~ .site .lang-switch__opt--en { color: var(--bg); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  min-height: calc(100svh - 4.5rem);
  display: flex;
  align-items: center;
  padding-block: clamp(4rem, 12vh, 9rem);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.75rem, 7vw, 4.5rem);
  align-items: center;
  width: 100%;
}
.hero__text { max-width: 42rem; }

@media (min-width: 880px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

/* Portrait */
.hero__media { justify-self: center; width: 100%; max-width: 21rem; }
/* Clean photo: rounded corners, hairline edge, soft shadow — no decorative frame */
.portrait { position: relative; }
.portrait__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-lg);
  background: var(--bg);
}

.eyebrow {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  margin-bottom: 1rem;
  font-style: italic;
  font-family: var(--serif);
}

.hero__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.5rem;
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: manual;
}

.hero__tagline {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.25;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  max-width: 34rem;
}

.hero__lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
              background 0.3s var(--ease), color 0.3s var(--ease);
  will-change: transform;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: #000;
}
.btn__icon { transition: transform 0.3s var(--ease); }
.btn--primary:hover .btn__icon { transform: translateX(4px); }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}
.scroll-cue__line {
  width: 1px;
  height: 3.5rem;
  background: linear-gradient(to bottom, transparent, var(--faint));
  position: relative;
  overflow: hidden;
}
.scroll-cue__line::after {
  content: "";
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue { 0% { top: -100%; } 60%,100% { top: 100%; } }

/* =========================================================================
   Contact
   ========================================================================= */
.contact {
  position: relative;
  padding-block: clamp(5rem, 14vh, 9rem);
  border-top: 1px solid var(--line-soft);
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 1.5rem;
}
.section-eyebrow::before {
  content: "";
  width: 1.75rem; height: 1px;
  background: var(--accent);
}

.contact__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  max-width: 22ch;
  margin-bottom: 1.25rem;
}
.contact__lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.contact__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 2.5rem;
}
.email-link {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease);
  padding-bottom: 2px;
}
.email-link:hover, .email-link:focus-visible { background-size: 100% 1.5px; }

.copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 7.5rem;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.copy-btn__done { display: none; color: var(--accent-ink); }
.copy-btn.is-copied .copy-btn__default { display: none; }
.copy-btn.is-copied .copy-btn__done { display: inline; }

/* Socials */
.socials {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.social {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  background: var(--bg-soft);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.social svg { transition: color 0.3s var(--ease); }
.social:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.social:hover svg { color: var(--accent-ink); }

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 2.5rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font-size: 0.875rem;
}

/* =========================================================================
   404 page
   ========================================================================= */
.error { text-align: center; }
.error__inner { margin-inline: auto; }
.error__code {
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: var(--accent-ink);
  font-family: var(--serif);
  font-style: italic;
  margin-bottom: 1rem;
}
.error__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.error__title .dot { color: var(--accent-ink); }
.error__lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto 2.5rem;
}
.error__lead .alt { color: var(--faint); }
.error__actions { display: flex; justify-content: center; }

/* =========================================================================
   Reveal-on-scroll (added by JS only; no-JS shows everything)
   ========================================================================= */
.reveal-init {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-in { opacity: 1; transform: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 600px) {
  .nav { gap: 0.9rem; }
  .nav__link { display: none; }      /* keep mobile header minimal */
  .scroll-cue { display: none; }
  .contact__primary { padding: 1.25rem 0; }
}

/* =========================================================================
   Motion / contrast preferences
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal-init { opacity: 1; transform: none; }
}

@media (prefers-contrast: more) {
  :root { --muted: #4a473d; --line: rgba(23,21,15,0.3); }
}

/* Print */
@media print {
  .ambient, .header, .scroll-cue, .footer__note { display: none; }
  body { background: #fff; color: #000; }
}
