/* ============================================================
   DESIGN TOKENS
   Palette: warm paper and near-black ink. The orange accent is
   kept small (logo dot, focus ring, link hover) so the project
   screenshots carry the colour.
   ============================================================ */
:root {
  --paper:        #f4f2ec;
  --paper-2:      #ebe8df;
  --card:         #fbfaf7;
  --ink:          #15171b;
  --ink-hover:    #2a2e36;
  --ink-2:        #4b5059;   /* secondary text on paper, ~7.4:1 */
  --line:         #dcd8ce;
  --line-strong:  #c6c1b4;

  --accent:       #ff5c1a;
  --accent-ink:   #b43c0c;   /* orange for text on paper, ~5.4:1 */

  --night-2:      #1f2228;
  --night-3:      #2a2e36;
  --night-text:   #eceae5;
  --night-muted:  #a7acb5;   /* ~8:1 on --ink */

  --radius:       14px;
  --shadow:       0 1px 0 rgba(21, 23, 27, .04), 0 18px 40px -20px rgba(21, 23, 27, .28);

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

section[id] { scroll-margin-top: var(--header-h); }

/* ============================================================
   TYPE
   ============================================================ */
h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 1.45rem + 1.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.lead {
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34em;
  text-wrap: pretty;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 48px;
  padding: .7em 1.3em;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--ink-hover); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--paper-2); border-color: var(--ink-2); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--dark { background: var(--night-2); color: var(--night-text); border-color: var(--night-3); }
.btn--dark:hover { background: var(--night-3); }
.btn--sm { min-height: 40px; padding: .55em 1em; font-size: .92rem; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 242, 236, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand__mark { width: 32px; height: 32px; }
.brand__name {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.header__link {
  font-size: .95rem;
  font-weight: 550;
  color: var(--ink-2);
  text-decoration: none;
}
.header__link:hover { color: var(--ink); }
@media (max-width: 419px) {
  .header__link { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: clamp(56px, 9vw, 116px) 0 clamp(48px, 7vw, 80px);
}
.hero h1 { max-width: 15em; margin-bottom: 22px; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* The one-line services under the hero */
.services {
  display: grid;
  gap: 22px;
  margin: clamp(56px, 8vw, 88px) 0 0;
  padding: 26px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
@media (min-width: 600px) {
  .services { grid-template-columns: repeat(2, 1fr); gap: 26px 40px; }
}
@media (min-width: 1040px) {
  .services { grid-template-columns: repeat(4, 1fr); }
}
.services li {
  color: var(--ink-2);
  font-size: .98rem;
  line-height: 1.5;
  max-width: 24em;
}
.services strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 650;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: clamp(64px, 9vw, 112px) 0;
  border-top: 1px solid var(--line);
}
.section--tint { background: var(--paper-2); }
.section h2 { margin-bottom: clamp(28px, 4vw, 44px); }

/* ============================================================
   WORK
   ============================================================ */
.work {
  display: grid;
  gap: 20px;
}
@media (min-width: 720px) {
  .work { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
a.project:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

.project__shot {
  aspect-ratio: 1200 / 667;
  overflow: hidden;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.project__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform .5s ease;
}
a.project:hover .project__shot img { transform: scale(1.025); }

.project__body {
  display: grid;
  gap: 6px;
  padding: 20px 22px 24px;
}
.project__head {
  display: grid;
  justify-items: start;
  gap: 2px;
  margin-bottom: 4px;
}
.project__meta {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: .9rem;
  color: var(--ink-2);
}
.project__meta .icon { width: 1em; height: 1em; }
a.project:hover .project__meta { color: var(--accent-ink); }
.project__body p { color: var(--ink-2); font-size: .98rem; line-height: 1.5; max-width: 36em; }

/* The bots card spans the full row: illustration left, text right. */
.project--wide { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .project--wide { flex-direction: row; }
  .project--wide .project__shot {
    flex: 0 0 calc(50% - 12px);   /* lines up with the column gap above */
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .project--wide .project__body { align-content: center; padding: 32px clamp(24px, 4vw, 48px); }
  .project--wide h3 { font-size: 1.35rem; }
}
.project__shot--chat {
  display: grid;
  place-items: center;
  aspect-ratio: auto;
  padding: clamp(24px, 4vw, 40px) 20px;
  background: var(--paper);
}

/* Telegram-style chat illustration. Colours follow Telegram's dark theme. */
.chat {
  width: min(100%, 360px);
  border-radius: 12px;
  overflow: hidden;
  background: #0e1621;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 16px 36px -16px rgba(21, 23, 27, .5);
}
.chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #17212b;
}
.chat__avatar {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #5288c1;
  font-weight: 650;
  font-size: 14px;
}
.chat__name { display: grid; line-height: 1.25; }
.chat__name b { font-size: 13.5px; font-weight: 600; }
.chat__name small { font-size: 12px; color: #7f91a4; }
.chat__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 16px;
}
.msg {
  align-self: flex-start;
  max-width: 82%;
  padding: 7px 10px;
  border-radius: 12px 12px 12px 4px;
  background: #182533;
}
.msg--me {
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
  background: #2b5278;
}
.msg time {
  float: right;
  margin: 5px 0 -3px 10px;
  font-size: 10.5px;
  color: #6d8299;
}
.msg--me time { color: #7da8d3; }
.keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 82%;
}
.keys span {
  padding: 7px 6px;
  border-radius: 8px;
  background: #1f3042;
  text-align: center;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(40px, 7vw, 80px) clamp(20px, 5vw, 60px);
  border-radius: 24px;
  background: var(--ink);
  color: var(--night-text);
  text-align: center;
}
.contact h2 { margin-bottom: 0; text-wrap: balance; }
.contact .lead { color: var(--night-muted); }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.contact__links .btn { overflow-wrap: anywhere; }

@media (max-width: 479px) {
  .contact__links { flex-direction: column; align-self: stretch; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: .9rem;
  color: var(--ink-2);
}
.footer__name { font-weight: 650; color: var(--ink); }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
