@font-face {
  font-family: Archivo;
  src: url("archivo-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("archivo-semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("archivo-extrabold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fcf7f2;
  --ink: #25191a;
  --muted: #615253;
  --line: #dfd1ca;
  --red: #b92128;
  --red-dark: #761c23;
  --burgundy: #3b171a;
  --panel-glow: #521d23;
  --contact-glow: #71232c;
  --white: #fffdf8;
  --blush: #ffd1cb;
  --about: #f5e9e2;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(20px, 5vw, 76px);
  --display-tracking: -.04em;
  font: 400 1rem/1.55 Archivo, sans-serif;
  background: var(--paper);
  color: var(--ink);
  scrollbar-color: #ba8c89 var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure, ul, dl, dd { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
::selection { background: var(--blush); color: var(--burgundy); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
[id] { scroll-margin-top: 20px; }
#main:focus { outline: none; }

.wrap {
  width: min(1240px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: var(--gutter);
  padding: 12px 18px;
  background: var(--white);
  color: var(--burgundy);
  transform: translateY(calc(-100% - 20px));
}

.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 44px;
  font-size: 1.27rem;
  font-weight: 800;
  letter-spacing: -.033em;
  text-decoration: none;
}

.site-nav, .languages {
  display: flex;
  align-items: center;
}

.site-nav { gap: clamp(18px, 3vw, 41px); }

.site-nav a, .languages a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover, .languages a:hover { text-decoration: underline; }
.languages { justify-self: end; }

.languages a {
  justify-content: center;
  min-width: 44px;
  color: var(--muted);
  font-size: .78rem;
}

.languages [aria-current] {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 78px);
  padding-block: clamp(52px, 5.8vw, 88px) clamp(58px, 6vw, 98px);
}

h1, h2, h3 {
  font-weight: 800;
  letter-spacing: var(--display-tracking);
}

h1 {
  font-size: clamp(3.1rem, 6.8vw, 6rem);
  line-height: .99;
}

h1 span { display: block; }
h1 span + span { color: var(--red); }
:lang(ro) h1 { font-size: clamp(2.65rem, 5.45vw, 5.1rem); }

.hero-intro {
  max-width: 45ch;
  margin-top: 28px;
  font-size: clamp(1rem, 1.58vw, 1.25rem);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 30px;
}

.button, .text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  min-height: 48px;
  font-weight: 600;
}

.button {
  padding: 11px 17px;
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  transition: background-color 180ms var(--ease-out);
}

.button:hover { background: var(--red-dark); }
.text-link { color: var(--red); text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }

.arrow {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: inline-block;
  --arrow-shift: 3px 0;
}

.arrow::before, .arrow::after { content: ""; position: absolute; }
.arrow::before { top: 7px; left: 2px; width: 11px; height: 1.5px; background: currentColor; }
.arrow::after { top: 4px; right: 3px; width: 7px; height: 7px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.arrow-down { rotate: 90deg; --arrow-shift: 0 3px; }
.arrow-up { rotate: -90deg; --arrow-shift: 0 -3px; }
.arrow-diagonal { rotate: -45deg; --arrow-shift: 2px -2px; }

.studio-panel {
  background: var(--burgundy);
  box-shadow: 0 14px 34px #52212520;
}

.hero-art {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 2.25;
  min-height: 132px;
  overflow: hidden;
  background: var(--red-dark);
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 53%;
}

.motion-toggle {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--blush);
  border-radius: 50%;
  background: var(--burgundy);
  color: var(--white);
  cursor: pointer;
}

.motion-toggle:not([hidden]) { display: grid; }
.motion-toggle:hover { background: var(--red-dark); }
.motion-toggle:focus-visible { outline-color: var(--white); outline-offset: 3px; }

.motion-icon {
  width: 12px;
  height: 14px;
  border-inline: 3px solid currentColor;
}

[data-paused="true"] .motion-icon {
  border: 0;
  background: currentColor;
  clip-path: polygon(18% 0, 100% 50%, 18% 100%);
}

.portfolio-index {
  padding: 17px clamp(18px, 2.6vw, 34px) 11px;
  background: linear-gradient(145deg, var(--panel-glow), var(--burgundy) 76%);
  color: var(--white);
}

.portfolio-index p {
  font-size: .75rem;
  font-weight: 600;
  color: var(--blush);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.portfolio-index ul { padding: 0; list-style: none; margin-top: 11px; }
.portfolio-index li { border-top: 1px solid #ffd1cb38; }

.portfolio-index a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 13px;
  min-height: 60px;
  text-decoration: none;
  transition: background-color 180ms var(--ease-out);
}

.portfolio-index a:hover { background: #ffd1cb16; }
.portfolio-index a:hover strong { text-decoration: underline; text-underline-offset: .15em; }
.portfolio-index .arrow { color: var(--blush); }

.index-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 7px;
}

.index-icon img { width: 26px; height: 26px; object-fit: contain; }
.index-icon.pulsika { background: #ffdcd0; }
.index-icon.elvpro { background: #e3f2f6; }
.index-icon.leafminder { background: #e9f1d4; }

.index-project { display: grid; gap: 1px; line-height: 1.25; }
.index-project strong { font-size: 1.14rem; font-weight: 800; }
.index-project span { font-size: .81rem; color: var(--blush); }

.portfolio-index .index-location {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding-top: 6px;
  border-top: 1px solid #ffd1cb38;
  letter-spacing: .035em;
  text-transform: none;
}

.index-location > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blush);
}

.projects { border-top: 1px solid var(--line); padding-bottom: clamp(50px, 7vw, 100px); }
.projects > h2 { padding: 27px 0 26px; font-size: clamp(1.9rem, 3.45vw, 3rem); line-height: 1.05; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  align-items: center;
  gap: clamp(29px, 6.6vw, 105px);
  border-top: 1px solid var(--line);
  padding-block: clamp(31px, 5vw, 63px);
}

.project:last-child { border-bottom: 1px solid var(--line); }
.project:target { border-top-color: var(--red); }
.project-logo {
  width: min(100%, var(--wordmark-size, 220px));
  height: auto;
}

.project.pulsika { --wordmark-size: clamp(176px, 18vw, 236px); }
.project.elvpro { --wordmark-size: clamp(162px, 16vw, 210px); }
.project.leafminder { --wordmark-size: clamp(210px, 22vw, 280px); }

.project-headline { margin-top: 9px; font-size: clamp(1.05rem, 1.63vw, 1.33rem); font-weight: 600; line-height: 1.28; }
.project-description { margin-top: 17px; max-width: 56ch; color: var(--muted); }

.features {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 19px 0 11px;
  font-size: .9rem;
}

.features li { display: flex; gap: 9px; align-items: baseline; }
.features li::before { content: ""; flex: 0 0 10px; height: 1px; background: var(--red); transform: translateY(-.22em); }

.preview-link {
  display: block;
  color: var(--red);
  text-decoration: none;
}

.preview {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  height: clamp(265px, 34vw, 440px);
  padding: clamp(19px, 3.2vw, 45px);
  background: linear-gradient(145deg, var(--preview-light, var(--paper)), var(--preview-paper, #f3e5db) 88%);
}

.preview::before {
  position: absolute;
  z-index: -1;
  inset: clamp(10px, 1.35vw, 19px);
  border: 1px solid var(--preview-rule, #d9c6ba);
  content: "";
}

.preview-main,
.preview-detail {
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 12px 28px #3f26232e;
}

.preview-main {
  width: auto;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.has-detail .preview-main {
  max-width: 92%;
  translate: -5% -4%;
}

.preview-detail {
  position: absolute;
  right: clamp(14px, 3vw, 42px);
  bottom: clamp(14px, 2vw, 28px);
  width: 29%;
  height: auto;
  outline: 1px solid #37222320;
}

.preview-open {
  position: absolute;
  top: clamp(12px, 1.7vw, 24px);
  right: clamp(12px, 1.7vw, 24px);
  display: grid;
  place-items: center;
  width: clamp(34px, 3vw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--white);
  color: var(--red);
  box-shadow: 0 4px 14px #3f26232e;
}

.preview-link:is(:hover, :focus-visible) .preview-open {
  background: var(--red);
  color: var(--white);
}

.pulsika .preview { --preview-light: #fdf0e8; --preview-paper: #f7ddd0; --preview-rule: #dba993; }
.elvpro .preview { --preview-light: #f0f7f7; --preview-paper: #dce9eb; --preview-rule: #a9c3c9; }
.leafminder .preview { --preview-light: #f3f7ea; --preview-paper: #e3ecd9; --preview-rule: #b4c7a5; }

.elvpro .preview-detail { width: 37%; }

.leafminder .preview-detail {
  width: clamp(64px, 23%, 146px);
  border-radius: 13px;
  box-shadow: 0 12px 28px #1c391f36;
}

.project figcaption {
  display: flex;
  gap: 7px;
  padding-top: 10px;
  font-size: .8rem;
  color: var(--muted);
}

.about { background: var(--about); }
.about-inner, .contact-inner { display: grid; gap: 30px clamp(34px, 6vw, 92px); grid-template-columns: 1.2fr 1fr; }
.about-inner { padding-block: clamp(50px, 7vw, 99px); }
.about h2, .contact h2 { font-size: clamp(2.35rem, 4.5vw, 4.1rem); line-height: 1.03; text-wrap: balance; }
.about p, .contact p { max-width: 55ch; margin-top: 18px; font-size: 1.075rem; }
.about p, .about dd { color: var(--muted); }
.about dl > div { padding: 17px 0; border-top: 1px solid var(--line); }
.about dl > div:last-child { border-bottom: 1px solid var(--line); }
.about dt { font-weight: 800; font-size: 1.12rem; }
.about dd { margin-top: 4px; }

.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 92% 25%, var(--contact-glow), var(--burgundy) 64%);
  color: var(--white);
}

.contact-inner { align-items: center; padding-block: clamp(46px, 6vw, 80px); }
.contact h2 { text-wrap: initial; }
.contact p { color: var(--blush); }
.contact-methods { display: grid; justify-items: start; justify-self: end; font-style: normal; }
.contact-button { background: var(--white); color: var(--burgundy); }
.contact-button:hover { background: var(--blush); }
.contact-phone { color: var(--white); }
.contact .motion-toggle { inset: auto var(--gutter) 12px auto; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 22px;
  min-height: 94px;
  padding-block: 12px;
  font-size: .85rem;
}

.footer p { font-weight: 600; }
.footer p span { margin-inline-start: 12px; color: var(--muted); font-weight: 400; }

@media (min-width: 761px) {
  .project:nth-of-type(even) {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }

  .project:nth-of-type(even) .project-copy { grid-column: 2; grid-row: 1; }
  .project:nth-of-type(even) .project-figure { grid-column: 1; grid-row: 1; }

  .contact::before {
    position: absolute;
    z-index: -1;
    inset: 0 0 0 auto;
    width: min(42%, 530px);
    background: url("studio-fold-small.webp") center right / cover;
    opacity: .3;
    mask-image: linear-gradient(90deg, transparent 2%, var(--ink) 85%);
    content: "";
  }
}

@media (max-width: 950px) {
  .hero { gap: 27px; }
  .hero-actions { gap: 8px 18px; }
  .project { gap: 34px; }
}

@media (max-width: 760px) {
  .header-inner { min-height: 66px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-block: 49px 52px; }
  h1 { font-size: clamp(3rem, 10vw, 5rem); }
  :lang(ro) h1 { font-size: clamp(2.72rem, 8.7vw, 4.7rem); }
  .hero-intro { margin-top: 21px; }
  .hero-actions { margin-top: 21px; }
  .hero-art { aspect-ratio: 2.6; }
  .portfolio-index { padding-inline: 18px; }
  .project { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .preview { height: clamp(215px, (100vw - 2 * var(--gutter)) / 1.58, 410px); }
  .about-inner, .contact-inner { grid-template-columns: minmax(0, 1fr); }
  .contact-methods { justify-self: start; }
}

@media (max-width: 520px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 0 8px; padding-top: 6px; }
  .site-nav { grid-area: 2 / 1 / 3 / -1; gap: 23px; border-top: 1px solid var(--line); }
  .languages { grid-area: 1 / 2; }
  .footer p span { display: block; margin-inline-start: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: unfold 980ms var(--ease-out) both; }
  .hero-art::after {
    position: absolute;
    z-index: 1;
    inset: -24%;
    background: linear-gradient(139deg, transparent 32%, #ffd5b600 42%, #ffd5b66f 50%, #fa50332b 56%, transparent 67%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: background-sweep 9s ease-in-out infinite paused;
    content: "";
  }

  .contact::after {
    position: absolute;
    z-index: -1;
    top: -56%;
    right: -14%;
    width: clamp(340px, 66vw, 970px);
    height: 192%;
    background: radial-gradient(ellipse, #c3394466, #8d243545 43%, transparent 70%);
    pointer-events: none;
    animation: background-glow 13s ease-in-out infinite paused;
    content: "";
  }

  .background-motion-playing::after { animation-play-state: running; }

  .arrow { transition: translate 200ms var(--ease-out); }
  a:is(:hover, :focus-visible) .arrow { translate: var(--arrow-shift); }

  .preview-main, .preview-detail { transition: translate 360ms var(--ease-out); }
  .preview-open { transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
  .preview-link:is(:hover, :focus-visible) .has-detail .preview-main { translate: -7% -6%; }
  .preview-link:is(:hover, :focus-visible) .preview-detail { translate: 4px -6px; }

  @supports (animation-timeline: view()) {
    .project-figure {
      animation: preview-arrive var(--ease-out) both;
      animation-duration: auto;
      animation-timeline: view();
      animation-range: entry 0% entry 88%;
    }

    .project-figure:focus-within { animation: none; }
  }
}

@keyframes unfold {
  from { clip-path: inset(0 0 0 22%); transform: scale(1.1); }
  to { clip-path: inset(0); transform: scale(1); }
}

@keyframes background-sweep {
  0%, 12% { transform: translate3d(-47%, -38%, 0); opacity: 0; }
  33% { opacity: .86; }
  58% { opacity: .6; }
  84%, 100% { transform: translate3d(47%, 38%, 0); opacity: 0; }
}

@keyframes background-glow {
  0%, 100% { transform: translate3d(8%, -3%, 0) scale(.88); opacity: .32; }
  50% { transform: translate3d(-12%, 11%, 0) scale(1.08); opacity: .76; }
}

@keyframes preview-arrive {
  from { opacity: .68; transform: translateY(24px) scale(.975); }
  to { opacity: 1; transform: none; }
}

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