/* ────────────────────────────────────────────────────────────
   Nik Gudkovs · nikgudkovs.pro
   Sticky-sidebar portfolio — restraint with presence
   ──────────────────────────────────────────────────────────── */

:root {
  --bg: #F6F4EF;
  --bg-2: #EFEDE7;
  --paper: #FBFAF6;

  --fg: #14130F;
  --fg-2: #2E2D29;
  --fg-3: #6D6A60;
  --fg-4: #9B9789;
  --fg-5: #C4C0B3;

  --rule: #DDD9CE;
  --rule-soft: #E8E4D8;

  --ink: #14130F;

  --font: "Geist", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(28px, 4vw, 56px);
}

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

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.003em;
  color: var(--fg-2);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
ul, ol { list-style: none; padding: 0; margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

a {
  color: var(--fg);
  text-decoration: none;
  position: relative;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3 { color: var(--fg); font-weight: 500; margin: 0; letter-spacing: -0.025em; }

/* ────────────── Frame ────────────── */
.frame {
  display: grid;
  grid-template-columns: 440px 1fr;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* ────────────── Sidebar ────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--pad);
  display: flex; flex-direction: column;
  gap: 32px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}

.sb-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.sb-meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sb-quick {
  display: inline-flex; align-items: center; gap: 6px;
}
.sb-quick-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--fg-3);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.sb-quick-btn:hover {
  border-color: var(--fg);
  color: var(--fg);
  transform: translateY(-1px);
}
.sb-quick-btn:active { transform: translateY(0); }
.sb-quick-btn svg {
  width: 14px; height: 14px;
}
.sb-meta .sb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg);
}
.sb-meta .sb-dot.is-live {
  background: #2D7A3E;
  box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.15);
}

.sb-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4/4.4;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(20, 19, 15, 0.04);
}
.sb-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: contrast(1.02);
}
.sb-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(20, 19, 15, 0.06);
  border-radius: inherit;
  pointer-events: none;
}

.sb-identity {
  display: flex; flex-direction: column;
  gap: 4px;
}
.sb-name {
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--fg);
}
.sb-role {
  font-size: 14.5px;
  color: var(--fg-3);
  letter-spacing: -0.005em;
  margin-top: 2px;
}

.sb-nav {
  display: flex; flex-direction: column;
  margin-top: 8px;
  border-top: 1px solid var(--rule-soft);
}
.sb-nav a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
  font-weight: 400;
  color: var(--fg-2);
  transition: color 0.18s ease, padding-left 0.25s ease;
}
.sb-nav a:hover { color: var(--fg); padding-left: 8px; }
.sb-nav a.is-active { color: var(--fg); font-weight: 500; }
.sb-nav a.is-active::before {
  font-family: var(--font-mono);
  content: "■";
  font-size: 9px;
  color: var(--fg);
}
.sb-nav .sb-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.04em;
}
.sb-nav .sb-arrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-4);
  transition: transform 0.25s ease, color 0.18s ease;
}
.sb-nav a:hover .sb-arrow { transform: translateX(4px); color: var(--fg); }

.sb-foot {
  margin-top: auto;
  display: flex; flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sb-foot a {
  color: var(--fg-3);
  transition: color 0.18s ease;
}
.sb-foot a:hover { color: var(--fg); }
.sb-foot .sb-foot-row { display: flex; justify-content: space-between; gap: 16px; }

/* ────────────── Content column ────────────── */
.content {
  padding: var(--pad) var(--pad) calc(var(--pad) * 1.4);
  max-width: 760px;
}

.intro {
  padding-top: clamp(16px, 4vw, 40px);
}

.intro-hello {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 24px;
  display: inline-flex; align-items: center; gap: 10px;
}
.intro-hello::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--fg-3);
}

.intro-lede {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.028em;
  font-weight: 400;
  color: var(--fg);
  margin: 0 0 32px;
  max-width: 19ch;
}
.intro-lede em {
  font-style: italic;
  color: var(--fg-3);
  font-weight: 400;
}

.intro-body {
  font-size: 17px;
  line-height: 1.62;
  color: var(--fg-2);
  max-width: 60ch;
  margin: 0 0 18px;
}
.intro-body strong { color: var(--fg); font-weight: 500; }
.intro-body:last-of-type { margin-bottom: 32px; }

.intro-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn svg { transition: transform 0.2s ease; opacity: 0.7; }
.btn:hover svg { opacity: 1; transform: translateX(3px); }

.btn-primary {
  background: var(--fg);
  color: var(--paper);
  border-color: var(--fg);
}
.btn-primary:hover { background: var(--fg-2); border-color: var(--fg-2); }

/* ────────────── Section ────────────── */
.section {
  margin-top: clamp(72px, 9vw, 112px);
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 32px;
}

.section-label {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-label .label-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
}
.section-label .label-text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.section-label .label-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ────────────── Work as case studies ────────────── */
.work {
  display: flex; flex-direction: column;
}

.case {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 36px 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: padding 0.3s ease;
}
.case:first-child { padding-top: 0; }
.case:last-child { border-bottom: 0; }

.case-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.case-top .case-period {
  display: inline-flex; align-items: center; gap: 8px;
}
.case-top .case-period.is-current {
  color: var(--fg);
  font-weight: 500;
}
.case-top .case-period.is-current::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: #2D7A3E;
  box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.15);
}
.case-top .case-tag {
  color: var(--fg-4);
}

.case-name {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.0;
  letter-spacing: -0.038em;
  font-weight: 500;
  color: var(--fg);
  margin: 4px 0 8px;
}
.case-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.case-link:hover { color: var(--fg-2); }
.case-link .case-mark {
  font-size: 0.36em;
  vertical-align: 0.7em;
  margin-left: 0.18em;
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-weight: 500;
  display: inline-block;
  transition: color 0.25s ease, transform 0.25s ease;
  letter-spacing: 0;
}
.case-link:hover .case-mark {
  color: var(--fg);
  transform: translate(0.1em, -0.1em);
}

.case-role {
  font-size: 15px;
  color: var(--fg-3);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}

.case-summary {
  font-size: 16px;
  line-height: 1.62;
  color: var(--fg-2);
  margin: 0 0 18px;
  max-width: 62ch;
}
.case-summary strong { color: var(--fg); font-weight: 500; }

.case-stack {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
.case-stack li {
  position: relative;
  letter-spacing: -0.005em;
}
.case-stack li:not(:last-child)::after {
  content: "·";
  margin-left: 14px;
  color: var(--fg-5);
}

/* ────────────── Stack lists ────────────── */
.stack {
  display: flex; flex-direction: column;
}
.stack-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.stack-row:first-child { padding-top: 0; }
.stack-row:last-child { border-bottom: 0; }

.stack-row dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 4px;
  font-weight: 500;
}
.stack-row dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-2);
}
.stack-row dd strong { color: var(--fg); font-weight: 500; }

@media (max-width: 520px) {
  .stack-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ────────────── Contact ────────────── */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  padding-top: 8px;
}
.c-row {
  display: flex; flex-direction: column;
  gap: 6px;
}
.c-row .c-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.c-row .c-value {
  font-size: 16px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.c-row .c-action {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--fg);
  cursor: pointer;
  transition: color 0.18s ease;
  text-align: left;
}
.c-row .c-action:hover { color: var(--fg-3); }
.c-row .c-action .c-copy {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-cta {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding: 24px 28px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  cursor: pointer;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background 0.25s ease;
}
.contact-cta:hover { background: #000; }
.contact-cta .cta-text {
  display: flex; flex-direction: column;
  gap: 4px;
}
.contact-cta .cta-line {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.contact-cta .cta-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(251, 250, 246, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-cta .cta-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(251, 250, 246, 0.2);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, border-color 0.25s ease;
}
.contact-cta:hover .cta-arrow { transform: rotate(-45deg); border-color: rgba(251, 250, 246, 0.5); }

.contact-chats {
  grid-column: 1 / -1;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chat-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.2s ease;
  position: relative;
}
.chat-btn svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: #fff;
}
.chat-btn .chat-text {
  display: flex; flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.chat-btn .chat-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
}
.chat-btn .chat-handle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.04em;
}
.chat-btn .chat-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
}
.chat-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.35);
}
.chat-btn:hover .chat-arrow {
  transform: translate(3px, -3px);
  color: #fff;
}
.chat-btn:active { transform: translateY(0); }

.chat-whatsapp { background: #25D366; }
.chat-whatsapp:hover { background: #1FBA59; }
.chat-telegram { background: #229ED9; }
.chat-telegram:hover { background: #1E8FC4; }

@media (max-width: 520px) {
  .contact { grid-template-columns: 1fr; }
  .contact-chats { grid-template-columns: 1fr; }
}

/* ────────────── Foot ────────────── */
.foot-row {
  margin-top: clamp(60px, 8vw, 96px);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.foot-row a { color: var(--fg-3); }
.foot-row a:hover { color: var(--fg); }

/* ────────────── Email copied toast ────────────── */
.email-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 10px;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.2,.7,.1,1), opacity 0.3s ease;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.15);
  max-width: calc(100% - 32px);
  letter-spacing: -0.005em;
}
.email-toast.is-show { transform: translate(-50%, 0); opacity: 1; }
.email-toast-icon {
  width: 14px; height: 14px;
  color: #4ADE80;
}
.email-toast-text {
  color: rgba(251, 250, 246, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
.email-toast-email { color: var(--paper); letter-spacing: -0.005em; }

/* ────────────── Responsive ────────────── */
@media (max-width: 980px) {
  .frame { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    gap: 24px;
  }
  .sb-photo { max-width: 240px; }
  .sb-nav { display: none; }
  .content { max-width: 100%; padding-top: 12px; }
}

@media (max-width: 520px) {
  .sb-photo { max-width: 180px; }
  .case-name { font-size: 32px; }
  .case-top { flex-wrap: wrap; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
