/* ============================================================
   Viktor Kertanov — Portfolio
   Editorial / serif design
   ============================================================ */

/* --- Fonts (self-hosted) --- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/eb-garamond-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/eb-garamond-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/eb-garamond-cyrillic-400-italic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/eb-garamond-latin-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Design tokens --- */

:root {
  --bg:           #FFFFFF;
  --bg-elevated:  #FAFAFA;
  --text:         #111111;
  --text-muted:   #666666;
  --rule:         #DCDCDC;
  --rule-strong:  #999999;

  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --container: 960px;
}

/* --- Reset / base --- */

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--text);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--text-muted); }

p { margin: 0 0 1.25rem 0; }

/* --- Typography --- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem 0;
}

h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}
h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
h3 { font-size: 1.25rem; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Layout --- */

.container-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

@media (max-width: 640px) {
  .container-main { padding: 2.5rem 1.25rem 4rem; }
  h1 { font-size: 2rem; margin-bottom: 1.75rem; }
  h2 { font-size: 1.35rem; }
}

/* --- Navigation --- */

.navbar {
  background-color: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
}
.navbar .container {
  max-width: var(--container);
  padding: 0 2rem;
}

.navbar-brand {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0;
}
.navbar-brand:hover { color: var(--text); }

.nav-link {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text) !important;
  margin-left: 2rem;
  padding: 0 !important;
  position: relative;
}
.nav-link:hover { color: var(--text-muted) !important; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  border-bottom: 1px solid var(--text);
}

.navbar-toggler {
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 0.35rem 0.6rem;
}
.navbar-toggler:focus { box-shadow: none; }

@media (max-width: 991px) {
  .nav-link { margin-left: 0; padding: 0.5rem 0 !important; }
  .navbar-collapse { padding-top: 1rem; }
}

/* --- Footer --- */

footer {
  border-top: 1px solid var(--rule);
  margin-top: 6rem;
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--sans);
  letter-spacing: 0.01em;
}
footer p { margin: 0; }

/* --- Portfolio grid --- */

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem 3rem;
  margin-top: 1rem;
}
@media (max-width: 720px) {
  .portfolio-grid { grid-template-columns: 1fr; gap: 3rem; }
}

.project-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.project-card:hover {
  color: inherit;
  border-color: var(--rule-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,0.18);
}

.project-card__thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background-color: var(--rule);
  margin-bottom: 0;
}
.project-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s ease, filter .4s ease;
  filter: saturate(0.95);
}
.project-card:hover .project-card__thumb img {
  transform: scale(1.02);
  filter: saturate(1);
}

.project-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.project-card__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.6rem 0;
  color: var(--text);
}

.project-card__desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 1rem 0;
}

.project-card__meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}
.project-card__meta .dot {
  display: inline-block;
  margin: 0 0.5rem;
  color: var(--rule-strong);
}

/* --- Project detail page --- */

.project-detail__back {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 2rem;
}
.project-detail__back:hover { color: var(--text); }

.project-detail__meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: -1.5rem 0 3rem 0;
  font-weight: 500;
}
.project-detail__meta .dot { color: var(--rule-strong); margin: 0 0.5rem; }

.content-block {
  margin-bottom: 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.content-block:last-child { margin-bottom: 0; }
.content-block p { margin: 0 0 1.25rem 0; }

.embed-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 1.5rem 0 2.5rem;
  background: var(--rule);
}
.embed-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* --- Carousel --- */

.carousel {
  position: relative;
  width: 100%;
  margin: 0 auto 2rem;
}
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.carousel-images {
  display: flex;
  transition: transform .4s ease;
}
.carousel-image {
  min-width: 100%;
  height: auto;
  display: block;
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}
.carousel-nav {
  background: transparent;
  border: 0;
  cursor: pointer;
  user-select: none;
  padding: 0.4rem 0.7rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--text);
  transition: color .15s ease, transform .15s ease;
}
.carousel-nav:hover { color: var(--text-muted); }
.carousel-nav:active { transform: scale(0.95); }
.carousel-counter {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  min-width: 4rem;
  text-align: center;
}
.carousel-caption {
  text-align: center;
  margin-top: 0.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* --- Buttons / text-links --- */

.btn-text {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: inline-block;
  text-decoration: none;
}
.btn-text::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -3px;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color .2s ease;
}
.btn-text:hover { color: var(--text); }
.btn-text:hover::after { border-color: var(--text); }
.btn-text .arrow { display: inline-block; margin-left: 0.4rem; transition: transform .25s ease; }
.btn-text:hover .arrow { transform: translateX(3px); }

/* Download link (e.g. CV PDF): same minimalist text-link, arrow nudges down */
.page-download { margin: -0.5rem 0 2.75rem; }
.btn-text.btn-download:hover .arrow { transform: translateY(3px); }

/* --- About / Statement (long-form text) --- */

.prose { max-width: 38rem; }

.prose-portrait {
  float: right;
  width: 200px;
  margin: 0.25rem 0 1.25rem 1.75rem;
  padding: 0;
}
.prose-portrait img {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 640px) {
  .prose-portrait {
    float: none;
    width: 60%;
    max-width: 240px;
    margin: 0 0 1.5rem 0;
  }
}
.prose p {
  font-size: 1.0625rem;
  line-height: 1.8;
  margin: 0 0 1.5rem 0;
}
.prose p:first-of-type::first-letter {
  /* subtle drop for the first letter of statement */
  font-family: var(--serif);
  font-size: 1.15em;
}
.prose section { margin-bottom: 3.5rem; }
.prose section:last-child { margin-bottom: 0; }
.prose h2 {
  margin-top: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.prose ul.timeline {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0 0;
}
.prose ul.timeline li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.55;
}
.prose ul.timeline li:last-child { border-bottom: 1px solid var(--rule); }
.prose ul.timeline li > strong {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-top: 0.15rem;
}
@media (max-width: 560px) {
  .prose ul.timeline li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* --- Contacts --- */

.contact-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0 0;
}
.contact-item {
  display: flex;
  align-items: center;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.contact-item:last-child { border-bottom: 1px solid var(--rule); }
.contact-icon {
  width: 28px; height: 28px;
  margin-right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.contact-icon svg { width: 22px; height: 22px; fill: currentColor; }
.contact-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.contact-link {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
  position: relative;
  display: inline-block;
}
.contact-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -1px;
  border-bottom: 1px solid var(--text);
  transition: right .3s cubic-bezier(.2,.7,.3,1);
}
.contact-link:hover { color: var(--text); }
.contact-link:hover::after { right: 0; }

/* --- Section divider --- */

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