/* ==========================================================================
   Artem Fedorovich — digital business card
   Mobile-first, no build step, vanilla CSS.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --ivory:        #FBF8F3;
  --ivory-deep:   #F5F0E8;
  --surface:      #FFFFFF;

  --ink:          #16191E;
  --ink-soft:     #3D444C;
  --muted:        #6A7178;

  --teal:         #2F6F68;
  --teal-deep:    #245853;
  --teal-tint:    #ECF3F2;

  --sand:         #E9DCC9;
  --sand-tint:    #FAF3E9;

  --line:         #E7E1D6;
  --line-strong:  #D8D0C2;

  --radius-sm:    10px;
  --radius:       16px;
  --radius-lg:    22px;

  --shadow-sm:    0 1px 2px rgba(22, 25, 30, .04),
                  0 2px 8px rgba(22, 25, 30, .04);
  --shadow-md:    0 2px 4px rgba(22, 25, 30, .04),
                  0 10px 28px rgba(22, 25, 30, .07);

  --measure:      64ch;
  --shell:        1060px;
  --gutter:       clamp(1.125rem, 5vw, 2.5rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 118px;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;          /* 17px — never tiny */
  line-height: 1.62;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .85rem 1.15rem;
  background: var(--ink);
  color: var(--ivory);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.25rem, 9vw, 5.5rem);
  border-top: 1px solid var(--line);
}
.section--plain { border-top: 0; }

.section__label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: .9rem;
}
.section__label::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--sand);
}

/* ---------- Typography ---------- */
.h1 {
  font-size: clamp(2.125rem, 8.5vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 680;
}
.h2 {
  font-size: clamp(1.5rem, 5.2vw, 2.125rem);
  line-height: 1.18;
  letter-spacing: -0.028em;
  font-weight: 660;
  max-width: 24ch;
}
.h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.lede {
  font-size: clamp(1.0625rem, 3.4vw, 1.1875rem);
  line-height: 1.68;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.prose {
  color: var(--ink-soft);
  max-width: var(--measure);
}
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 248, 243, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 14px rgba(22, 25, 30, .04);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--ivory);
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .02em;
}
.brand__name { font-size: 1rem; }

.nav { display: none; }
@media (min-width: 860px) {
  .nav {
    display: flex;
    align-items: center;
    gap: .35rem;
  }
  .nav a {
    display: inline-block;
    padding: .55rem .75rem;
    border-radius: 9px;
    font-size: .9375rem;
    font-weight: 550;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color .18s var(--ease), background-color .18s var(--ease);
  }
  .nav a:hover { color: var(--ink); background: var(--ivory-deep); }
  .nav a[aria-current="true"] { color: var(--teal-deep); background: var(--teal-tint); }
}

/* Mobile: lightweight horizontal anchor rail */
.navrail {
  position: sticky;
  top: 63px;   /* clears the header: 62px min-height + 1px border */
  z-index: 39;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 243, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.navrail__scroller {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: .5rem var(--gutter);
  scroll-snap-type: x proximity;
}
.navrail__scroller::-webkit-scrollbar { display: none; }
.navrail a {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: .55rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .9375rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.navrail a[aria-current="true"] {
  color: var(--teal-deep);
  border-color: rgba(47, 111, 104, .35);
  background: var(--teal-tint);
}
@media (min-width: 860px) { .navrail { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 54px;
  padding: .9rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease),
              color .18s var(--ease);
}
.btn svg { flex: 0 0 auto; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 1px 2px rgba(36, 88, 83, .18), 0 8px 20px rgba(36, 88, 83, .16);
}
.btn--primary:hover { background: var(--teal-deep); }

.btn--dark {
  background: var(--ink);
  color: var(--ivory);
  box-shadow: var(--shadow-sm);
}
.btn--dark:hover { background: #23282F; }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: #C3B9A6; background: #FFFDFA; }

.btn--quiet {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
  min-height: 50px;
  font-size: 1rem;
}
.btn--quiet:hover { color: var(--ink); border-color: var(--ink-soft); }

.btn--block { width: 100%; }

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.75rem;
}
.btn-group .btn { flex: 1 1 100%; }          /* stacked and thumb-sized on phones */

@media (min-width: 680px) {
  .btn-group { gap: .75rem; }
  .btn-group .btn { flex: 0 1 auto; }        /* natural width, wraps if needed */
  .btn-group .btn--block { flex: 1 1 100%; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 8vw, 4.75rem) clamp(3rem, 9vw, 5rem);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -180px -20% auto 35%;
  height: 460px;
  background: radial-gradient(closest-side, rgba(233, 220, 201, .5), transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.hero__grid { display: grid; gap: clamp(1.5rem, 5vw, 2.25rem); }
@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3.5rem;
  }
  .hero__media { order: 2; }
}

.portrait {
  width: clamp(116px, 34vw, 150px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ivory-deep);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
@media (min-width: 900px) { .portrait { width: 212px; } }

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.portrait--initials {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--ink) 0%, #232A31 100%);
  color: var(--ivory);
  font-size: clamp(2.25rem, 10vw, 3.25rem);
  font-weight: 600;
  letter-spacing: .04em;
}

.hero__eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: .38rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero__name { margin-bottom: .55rem; }

.hero__role {
  font-size: clamp(1.125rem, 4.2vw, 1.375rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--teal-deep);
  margin-bottom: .5rem;
}

.hero__descriptor {
  font-size: clamp(.9375rem, 3.4vw, 1.0625rem);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.35rem;
  letter-spacing: .005em;
}

.hero__rule {
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--sand);
  margin-bottom: 1.35rem;
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
@media (min-width: 720px) {
  .cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              border-color .22s var(--ease);
}

.card__kicker {
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: .7rem;
}
.card__title { margin-bottom: .35rem; }
.card__meta {
  color: var(--muted);
  font-size: .9688rem;
  margin-bottom: 1.25rem;
}
.card .btn { margin-top: auto; }

/* Work cards — the whole card is the link */
.work-card {
  position: relative;
  padding: 1.35rem;
  text-decoration: none;
  color: inherit;
}
.work-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.work-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.monogram {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--teal-tint);
  border: 1px solid rgba(47, 111, 104, .16);
  color: var(--teal-deep);
  font-size: .9375rem;
  font-weight: 680;
  letter-spacing: .01em;
}
.work-card__ext {
  color: var(--muted);
  transition: color .18s var(--ease), transform .18s var(--ease);
}
.work-card:hover .work-card__ext {
  color: var(--teal-deep);
  transform: translate(2px, -2px);
}
.work-card__name {
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: .2rem;
}
.work-card__label {
  color: var(--muted);
  font-size: .9688rem;
}

/* Topic cards */
.topics {
  display: grid;
  gap: .75rem;
  margin-top: 2rem;
  counter-reset: topic;
}
@media (min-width: 720px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.topic {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 550;
  letter-spacing: -0.012em;
  line-height: 1.45;
}
.topic::before {
  counter-increment: topic;
  content: counter(topic, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .05em;
  color: var(--teal-deep);
  background: var(--teal-tint);
  border-radius: 8px;
  padding: .22rem .45rem;
  margin-top: .2rem;
}

.invitation {
  margin-top: 1.75rem;
  padding: 1.25rem 1.35rem;
  border-left: 3px solid var(--sand);
  background: var(--sand-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* ---------- Contact ---------- */
.contact { background: var(--ivory-deep); }

.contact__panel {
  margin-top: 2rem;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.detail-list { display: grid; }
.detail {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.detail:first-child { padding-top: 0; }
.detail:last-child { border-bottom: 0; padding-bottom: 0; }
.detail__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--teal-tint);
  color: var(--teal-deep);
}
.detail__body { min-width: 0; }
.detail__label {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail__value {
  font-size: 1.0625rem;
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}
a.detail__value:hover { color: var(--teal-deep); text-decoration: underline; }

/* Extend the email/phone tap target to 44px without changing the layout. */
a.detail__value { position: relative; }
a.detail__value::after {
  content: "";
  position: absolute;
  inset: -11px 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.25rem 2.75rem;
  font-size: .9688rem;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 680px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.site-footer__name { color: var(--ink); font-weight: 600; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  padding: .4rem 0;
  font-weight: 550;
}
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Compact pages (WWC / Privacy) ---------- */
.compact {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-block: clamp(1.75rem, 7vw, 3.5rem);
}
.compact__main { flex: 1 0 auto; }

.card-sheet {
  max-width: 560px;
  margin-inline: auto;
  padding: clamp(1.5rem, 6vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.card-sheet .portrait { margin-inline: auto; }
.card-sheet .hero__rule { margin-inline: auto; }
.card-sheet .lede { text-align: left; }

.compact__topics {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: left;
}
.compact__topics h2 {
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .9rem;
}
.tick-list { display: grid; gap: .7rem; }
.tick-list li {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.tick-list svg { flex: 0 0 auto; margin-top: .3rem; color: var(--teal); }

.compact__foot {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.page-head, .page-body { max-width: 640px; margin-inline: auto; }
.page-body p { margin-bottom: 1.15rem; color: var(--ink-soft); }
.page-body p:last-child { margin-bottom: 0; }

/* ---------- Motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .btn:active { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .navrail, .btn-group, .site-footer { display: none; }
  body { background: #fff; }
  .card, .card-sheet, .contact__panel { box-shadow: none; }
}

/* ---------- Utilities ---------- */
.flow { margin-top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 860px) {
  html { scroll-padding-top: 84px; }
}

/* ---------- Centred footer (compact pages) ---------- */
.site-footer--center { border-top: 0; }
.site-footer--center .site-footer__inner {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.site-footer--center .footer-links { justify-content: center; }

.card-sheet__name { margin-top: 1.25rem; }
