/* TANRU portfolio — shared styles (tokens, nav, footer, mail form)
   Every page loads this first, then its own css/<page>.css. */

:root {
  --bg: #ffffff;
  --ink: #411f20;
  --ink-50: rgba(65, 31, 32, 0.5);
  --grey: #9f9f9f;
  --kohkret: #f5f3e2;
  --page: 1440px;
  --edge: 37px;              /* left/right page margin in the design */
  --nav-h: 72.6px;           /* 8px offset + 64.6px bar */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans", system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: -0.03em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; font: inherit; }
img, video { display: block; max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* underlined text links: "All works", "back", "Download CV", "send" */
.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity .2s;
}
.text-link:hover { opacity: .55; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  margin-bottom: calc(-1 * var(--nav-h));   /* bar floats over the page, as in the design */
  padding-top: 8px;
  transition: background-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.nav {
  max-width: var(--page);
  height: 64.6px;
  margin: 0 auto;
  padding: 0 46px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo { width: 74px; height: 36.6px; margin-top: 4px; }
.nav__logo img { width: 100%; height: 100%; }
.nav__links { display: flex; transform: translateY(-5px); }
.nav__links li:nth-child(1) { width: 173px; }
.nav__links li:nth-child(2) { width: 156px; }
.nav__links a { transition: opacity .2s; }
.nav__links a:hover { opacity: .55; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--page);
  margin: var(--footer-gap, 235px) auto 0;
  padding: 0 var(--edge) 27px;
  display: flex;
  justify-content: space-between;
  min-height: 193px;
}
.footer__name {
  margin-top: 16px;
  font-size: 24px;
  line-height: 26px;
}
.footer__contacts {
  margin-top: 30px;
  font-weight: 200;
  line-height: 18px;
}
.footer__contacts a:hover { text-decoration: underline; }

/* ---------- Mail form (footer + contact page) ---------- */
.mail-form {
  display: grid;
  grid-template-columns: auto 327px;
  grid-template-rows: auto 1fr;
  column-gap: 23px;
  width: 451px;
}
.mail-form__title {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  margin-top: 19px;
  white-space: nowrap;
  font-size: 20px;
  line-height: 22px;
}
.mail-form__fields { grid-column: 2; grid-row: 1 / 3; }
.mail-form input,
.mail-form textarea {
  display: block;
  width: 100%;
  height: 49px;
  padding: 18px 0 9px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 200;
  line-height: 22px;
  letter-spacing: inherit;
  resize: none;
  overflow: hidden;
}
.mail-form ::placeholder { color: var(--ink-50); opacity: 1; }
.mail-form input:focus,
.mail-form textarea:focus { outline: none; border-bottom-width: 2px; padding-bottom: 8px; }
.mail-form__send {
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  margin-bottom: 17px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  line-height: 22px;
  letter-spacing: inherit;
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .footer { --footer-gap: 140px; }
}
@media (max-width: 900px) {
  .footer { flex-direction: column; gap: 48px; }
  .footer .mail-form { width: 100%; grid-template-columns: auto minmax(0, 1fr); }
}
@media (max-width: 700px) {
  :root { --edge: 16px; }
  .nav { padding: 0 16px; }
  .nav__logo { width: 56px; height: 27.7px; }
  .nav__links { gap: 20px; transform: none; }
  .nav__links li:nth-child(n) { width: auto; }
  .mail-form { width: 100%; grid-template-columns: 1fr; row-gap: 8px; }
  .mail-form__title, .mail-form__fields, .mail-form__send { grid-column: 1; grid-row: auto; justify-self: start; }
  .mail-form__fields { justify-self: stretch; }
  .mail-form__title { margin-top: 0; }
  .mail-form__send { margin-top: 16px; }
}
