/* anilduran.com — hand-written rebuild of the Squarespace site.
   Layout model: every section is a CSS grid (8 columns on mobile, 24 on desktop).
   Each block sets its own placement with inline custom properties:
     --m  grid-area on mobile   (row-start / col-start / row-end / col-end)
     --d  grid-area on desktop  (min-width: 768px)
     --zm / --zd  stacking order,  --am / --ad  vertical alignment inside the block
*/

@import url("../fonts/fonts.css");

:root {
  --gap: 11px;                 /* grid gap */
  --gutter: 6vw;               /* page side margin (mobile) */
  --maxw: 1820px;              /* site max width */
  --k: calc(.012 * min(100vh, 900px));   /* fluid type step (mobile: follows viewport height) */
  --ks: var(--k);              /* same step, used by the sizes below 1rem (small text, nav, code) */
  --hdr-pad: 6vw;
  --hdr-pady: 6vw;
  --hdr-row: 37px;
  --hdr-h: calc(var(--hdr-pady) * 2 + var(--hdr-row));
  --fg: #000;
  --bg: #fff;
}
@media (min-width: 768px) {
  :root {
    --gutter: 2vw;
    --k: calc(.012 * min(100vw, var(--maxw)));   /* desktop: follows viewport width */
    --ks: max(1.2vw, 1rem);
  }
}
/* desktop header (same breakpoint the original used) */
@media (min-width: 800px) and (pointer: fine), (min-width: 1025px) {
  :root { --hdr-pad: 2vw; --hdr-pady: 1.1vw; --hdr-row: calc(((1.5 - 1) * var(--k) + 1rem) * 1.2); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex; flex-direction: column; min-height: 100vh;   /* footer sits at the bottom on short pages */
}
main { flex: 1 0 auto; }
img { display: block; max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- type ---------- */
h1, h2, h3, h4, p, pre { margin: 0; font-weight: 400; white-space: pre-wrap; overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 500; letter-spacing: -.02em; }
h1 { font-size: calc((4 - 1) * var(--k) + 1rem);   line-height: 1.056; }
h2 { font-size: calc((2.8 - 1) * var(--k) + 1rem); line-height: 1.1136; }
h3 { font-size: calc((2.2 - 1) * var(--k) + 1rem); line-height: 1.1424; }
h4 { font-size: calc((1.6 - 1) * var(--k) + 1rem); line-height: 1.1712; }
.t-small { font-size: calc((.9 - 1) * var(--ks) + 1rem); }
.t-large { font-size: calc((1.4 - 1) * var(--k) + 1rem); }
pre { font-family: inherit; }
code {
  font-family: inherit;
  font-size: calc((.8 - 1) * var(--ks) + 1rem);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.text .t-hl a { text-decoration: none; }
.text > * + * { margin-top: 1rem; }
.text > * + :is(h1, h2, h3, h4), .text > :is(h1, h2, h3, h4) + * { margin-top: 2rem; }

/* ---------- header ---------- */
.hdr {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center;
  padding: var(--hdr-pady) var(--hdr-pad);
  color: var(--fg);
}
.title {
  margin-right: auto;
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 500;
  font-size: 1rem; line-height: 1.2; letter-spacing: -.02em; padding: .07em 0; margin-top: -.07em; margin-bottom: -.07em;
}
.nav { display: none; }
.nav a { display: block; padding: .1em 0; font-size: 1rem; line-height: 1.5; }
.nav a[aria-current], .menu nav a[aria-current] { background: linear-gradient(currentColor, currentColor) 0 calc(100% - .1em) / 100% 1px no-repeat; }
.hdr-social { display: none; }
.hdr-social a, .menu-social a { display: block; width: 24px; height: 24px; }
.hdr-social svg, .menu-social svg { display: block; width: 24px; height: 24px; fill: currentColor; }
.burger {
  position: relative; z-index: 12;
  width: 47px; height: 37px; padding: 1px 6px; margin: 0;
  border: 0; background: none; color: inherit; cursor: pointer;
}
.burger span {
  position: absolute; left: 6px; top: 18px; width: 35px; height: 1px; background: currentColor;
  transition: transform .25s cubic-bezier(.2, .6, .3, 1), width .25s cubic-bezier(.2, .6, .3, 1);
}
.burger span:first-child { transform: translateY(-5.5px); }
.burger span:last-child  { transform: translateY(5.5px); }
.menu-open .burger span { width: 29px; left: 9px; }
.menu-open .burger span:first-child { transform: rotate(-45deg); }
.menu-open .burger span:last-child  { transform: rotate(45deg); }

.menu {
  position: fixed; inset: 0; z-index: 9;
  display: flex; align-items: center; justify-content: center;
  padding-top: var(--hdr-h);
  background: var(--bg);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease-in-out, visibility 0s .25s;
}
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity .25s ease-in-out; }
.menu-open { overflow: hidden; }
.menu { flex-direction: column; align-items: flex-start; padding: 0 7vw; background: #fff; color: #000; }
.menu nav a { display: block; width: fit-content; margin: 10vw 0; font-size: 8.5vmin; line-height: 1; background: none; }
.menu nav a:first-child { margin-top: 0; }
.menu nav a:last-child { margin-bottom: 0; }
.menu-social { position: absolute; left: 7vw; bottom: 9.7vw; display: flex; gap: 15px; }
.menu-social a, .menu-social svg { width: 25px; height: 25px; }
.menu-open .hdr { color: #000; }

@media (min-width: 800px) and (pointer: fine), (min-width: 1025px) {
  .title { font-size: calc((1.5 - 1) * var(--k) + 1rem); }
  .nav { display: flex; gap: 1.4vw; }
  .hdr-social { display: flex; }
  .hdr-social a { margin-left: 1.4vw; }
  .hdr-social a:first-child { margin-left: 2.6vw; }
  .burger, .menu { display: none; }
}

/* ---------- sections + grid ---------- */
.sec {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  min-height: var(--minh, 0);
  background: var(--sbg, transparent);
  color: var(--sfg, inherit);
}
.sec.top { justify-content: flex-start; }
.sec.bottom { justify-content: flex-end; }
main > .sec:first-child { padding-top: var(--hdr-h); }
.wrap { padding-top: var(--pt, 0); padding-bottom: var(--pb, 0); }

.grid {
  --gg: calc(var(--gutter) - var(--gap));
  display: grid;
  grid-template-columns:
    minmax(var(--gg), 1fr)
    repeat(8, minmax(0, calc((var(--maxw) - var(--gap) * 7) / 8)))
    minmax(var(--gg), 1fr);
  grid-template-rows: repeat(var(--rm), minmax(24px, auto));
  gap: var(--gap);
  overflow-x: clip;
}
.grid.flush { --gap: 0px; }
.b {
  grid-area: var(--m);
  z-index: var(--zm, auto);
  position: relative;
  display: flex; flex-direction: column;
  justify-content: var(--am, flex-start);
  min-width: 0;
}
.m-hide { display: none; }

@media (min-width: 768px) {
  .grid {
    --cw: min(var(--maxw), calc(100vw - var(--gutter) * 2));
    grid-template-columns:
      minmax(var(--gg), 1fr)
      repeat(24, minmax(0, calc((var(--maxw) - var(--gap) * 23) / 24)))
      minmax(var(--gg), 1fr);
    grid-template-rows: repeat(var(--rd), minmax(calc(var(--cw) * .0215), auto));
  }
  .b { grid-area: var(--d); z-index: var(--zd, auto); justify-content: var(--ad, flex-start); }
  .m-hide { display: flex; }
  .d-hide { display: none; }
}

/* ---------- blocks ---------- */
.img { position: relative; display: block; flex: 1 1 auto; width: 100%; border-radius: 5px; overflow: hidden; }
.img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fp, 50% 50%); }
.img.contain img { object-fit: contain; object-position: 50% var(--oym, 50%); }
@media (min-width: 768px) { .img.contain img { object-position: 50% var(--oyd, 50%); } }
.img.sq { border-radius: 0; }
hr { width: 100%; height: 1px; margin: 0; border: 0; background: #dcdcdc; }
.rule { min-height: 17.02px; }

.embed { position: relative; width: 100%; height: 0; padding-bottom: var(--ar, 56.25%); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.social { display: flex; justify-content: flex-end; gap: 16px; }
.social a { display: block; width: 16px; height: 16px; transition: opacity .17s ease-in-out; }
.social a:hover { opacity: .8; }
.social svg { display: block; width: 32px; height: 32px; margin: -8px; fill: currentColor; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1vw; top: 1vw; z-index: 20; background: #fff; color: #000; padding: .5em 1em; }

/* ---------- "more projects" carousel (project pages) ---------- */
.more { display: block; padding: 3.3vmax 0; --slide-gap: 20px; --cols: 1; --peek: 0px; }
.carousel { position: relative; padding: 0 1vw; overflow: hidden; }
.track {
  --sw: calc((100% - var(--peek) - (var(--cols) - 1) * var(--slide-gap)) / var(--cols));
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--sw); column-gap: var(--slide-gap);
}
.slide { min-width: 0; transition: transform .6s cubic-bezier(.2, .6, .3, 1); }
.slide.jump { transition: none; }
.slide-img { position: relative; height: 0; padding-bottom: calc(100% + 1px); overflow: hidden; }
.slide-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fp, 50% 50%); }
.slide-title { width: 75%; margin-top: 4%; font-size: calc((1.2 - 1) * var(--k) + 1rem); }
.btn {
  display: inline-block; margin-top: 4%; padding: 1.2em 2em;
  border-radius: 300px; background: var(--btn-bg, #000); color: var(--btn-fg, #fafafa);
  font-size: calc((.8 - 1) * var(--ks) + 1rem); font-weight: 500; line-height: normal;
  letter-spacing: .05em; text-transform: uppercase;
  transition: opacity .1s linear;
}
.btn:hover { opacity: .8; }
.arrows { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.arrow {
  width: 48px; height: 48px; padding: 4px; border: 0; background: none; cursor: pointer; color: var(--arrow-fg, #fff);
}
.arrow svg {
  display: block; width: 40px; height: 40px; padding: 10px; border-radius: 50%;
  background: var(--arrow-bg, #000);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square;
}
@media (min-width: 576px) {
  .more { --cols: 2; --peek: 40px; }
  .arrows { display: block; margin: 0; }
  .arrow {
    position: absolute;
    top: calc((100vw - 2vw - var(--peek) - (var(--cols) - 1) * var(--slide-gap)) / var(--cols) / 2 - 33px);
    width: 60px; height: 60px; padding: 0; border-radius: 50%; overflow: hidden;
  }
  .arrow.prev { left: 3vw; }
  .arrow.next { right: 3vw; }
  .arrow svg { width: 60px; height: 60px; padding: 12px; border-radius: 0; background: color-mix(in srgb, var(--arrow-bg, #000) 70%, transparent); stroke-width: 1.5; }
}
@media (min-width: 992px) {
  .more { --cols: 3; }
}

/* ---------- full-width fading slideshow ---------- */
.slideshow { display: block; position: relative; height: var(--h, 75vh); overflow: hidden; }
.shot { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .6s ease; }
.shot.on { opacity: 1; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: var(--fp, 50% 50%); }
.caret {
  position: absolute; top: 50%; z-index: 2; width: 27px; height: 32px; margin-top: -16px; padding: 8px 9px;
  border: 0; border-radius: 3px; background: rgba(255, 255, 255, .56); opacity: .75; cursor: pointer; color: #000;
}
.caret.prev { left: 20px; }
.caret.next { right: 20px; }
.caret svg { display: block; width: 9px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1; stroke-miterlimit: 10; }

/* ---------- contact form (Info page) ---------- */
.form { width: 100%; }
.form .field { display: block; margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.form legend, .form .lab { display: block; padding: 0 0 4px; }
.form .cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.form label { display: block; }
.form .cap { display: block; margin-top: 4px; padding-bottom: 2px; font-size: calc((.9 - 1) * var(--ks) + 1rem); }
.form .req { opacity: .7; margin-left: .35em; font-size: calc((.9 - 1) * var(--ks) + 1rem); }
.form input[type="text"], .form input[type="email"], .form textarea {
  display: block; width: 100%; margin: 0; padding: 5px 0;
  border: 0; border-bottom: 1px solid color-mix(in srgb, currentColor 60%, transparent); border-radius: 0;
  background: transparent; color: inherit;
  font: inherit; letter-spacing: inherit; outline: 0;
}
.form input:hover, .form textarea:hover, .form input:focus, .form textarea:focus { border-bottom-color: currentColor; }
.form textarea { height: 100px; min-height: 100px; resize: vertical; }
.form .check { display: flex; align-items: center; gap: 11px; margin: 6.6px 0 24px; font-size: calc((.9 - 1) * var(--ks) + 1rem); }
.form .check input { appearance: none; -webkit-appearance: none; flex: none; width: 15px; height: 15px; margin: 0; border: 1px solid rgba(250, 250, 250, .55); background: transparent; cursor: pointer; }
.form .check input:checked { background: currentColor; }
.form .field:has(.check) { margin-bottom: 0; }
.form .btn { margin: 0; border: 0; cursor: pointer; font-family: inherit; line-height: 1.3; color: var(--btn-fg, #dcdcdc); }

/* ---------- outline button ---------- */
/* The button is centred over its grid cell and never smaller than it; when the label needs more room it overhangs,
   exactly like the original. The hidden ::before copy of the label is what gives the cell its minimum height. */
.b.fill { align-items: center; }
.b.fill::before {
  content: attr(data-label); visibility: hidden;
  box-sizing: border-box; width: 100%; min-width: min-content; padding: 1px calc(1.8rem + 1px);
  font-size: 1rem; line-height: normal; text-align: center; text-transform: uppercase;
}
.btn-o {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 1.8rem; border: 1px solid currentColor; background: none; color: inherit; cursor: pointer;
  font: inherit; font-size: 1rem; line-height: normal; text-align: center; text-transform: uppercase;
  transition: background-color .1s linear, color .1s linear;
}
.b.fill .btn-o { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; min-width: min-content; min-height: max(100%, 46px); }
.btn-o:hover { background: var(--sfg, var(--fg)); color: var(--sbg, var(--bg)); }
.form .btn-o { display: inline-flex; padding: 1rem 1.8rem; }

/* ---------- self-hosted video, section background image ---------- */
.embed video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sec.has-bg { overflow: hidden; }
.sec-bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.sec.has-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .15); pointer-events: none; }
.sec.has-bg .wrap { position: relative; z-index: 1; }

/* ---------- slideshow bullets + captions ---------- */
.slideshow.captions { overflow: visible; margin-bottom: 150px; }
.shot figcaption { position: absolute; top: 100%; left: 50%; width: 46.875%; min-width: 325px; max-width: 100%; margin-top: 25px; transform: translateX(-50%); font-size: 14px; line-height: 1.5; text-align: center; }
.dots { position: absolute; left: 0; right: 0; bottom: 25px; z-index: 2; display: flex; justify-content: center; gap: 10px; }
.dots button { width: 10px; height: 10px; padding: 0; border: 1px solid #000; border-radius: 50%; background: transparent; cursor: pointer; }
.dots button.on { background: #000; }
.text p:empty { min-height: 1.5em; }

/* ---------- fade in on scroll (added by site.js; content stays visible without JS) ---------- */
.fx .b > * { opacity: 0; transition: opacity 1.5s ease .3s; }
.fx .b.in > * { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .fx .b > * { opacity: 1; transition: none; } }
