/* ========================================
   SERAT SAAD - ACADEMIC SITE
   Warm dark minimal, Instrument Serif + DM Sans
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #0e0e10;
  --surface: #161618;
  --text: #c8c8cc;
  --text-muted: #6e6e76;
  --accent: #d4a853;
  --accent-dim: rgba(212, 168, 83, 0.12);
  --link: #d4a853;
  --link-hover: #f0cc6e;
  --border: rgba(255,255,255,0.06);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 168, 83, 0.3);
  transition: color 0.2s, border-color 0.2s;
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

img { max-width: 100%; }

/* ===================== NAV ===================== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(14, 14, 16, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #eee;
  border: none;
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  border: none;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: #eee;
}

/* ===================== LAYOUT ===================== */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 4.5rem 0 3rem;
}

section:first-of-type {
  padding-top: 8rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.2rem 0;
}

/* ===================== HERO ===================== */
.hero h1 {
  font-family: var(--serif);
  font-size: 3.8rem;
  font-weight: 400;
  color: #f0f0f0;
  line-height: 1.1;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  margin-bottom: 1.2rem;
}

.profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2rem;
  border: 2px solid rgba(212, 168, 83, 0.3);
  opacity: 0.92;
  transition: opacity 0.3s;
}
.profile-img:hover { opacity: 1; }

/* ===================== ICON LINKS ===================== */
.icon-links {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.icon-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.icon-links a:hover { color: var(--accent); }
.icon-links a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===================== SECTION LABEL ===================== */
.section-label {
  font-family: var(--serif);
  font-size: 2rem;
  color: #e0e0e0;
  margin-bottom: 1.8rem;
  letter-spacing: -0.01em;
}

/* ===================== CARD LIST (Research / Beyond) ===================== */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.card {
  display: block;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
  border-bottom: 1px solid var(--border); /* override <a> default */
}

.card:hover {
  border-color: rgba(212, 168, 83, 0.25);
  background: rgba(212, 168, 83, 0.04);
  transform: translateY(-2px);
}

.card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #e0e0e0;
  margin-bottom: 0.3rem;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.card-arrow {
  display: inline-block;
  margin-left: 0.3rem;
  color: var(--accent);
  font-size: 0.85rem;
  transition: transform 0.2s;
}

.card:hover .card-arrow {
  transform: translateX(3px);
}

/* ===================== DETAIL PAGE ===================== */
.detail-header {
  padding-top: 7rem;
  padding-bottom: 2rem;
}

.back-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  border: none;
}
.back-link:hover { color: var(--accent); }

.detail-header h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 400;
  color: #f0f0f0;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.detail-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.detail-meta a {
  font-size: 0.82rem;
}

.detail-body {
  padding-bottom: 4rem;
}

.detail-body p {
  margin-bottom: 1.2rem;
}

.detail-body img {
  border-radius: 8px;
  margin: 1.8rem 0;
  opacity: 0.92;
}

.detail-body .img-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -1rem;
  margin-bottom: 1.8rem;
}

/* ===================== PERSONAL / STORY ===================== */
.story-block {
  margin-bottom: 3rem;
}

.story-block h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: #e0e0e0;
  margin-bottom: 0.8rem;
  font-weight: 400;
}

.story-block p {
  margin-bottom: 1rem;
}

.story-img {
  border-radius: 8px;
  margin: 1.5rem 0;
  opacity: 0.9;
  transition: opacity 0.3s;
}
.story-img:hover { opacity: 1; }

.story-img-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -0.8rem;
  margin-bottom: 1.5rem;
}

/* ===================== FOOTER ===================== */
footer {
  padding: 3rem 0 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 600px) {
  html { font-size: 15px; }
  .hero h1 { font-size: 2.6rem; }
  nav { padding: 1rem 1.2rem; }
  .nav-links { gap: 1rem; }
  .container { padding: 0 1.2rem; }
  section:first-of-type { padding-top: 6.5rem; }
  .detail-header { padding-top: 5.5rem; }
  .card { padding: 1.1rem 1.2rem; }
}

/* ===================== INTERACTIVE SIMULATION ===================== */
.sim {
  margin: 2.6rem 0;
  padding: 1.5rem 1.5rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.sim-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: #e6e6e6;
  margin-bottom: 0.25rem;
}

.sim-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.sim canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #08080a;
  border: 1px solid var(--border);
  touch-action: none;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  margin-top: 1.1rem;
}

.sim-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 190px;
}

.sim-control label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.sim-control label b { color: var(--accent); font-weight: 500; }

.sim input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.13);
  outline: none;
}
.sim input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}
.sim input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: none;
}

.sim-btns { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.sim-btn {
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.sim-btn:hover { border-color: rgba(212,168,83,0.4); color: #eee; }
.sim-btn.active {
  background: var(--accent-dim);
  border-color: rgba(212,168,83,0.5);
  color: var(--accent);
}

.sim-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1rem;
  line-height: 1.6;
}
.sim-caption b { color: var(--accent); font-weight: 500; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { animation: fadeUp 0.7s ease-out both; }
section:nth-of-type(2) { animation: fadeUp 0.7s 0.08s ease-out both; }
section:nth-of-type(3) { animation: fadeUp 0.7s 0.14s ease-out both; }
section:nth-of-type(4) { animation: fadeUp 0.7s 0.2s ease-out both; }
.detail-header { animation: fadeUp 0.6s ease-out both; }
.detail-body { animation: fadeUp 0.6s 0.08s ease-out both; }
