/* =========================================================
   Ann Tarakanova — Portfolio
   ========================================================= */

:root {
  --bg:        #fbfaf7;
  --bg-alt:    #f2efe9;
  --ink:       #1a1a1a;
  --ink-soft:  #4a4744;
  --muted:     #8a857e;
  --hairline:  #d9d4cb;
  --accent:    #8b7a63;
  --cream:     #ede8dd;

  --sans:   "Jost", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);

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

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.65;
  font-size: 15px;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

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

.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- primitives ---- */
.eyebrow {
  font-size: 10px; letter-spacing: .38em; text-transform: uppercase;
  color: var(--muted); font-weight: 400; margin: 0 0 18px;
}
.display, .h2 {
  font-family: var(--sans); font-weight: 400;
  line-height: 1.1; letter-spacing: -0.005em;
  color: var(--ink); margin: 0;
}
.display  { font-size: clamp(38px, 5.2vw, 66px); font-weight: 500; }
.display em { font-style: normal; color: var(--ink); }
.h2       { font-size: clamp(26px, 3.2vw, 40px); }

.section { padding: clamp(60px, 8vw, 110px) 0; }
.section__head { max-width: 640px; margin: 0 auto clamp(36px, 5vw, 64px); text-align: center; }
.section__head .h2 { margin-top: 4px; }

.link-underline {
  display: inline-block;
  font-size: 10px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--ink);
  padding: 4px 0;
  border-bottom: 1px solid var(--ink);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.link-underline:hover { color: var(--accent); border-color: var(--accent); }
.link-underline--sm { font-size: 9px; }

/* ---- NAV ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: rgba(251,250,247,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--hairline); }
.nav__logo {
  font-size: 15px; font-weight: 400;
  letter-spacing: .18em; color: var(--ink);
  text-transform: lowercase;
}
.nav__menu {
  display: flex; gap: clamp(16px, 2.6vw, 36px);
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
}
.nav__menu a { position: relative; padding: 4px 0; color: var(--ink-soft); transition: color .2s; }
.nav__menu a:hover { color: var(--ink); }
@media (max-width: 640px) { .nav__menu { display: none; } }

/* ---- HERO (single-layer floating photo) ---- */
.hero {
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(50px, 7vw, 90px);
  max-width: var(--wrap); margin: 0 auto;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
}
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; gap: 30px; } }

.hero__portrait {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.portrait__wash {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--cream) 0%, #e2d9c6 100%);
  z-index: 0;
}
.portrait__img {
  position: relative; z-index: 1;
  height: 112%;
  width: auto;
  filter: drop-shadow(0 22px 40px rgba(30,25,20,.16));
  transform-origin: 50% 90%;
  animation: portraitFloat 6s ease-in-out infinite;
  transition: filter .5s var(--ease);
  will-change: transform;
}
.hero__portrait:hover .portrait__img {
  animation-duration: 3s;
  filter: drop-shadow(0 28px 50px rgba(30,25,20,.24));
}
@keyframes portraitFloat {
  0%,100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%     { transform: translate3d(0, -8px, 0) rotate(-0.5deg); }
}

.hero__text .display { margin: 6px 0 22px; }
.hero__text .lede {
  color: var(--ink-soft);
  font-size: 15px; margin: 0 0 30px; line-height: 1.8;
}

/* ---- CARDS ---- */
.grid { display: grid; gap: clamp(24px, 3vw, 40px); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3 { grid-template-columns: 1fr; } }

.card { display: block; text-align: inherit; width: 100%; cursor: pointer; }
.card__media { overflow: hidden; aspect-ratio: 4/5; background: var(--bg-alt); }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 20px 2px 0; text-align: center; }
.card__title {
  font-weight: 500; font-size: 18px; letter-spacing: .01em;
  line-height: 1.2; margin: 0 0 8px;
}
.card__meta { font-size: 13px; color: var(--ink-soft); margin: 0 auto 16px; max-width: 32ch; }

/* ---- TOOLKIT ---- */
.toolkit { background: var(--ink); color: var(--bg); }
.toolkit .h2 { color: var(--bg); }
.toolkit .eyebrow { color: rgba(251,250,247,.5); }

.tools {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid rgba(251,250,247,.14);
}
@media (max-width: 900px) { .tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tools { grid-template-columns: 1fr; } }

.tool {
  padding: 28px 22px 28px;
  border-bottom: 1px solid rgba(251,250,247,.14);
  border-right:  1px solid rgba(251,250,247,.14);
  text-align: left;
  transition: background .3s var(--ease);
  display: grid;
  grid-template-rows: auto 72px auto auto;
  gap: 16px;
  align-items: start;
  min-height: 232px;
}
.tool .brand,
.tool .brand-pair { align-self: start; }
.tool:hover { background: rgba(251,250,247,.03); }
.tools > .tool:nth-child(5n) { border-right: none; }
@media (max-width: 900px) {
  .tools > .tool { border-right: 1px solid rgba(251,250,247,.14); }
  .tools > .tool:nth-child(2n) { border-right: none; }
}
@media (max-width: 520px) { .tools > .tool { border-right: none; } }

.tool__num {
  font-size: 10px; letter-spacing: .3em;
  color: rgba(251,250,247,.4);
}
.tool__name {
  font-weight: 500; font-size: 18px; letter-spacing: .005em;
  line-height: 1.2; margin: 0;
}
.tool__plus { color: rgba(251,250,247,.35); font-weight: 300; }
.tool__role {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(251,250,247,.55); margin: 0;
}

/* ---- BRAND TILE ---- */
.brand {
  position: relative;
  display: inline-block;
  width: 52px; height: 52px;
  vertical-align: top;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.35));
  transition: transform .35s var(--ease);
}
.brand__side {
  position: absolute;
  top: 6px; left: 6px;
  width: 100%; height: 100%;
  border-radius: 8px;
  background: currentColor;
  opacity: .55;
  filter: brightness(.55);
}
.brand__face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 8px;
  background: currentColor;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end; justify-items: center;
  padding: 4px 4px 5px;
  overflow: hidden;
}
.brand__letter {
  color: #fff; font-weight: 600;
  font-size: 30px; line-height: 1;
  letter-spacing: -0.03em;
  align-self: end;
  margin-bottom: -2px;
}
.brand__letter--small { font-size: 18px; margin-bottom: 0; }
.brand__label {
  color: #fff; font-weight: 600;
  font-size: 8px; letter-spacing: .18em;
  line-height: 1; padding-top: 3px;
}

.tool:hover .brand { transform: translateY(-3px); }

/* brand colors (using color inheritance for face+side) */
.brand--autocad { color: #e51937; }  /* crimson */
.brand--revit   { color: #0696d7; }  /* blue */
.brand--max     { color: #248ead; }  /* teal */
.brand--corona  { color: #f28c1e; }  /* orange */
.brand--twin    { color: #14213d; }  /* deep navy */
.brand--figma   { color: #0d0d0d; }
.brand--figma .brand__side { opacity: .7; }

/* image-based brand tile (real product icon PNG fills the whole face) */
.brand--img .brand__face { padding: 0; overflow: hidden; }
.brand--img .brand__face img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.brand--figma .brand__face {
  display: grid;
  place-items: center;
  padding: 0;
}

/* Figma-style geometric mark, drawn with CSS boxes */
.fig {
  position: relative;
  width: 22px;
  height: 33px;
}
.fig__c {
  position: absolute;
  width: 11px;
  height: 11px;
  display: block;
}
.fig__c--tl { top: 0;  left: 0;  background: #f24e1e; border-radius: 999px 0 0 999px; }
.fig__c--tr { top: 0;  left: 11px; background: #ff7262; border-radius: 0 999px 999px 0; }
.fig__c--ml { top: 11px; left: 0; background: #a259ff; border-radius: 999px 0 0 999px; }
.fig__c--mr { top: 11px; left: 11px; background: #1abcfe; border-radius: 50%; }
.fig__c--bl { top: 22px; left: 0; background: #0acf83; border-radius: 999px 0 0 999px; }

.brand-pair {
  display: inline-flex; gap: 14px; align-self: start;
}

/* ---- CONTACT ---- */
.contact { background: var(--bg-alt); }
.contact__wrap { max-width: 560px; margin: 0 auto; text-align: center; }
.contact__list {
  margin-top: 6px;
  border-top: 1px solid var(--hairline);
  text-align: left;
}
.contact__list li {
  display: grid; grid-template-columns: 110px 1fr;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}
.contact__list a { color: var(--ink); transition: color .2s; }
.contact__list a:hover { color: var(--accent); }
.contact__label {
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted);
}

/* ---- FOOTER ---- */
.footer { background: var(--bg); padding: 30px 0; border-top: 1px solid var(--hairline); }
.footer__row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 10px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted);
}
.footer__mono { letter-spacing: .16em; font-size: 11px; color: var(--muted); }

/* ---- REVEAL ---- */
.js .reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.js .reveal.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .portrait__img { animation: none !important; }
}

/* =========================================================
   MODAL
   ========================================================= */

.modal {
  position: fixed; inset: 0; z-index: 100;
  visibility: hidden; pointer-events: none;
}
.modal.is-open { visibility: visible; pointer-events: auto; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(20,18,15,0);
  transition: background .4s var(--ease);
}
.modal.is-open .modal__backdrop { background: rgba(20,18,15,.55); }

.modal__panel {
  position: absolute; inset: 0; margin: auto;
  width: min(1080px, 94vw);
  max-height: 92vh;
  background: var(--bg);
  opacity: 0; transform: translateY(24px) scale(.98);
  transition: opacity .45s var(--ease), transform .55s var(--ease);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.modal.is-open .modal__panel { opacity: 1; transform: translateY(0) scale(1); }

.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--ink);
  background: rgba(255,255,255,.65);
  border-radius: 50%;
  transition: background .2s var(--ease), transform .2s var(--ease);
  backdrop-filter: blur(6px);
}
.modal__close:hover { background: #fff; transform: rotate(90deg); }

.modal__scroll {
  overflow-y: auto;
  padding: clamp(30px, 5vw, 60px) clamp(24px, 5vw, 60px) clamp(40px, 6vw, 70px);
}
.modal__head { max-width: 720px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.modal__head .eyebrow { margin: 0 0 12px; }
.modal__head .h2 { margin-bottom: 20px; }
.modal__lede { color: var(--ink-soft); font-size: 15px; line-height: 1.75; margin: 0; }

.modal__section { margin-bottom: clamp(36px, 5vw, 56px); }
.modal__section:last-child { margin-bottom: 0; }

.gallery__label {
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px; text-align: center;
}
.gallery__grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.gallery__grid--1 { grid-template-columns: 1fr; }
.gallery__grid--2 { grid-template-columns: 1fr 1fr; }
.gallery__grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .gallery__grid--2, .gallery__grid--3 { grid-template-columns: 1fr; }
}

.ph { position: relative; background: var(--bg-alt); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph--tall { aspect-ratio: 3/4; }
.ph--wide { aspect-ratio: 16/9; }

/* Paper sheet (hand drawings) — preserve full sheet, no cropping */
.ph--sheet {
  aspect-ratio: 3/4;
  background: #fbfaf7;
  border: 1px solid var(--hairline);
  padding: 10px;
}
.ph--sheet img { object-fit: contain; }

/* Card cover that shouldn't crop (sketch on paper) */
.card__media--contain {
  background: #fbfaf7;
  border: 1px solid var(--hairline);
}
.card__media--contain img { object-fit: contain; padding: 12px; }

/* ---- PLAN DOCS (inline PDF pages) ---- */
.plan-stack {
  display: grid; gap: clamp(20px, 3vw, 32px);
  max-width: 880px; margin: 0 auto;
}
.plan-doc {
  background: var(--bg-alt);
  border: 1px solid var(--hairline);
  padding: 10px;
}
.plan-doc iframe {
  width: 100%;
  aspect-ratio: var(--pdf-ratio, 1.4 / 1);
  border: 0;
  background: #525659;   /* matches Chrome/Edge PDF viewer bg — any padding blends in */
  display: block;
}
.plan-doc figcaption {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 6px 4px;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft);
}
.plan-doc figcaption a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.plan-doc figcaption a:hover { color: var(--ink); border-color: var(--ink); }
