/* portfolio.slpdt.online - Serhii Puzko */

:root {
  --mist: #edf0f3;
  --paper: #f8f9fb;
  --ink: #141c33;
  --ink-soft: #48526b;
  --cobalt: #2a45e8;
  --teal: #0f9e8a;
  --line: rgba(20, 28, 51, 0.14);

  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Geologica", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(20px, 6vw, 96px);
  --col: 34rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--mist);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 3D stage ---------- */

.stage {
  position: fixed;
  inset: 0;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.no-webgl .stage {
  background:
    radial-gradient(40vmax 40vmax at 72% 40%, rgba(42, 69, 232, 0.16), transparent 70%),
    radial-gradient(30vmax 30vmax at 82% 64%, rgba(15, 158, 138, 0.14), transparent 70%);
}

/* ---------- header ---------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(14px + var(--safe-top)) var(--gutter) 14px;
  background: color-mix(in srgb, var(--mist) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}

.mark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.top nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  font-size: 0.95rem;
  font-weight: 450;
}

.top nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0;
}

.top nav a:hover { color: var(--ink); }

/* ---------- layout ---------- */

main {
  position: relative;
  z-index: 1;
}

.panel-host {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 80px;
}

.panel { max-width: var(--col); }

/* ---------- hero ---------- */

.hero { position: relative; }

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.05rem, 4.9vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 13.5ch;
  text-wrap: balance;
}

.hero .panel { max-width: 44rem; }

.lead {
  margin: 1.6rem 0 0;
  max-width: 33rem;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  color: var(--ink-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover { background: var(--ink); color: var(--mist); }

.btn-primary { background: var(--ink); color: var(--mist); }
.btn-primary:hover { background: var(--cobalt); border-color: var(--cobalt); }

.cue {
  position: absolute;
  left: var(--gutter);
  bottom: calc(28px + var(--safe-bottom));
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- projects ---------- */

.section-title {
  margin: 0;
  padding: 18vh var(--gutter) 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.02em;
}

.meta {
  margin: 0 0 0.6rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--cobalt);
}

h3 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.chapter p { margin: 0; color: var(--ink-soft); }

.facts {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.7rem;
}

.facts li {
  position: relative;
  padding-left: 1.4rem;
  line-height: 1.45;
  font-weight: 400;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.55rem;
  height: 2px;
  background: var(--teal);
}

.chapter .stack {
  margin-top: 1.2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.link {
  display: inline-block;
  margin-top: 1.3rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--cobalt);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}

.link:hover { color: var(--ink); }

.chapter .note {
  margin-top: 0.7rem;
  font-size: 0.9rem;
}

/* ---------- before / contact ---------- */

.before h2,
.contact h2 {
  margin: 0 0 1.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.history {
  margin: 0;
  display: grid;
  gap: 1.3rem;
}

.history div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.history dt {
  font-weight: 500;
  color: var(--ink);
}

.history dd {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
}

.contact p { margin: 0; color: var(--ink-soft); }

.contact-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 2.8rem);
  letter-spacing: -0.035em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 10px;
  color: var(--ink);
}

.contact-link:hover { color: var(--cobalt); }

.contact .link { display: block; width: fit-content; }

.foot {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter) calc(32px + var(--safe-bottom));
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.foot p { margin: 0; }

/* ---------- small screens: shape on top, text on a frosted panel below ---------- */

@media (max-width: 899px) {
  .top nav a:nth-child(2) { display: none; }

  .panel-host {
    justify-content: flex-end;
    padding: 52svh 16px calc(24px + var(--safe-bottom));
  }

  .panel {
    max-width: none;
    padding: 22px 20px 24px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--paper) 84%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    backdrop-filter: blur(16px) saturate(1.15);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -24px rgba(20, 28, 51, 0.35);
  }

  .hero.panel-host { padding-top: 44svh; padding-bottom: calc(64px + var(--safe-bottom)); }
  .hero .panel { padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .cue { display: none; }

  .section-title { padding: 14svh 16px 0; }
  .foot { padding-left: 16px; padding-right: 16px; }

  .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 380px) {
  .mark { font-size: 0.85rem; }
  .top nav { gap: 12px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
