/* ==========================================================
   Rashad Bayramov, portfolio styles
   1. Tokens   2. Base   3. Navigation   4. Hero   5. Buttons
   6. Sections   7. Projects   8. Experience   9. Skills
   10. Education   11. Footer   12. Responsive   13. Motion
   ========================================================== */


/* 1. Tokens (light theme by default, dark theme follows the device) */
:root {
  --bg: #f3f8f7;
  --surface: #ffffff;
  --ink: #12234a;
  --muted: #4a5b78;
  --line: #cfe3df;
  --accent: #0b7a68;
  --accent-soft: #dff1ed;
  --on-accent: #ffffff;
  --packet: #f5b942;

  --display: "Bricolage Grotesque", "Segoe UI", Helvetica, Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, Consolas, Menlo, monospace;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1d3a;
    --surface: #17274a;
    --ink: #e8f0ff;
    --muted: #a9b8d4;
    --line: #2a3d66;
    --accent: #5fd8c0;
    --accent-soft: #1b3358;
    --on-accent: #0f1d3a;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1d3a;
  --surface: #17274a;
  --ink: #e8f0ff;
  --muted: #a9b8d4;
  --line: #2a3d66;
  --accent: #5fd8c0;
  --accent-soft: #1b3358;
  --on-accent: #0f1d3a;
}


/* 2. Base */
html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.1;
}

p { margin: 0; }
a { color: inherit; }

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.mute { margin-top: 10px; color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Pill switch, used by the language toggle */
.pill {
  display: inline-flex;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 999px;
}

.pill button {
  padding: 6px 14px;
  border: 0;
  background: none;
  color: var(--accent);
  font: 700 0.85rem var(--display);
  cursor: pointer;
}

.pill button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}


/* 3. Navigation */
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
}

nav .mark { color: var(--ink); font-size: 1.05rem; font-weight: 800; }
nav .links { display: flex; flex-wrap: wrap; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }


/* 4. Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 48px 0 72px;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero .role {
  margin-top: 14px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 500;
}

.hero .lead { max-width: 34em; margin-top: 20px; color: var(--muted); }
.hero .clients { margin-top: 14px; font-family: var(--display); font-weight: 500; }

/* Photo frame: shows initials until a photo.jpg file is placed next to index.html */
.photo {
  position: relative;
  justify-self: center;
  width: min(100%, 320px);
  aspect-ratio: 4 / 5;
  margin: 0 18px 18px 0;
}

.photo::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  background: var(--accent-soft);
}

.photo .initials,
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
}

.photo .initials {
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font: 800 clamp(4rem, 12vw, 6rem) / 1 var(--display);
  letter-spacing: -0.04em;
}

.photo img { object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.photo img.ok { opacity: 1; }


/* 5. Buttons */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn {
  padding: 12px 22px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
}

.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { color: var(--accent); }


/* 6. Sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }

section > .wrap > h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sub { max-width: 38em; margin-bottom: 36px; color: var(--muted); }


/* 7. Projects: map on the left, details on the right */
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

#map { display: block; width: 100%; height: auto; }

.wr { fill: none; stroke: var(--line); stroke-width: 2; }
.wr.on { stroke: var(--accent); stroke-dasharray: 6 7; animation: run 1.4s linear infinite; }
@keyframes run { to { stroke-dashoffset: -26; } }

.core rect { fill: var(--accent); }
.ct { font: 800 20px var(--display); fill: var(--on-accent); }
.cs { font: 500 12px var(--display); fill: var(--on-accent); }

.nd { cursor: pointer; }
.nd rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; transition: fill 0.2s, stroke 0.2s; }
.nd:hover rect { stroke: var(--accent); }
.nd.on rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 3; }
.nd text { font: 700 14px var(--display); fill: var(--ink); pointer-events: none; }
.nd .s { font: 400 12px var(--body); fill: var(--muted); }
.pk { fill: var(--packet); }

#panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
}

#panel h3 { margin: 4px 0 10px; font-size: 1.4rem; font-weight: 700; }
#panel p { color: var(--muted); }
#panel .client { margin: 0; color: var(--accent); font-family: var(--display); font-weight: 500; }
#sample { margin-top: 18px; }
#panel .note { margin-top: 8px; font-size: 0.85rem; }

pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink);
  font: 0.85rem / 1.5 var(--mono);
}


/* 8. Experience timeline */
.tl { margin: 0; padding: 0 0 0 28px; border-left: 3px solid var(--accent); list-style: none; }
.tl > li { position: relative; padding-bottom: 36px; }
.tl > li:last-child { padding-bottom: 0; }

.tl > li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: -37px;
  width: 15px;
  height: 15px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.tl h3 { font-size: 1.25rem; font-weight: 700; }
.tl .where { margin: 2px 0 4px; color: var(--accent); font-weight: 600; }
.tl .when { color: var(--muted); font-family: var(--display); font-size: 0.9rem; font-weight: 500; }
.tl ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.tl ul li { padding-bottom: 6px; }


/* 9. Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.skills h3 { font-size: 1.05rem; font-weight: 700; }
.skills .chips { margin-top: 10px; }


/* 10. Education and languages */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.two h2 { margin-bottom: 20px; font-size: 1.6rem; font-weight: 800; }
.two h3 { margin-bottom: 4px; font-size: 1.1rem; font-weight: 700; }
.two p { color: var(--muted); }
.two .item { margin-bottom: 20px; }


/* 11. Footer */
footer { padding: 72px 0 56px; border-top: 1px solid var(--line); }
footer h2 { max-width: 14em; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.025em; }
footer small { display: block; margin-top: 48px; color: var(--muted); font-size: 0.9rem; }


/* 12. Responsive */
@media (max-width: 820px) {
  .hero, .lab, .two { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
}


/* 13. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wr.on { animation: none; }
}
