/* =========================================================
   Berkay Turancı — Personal Website
   Editorial bento grid · cream paper / ink / burnt orange
   ========================================================= */

:root {
	--paper: #f4f1ea;
	--paper-2: #ece7db;
	--card: #faf8f2;
	--card-hover: #ffffff;
	--ink: #1a1a1a;
	--ink-soft: #56514a;
	--ink-faint: #908a7e;
	--accent: #c2410c;
	--accent-2: #9a3412;
	--accent-wash: #f3e4da;
	--line: rgba(26, 26, 26, 0.14);
	--line-soft: rgba(26, 26, 26, 0.08);
	--shadow: 8px 8px 0 rgba(26, 26, 26, 0.9);
	--radius: 20px;
	--maxw: 1180px;
	--gap: 14px;

	--font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
	--font-body: 'Newsreader', Georgia, serif;
	--font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Dark theme — neutral graphite editorial */
html[data-theme="dark"] {
	--paper: #131315;
	--paper-2: #1b1b1e;
	--card: #1d1d20;
	--card-hover: #27272b;
	--ink: #ededee;
	--ink-soft: #b7b7bc;
	--ink-faint: #87878d;
	--accent: #f0743f;
	--accent-2: #f3895f;
	--accent-wash: #2a211b;
	--line: rgba(237, 237, 238, 0.14);
	--line-soft: rgba(237, 237, 238, 0.07);
}
html[data-theme="dark"] .nav.scrolled { background: rgba(19, 19, 21, 0.82); border-bottom-color: var(--line); }
html[data-theme="dark"] .chip { background: #f6f6f4; }
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .store:hover { color: #14110d; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	background-color: var(--paper);
	/* faint grain + a soft warm wash for atmosphere */
	background-image:
		radial-gradient(120% 80% at 100% 0%, rgba(194, 65, 12, 0.06), transparent 60%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 19px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }

/* shared card */
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 26px;
	position: relative;
}

/* ============ Top bar ============ */
.nav {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	height: 62px; display: flex; align-items: center;
	border-bottom: 1px solid transparent;
	transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.nav.scrolled {
	background: rgba(244, 241, 234, 0.82);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand {
	font-family: var(--font-display);
	font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em;
}
.brand .dot { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; gap: 20px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a {
	font-family: var(--font-mono);
	font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--ink-soft); position: relative; padding-bottom: 3px;
	transition: color .2s;
}
.nav-links a::after {
	content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
	background: var(--accent); transition: width .25s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.lang-toggle {
	display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden;
	font-family: var(--font-mono);
}
.lang-toggle button {
	border: 0; background: transparent; color: var(--ink); cursor: pointer;
	font: inherit; font-size: 0.72rem; font-weight: 500; padding: 5px 13px; transition: background .2s, color .2s;
}
.lang-toggle button.active { background: var(--ink); color: var(--paper); }

.theme-toggle {
	width: 34px; height: 34px; border-radius: 50%; flex: none;
	border: 1px solid var(--ink); background: transparent; color: var(--ink);
	cursor: pointer; display: grid; place-items: center; font-size: 0.85rem;
	transition: background .2s, color .2s, transform .3s;
}
.theme-toggle:hover { background: var(--ink); color: var(--paper); transform: rotate(18deg); }

/* ============ Hero ============ */
.hero { padding: 104px 0 26px; }
.hero-card { grid-column: span 8; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 38px 44px; overflow: hidden; }
.hero-photo { grid-column: span 4; padding: 0; overflow: hidden; min-height: 380px; }

.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-top .eyebrow { margin-bottom: 0; }
.hero-serial { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.hero-mid { display: flex; flex-direction: column; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 20px; }
.hero-loc { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--ink-faint); text-align: right; }

/* choreographed hero entrance */
.hero-anim { animation: heroRise .85s cubic-bezier(.2,.7,.2,1) both; }
.hero-top.hero-anim { animation-delay: .05s; }
.hero-mid h1.hero-anim { animation-delay: .16s; }
.hero-mid .role.hero-anim { animation-delay: .30s; }
.hero-mid .lead.hero-anim { animation-delay: .40s; }
.hero-mid .hero-cta.hero-anim { animation-delay: .50s; }
.hero-foot.hero-anim { animation-delay: .60s; }
@keyframes heroRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* scroll progress + editorial margin rules */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 200; }
.margin-lines { position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: var(--maxw); border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); pointer-events: none; z-index: -1; }

.eyebrow {
	font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--accent); display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px;
}
.eyebrow .pin { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(194,65,12,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(194,65,12,.45);} 70%{box-shadow:0 0 0 9px rgba(194,65,12,0);} 100%{box-shadow:0 0 0 0 rgba(194,65,12,0);} }

.hero h1 {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(3rem, 8vw, 6rem);
	line-height: 0.94; letter-spacing: -0.035em; margin: 0 0 18px;
	font-optical-sizing: auto;
}
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.hero .role {
	font-family: var(--font-mono); font-size: clamp(0.95rem, 2vw, 1.15rem);
	color: var(--ink-soft); margin: 0 0 22px; min-height: 1.5em; letter-spacing: 0.01em;
}
.hero .role .cursor { color: var(--accent); }
.hero .lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 48ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn {
	display: inline-flex; align-items: center; gap: 9px;
	font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.04em;
	padding: 13px 22px; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--ink); transition: transform .18s ease, box-shadow .2s, background .2s, color .2s;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--ink); background: var(--card); }

.socials { display: flex; gap: 9px; }
.socials a {
	width: 40px; height: 40px; display: grid; place-items: center;
	border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); font-size: 1rem;
	transition: transform .18s, color .2s, border-color .2s, background .2s;
}
.socials a:hover { transform: translateY(-3px); color: #fff; background: var(--accent); border-color: var(--accent); }

.hero-photo .frame { position: relative; width: 100%; height: 100%; }
.hero-photo img {
	width: 100%; height: 100%; object-fit: cover;
	filter: grayscale(1) contrast(1.05);
	transition: filter .5s ease, transform .6s ease;
}
.hero-photo .frame::after {
	content: ""; position: absolute; inset: 0; background: var(--accent);
	mix-blend-mode: multiply; opacity: .26; transition: opacity .5s ease;
}
.hero-photo:hover img { filter: grayscale(0) contrast(1); transform: scale(1.04); }
.hero-photo:hover .frame::after { opacity: 0; }

/* ============ Stats strip ============ */
.stats { margin-top: var(--gap); }
.stat { grid-column: span 3; display: flex; flex-direction: column; justify-content: space-between; min-height: 128px; }
.stat .num { font-family: var(--font-display); font-weight: 600; font-size: 2.8rem; line-height: 1; letter-spacing: -0.03em; }
.stat .num .u { color: var(--accent); }
.stat .lbl { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.stat.cta-stat { background: var(--ink); color: var(--paper); }
.stat.cta-stat .lbl { color: rgba(244,241,234,0.6); }
.stat.cta-stat .big { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.02em; }
.stat.cta-stat .big em { font-style: italic; color: var(--accent); }

/* ============ Marquee ============ */
.marquee { margin: 34px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; overflow: hidden; }
.marquee-track { display: flex; gap: 0; width: max-content; animation: scroll 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.01em; padding: 0 26px; white-space: nowrap; }
.marquee span i { color: var(--accent); font-style: normal; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============ Section heads ============ */
section.block { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.section-head .sec-no { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); letter-spacing: 0.05em; }
.section-head .kicker { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 4px; }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 5vw, 3rem); margin: 0; letter-spacing: -0.03em; line-height: 1; }
.section-head .from-right { margin-left: auto; align-self: flex-end; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.section-head .from-right a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s; }
.section-head .from-right a:hover { border-bottom-color: var(--accent); }

/* ============ Logo chip (fixes mixed-bg logos) ============ */
.chip { background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.chip img { max-width: 76%; max-height: 76%; object-fit: contain; }

/* ============ Experience ============ */
.work-grid > * { transition: transform .25s ease, box-shadow .25s ease, background .25s; }
.work-card { grid-column: span 4; display: flex; flex-direction: column; gap: 14px; }
.work-card.feature { grid-column: span 8; flex-direction: row; align-items: center; gap: 22px; background: var(--accent-wash); }
.work-card .chip { width: 60px; height: 60px; flex: none; }
.work-card.feature .chip { width: 90px; height: 90px; }
.work-card:hover { transform: translate(-3px,-3px); box-shadow: 6px 6px 0 var(--ink); background: var(--card-hover); }
.work-card .when { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--accent); }
.work-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 4px 0 2px; letter-spacing: -0.02em; line-height: 1.05; }
.work-card.feature h3 { font-size: 1.9rem; }
.work-card .what { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
.work-card .arrow { font-family: var(--font-mono); color: var(--ink-faint); font-size: 0.8rem; margin-top: auto; }
.work-card:hover .arrow { color: var(--accent); }

/* ============ Education ============ */
.edu-card { grid-column: span 4; transition: transform .25s, box-shadow .25s; }
.edu-card:hover { transform: translate(-3px,-3px); box-shadow: 6px 6px 0 var(--ink); }
.edu-card .chip { width: 64px; height: 64px; margin-bottom: 16px; }
.edu-card .years { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); letter-spacing: 0.05em; }
.edu-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 6px 0 8px; letter-spacing: -0.02em; line-height: 1.05; }
.edu-card .degree { font-weight: 500; margin: 0 0 4px; font-size: 1.02rem; }
.edu-card .meta { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.edu-card .badge { display: inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 11px; }

/* ============ Awards / certs ============ */
.aw-col { grid-column: span 6; }
.list-title { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px; display: flex; align-items: center; gap: 9px; }
.list-title::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.entry { display: grid; grid-template-columns: 50px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.entry:last-child { border-bottom: 0; }
.entry .chip { width: 46px; height: 46px; }
.entry .yr { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); }
.entry h4 { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin: 2px 0 2px; letter-spacing: -0.01em; }
.entry h4 a { background-image: linear-gradient(var(--accent),var(--accent)); background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s; padding-bottom: 1px; }
.entry h4 a:hover { background-size: 100% 2px; }
.entry p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ============ Projects ============ */
.proj-card { grid-column: span 4; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s, background .25s; }
.proj-card.wide { grid-column: span 6; }
.proj-card:hover { transform: translate(-3px,-3px); box-shadow: 6px 6px 0 var(--ink); background: var(--card-hover); }
.proj-card .tag { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.proj-card .tag b { color: var(--accent); font-weight: 500; }
.proj-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.28rem; margin: 0 0 8px; letter-spacing: -0.02em; line-height: 1.08; }
.proj-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; flex: 1; }
.store-badges { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.store {
	display: inline-flex; align-items: center; gap: 9px;
	border: 1px solid var(--ink); border-radius: 11px; padding: 7px 13px;
	background: transparent; color: var(--ink);
	transition: transform .18s ease, box-shadow .2s, background .2s, color .2s;
}
.store i { font-size: 1.25rem; line-height: 1; }
.store span { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.store small { font-family: var(--font-mono); font-size: 0.52rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.store strong { font-family: var(--font-body); font-weight: 600; font-size: 0.92rem; letter-spacing: -0.01em; }
.store:hover { transform: translate(-2px,-2px); box-shadow: 3px 3px 0 var(--ink); background: var(--ink); color: var(--paper); }
.store:hover small { color: rgba(244,241,234,0.6); }

.legal {
	margin: 26px 0 0; max-width: 70ch;
	font-family: var(--font-mono); font-size: 0.62rem; line-height: 1.7; letter-spacing: 0.02em;
	color: var(--ink-faint);
}

/* ============ Contact / footer ============ */
.footer { padding: 80px 0 46px; border-top: 1px solid var(--line); margin-top: 40px; }
.footer .kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.footer h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 8vw, 5rem); margin: 0 0 6px; letter-spacing: -0.035em; line-height: 0.98; }
.footer h2 em { font-style: italic; color: var(--accent); }
.footer .lead { color: var(--ink-soft); max-width: 46ch; margin: 14px 0 26px; }
.footer .mail { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2.2rem); letter-spacing: -0.02em; background-image: linear-gradient(var(--accent),var(--accent)); background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 100%; padding-bottom: 4px; transition: background-size .3s; }
.footer .mail:hover { background-size: 0% 2px; }
.footer .foot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 40px; flex-wrap: wrap; }
.copyright { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); line-height: 1.7; }
.copyright a:hover { color: var(--accent); }

/* Back to top */
.to-top {
	position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 14px;
	border: 1px solid var(--ink); background: var(--paper); color: var(--ink); display: grid; place-items: center;
	cursor: pointer; font-size: 1rem; opacity: 0; transform: translateY(16px); pointer-events: none;
	transition: opacity .3s, transform .3s, background .2s, color .2s; z-index: 90;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Reveal (load + scroll) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 920px) {
	.nav-links .nav-only { display: none; }
	.hero-card { grid-column: 1 / -1; padding: 34px; }
	.hero-photo { grid-column: 1 / -1; min-height: 300px; order: -1; }
	.stat { grid-column: span 6; }
	.work-card, .work-card.feature, .edu-card, .proj-card, .proj-card.wide, .aw-col { grid-column: 1 / -1; }
	.work-card.feature { flex-direction: row; }
}
@media (max-width: 560px) {
	body { font-size: 18px; }
	.nav-links { display: none; }
	.stat { grid-column: 1 / -1; }
	.work-card.feature { flex-direction: column; align-items: flex-start; }
	.section-head { flex-wrap: wrap; }
	.section-head .from-right { display: none; }
	.card { padding: 22px; }
	/* photo was full-bleed and too tall on phones — shrink & center to ~80% */
	.hero-photo { max-width: 80%; margin: 0 auto; min-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; }
	.marquee-track { animation: none !important; }
}
