/* ============================================
   o.t.w. â€” Styles
   Bauhaus-inspired, stitched/fabric details
   ============================================ */

:root {
  --cream:       #f3ece1;
  --cream-soft:  #ede4d5;
  --ink:         #141414;
  --ink-soft:    #2a2a2a;
  --blue:        #1e3d9e;
  --red:         #b9232c;
  --yellow:      #e5b42a;
  --lavender:    #a3a5c9;
  --lavender-soft:#c4c6e0;
  --yellow-soft: #f0d98a;
  --gray-soft:   #d3cfc4;

  --tile-radius: 4px;
  --stitch-offset: 7px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle paper grain on the background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(rgba(20,20,20,0.025) 1px, transparent 1px),
    radial-gradient(rgba(20,20,20,0.02) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  opacity: 0.8;
}

/* ============ Header / Nav ============ */

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.25rem 3rem;
}

.site-nav {
  display: flex;
  gap: 2.75rem;
}

.nav-link {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav-link:hover::after { transform: scaleX(1); }

.cart-link {
  color: var(--ink);
  transition: transform 0.3s ease;
  display: inline-flex;
}
.cart-link svg { width: 26px; height: 28px; }
.cart-link:hover { transform: translateY(-2px) rotate(-4deg); }

/* ============ Stage ============ */

.stage {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 220px);
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 4rem 5rem;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 180px 200px 200px 180px;
  gap: 0;
}

/* ---- Decorative lines ---- */

.lines { position: absolute; inset: 0; pointer-events: none; }

.line { position: absolute; background: var(--ink); }

.line--v1 {
  width: 2px;
  top: 8%;
  bottom: 6%;
  left: 45%;
}
.line--v2 {
  width: 2px;
  top: 50%;
  bottom: 14%;
  left: 62%;
}
.line--h1 {
  height: 2px;
  top: 63%;
  left: 10%;
  right: 12%;
}
.line--h2 {
  height: 2px;
  top: 71%;
  left: 38%;
  right: 30%;
}

/* ---- Decorative shapes ---- */

.shapes { position: absolute; inset: 0; pointer-events: none; }

.shape { position: absolute; }

.shape--yellow-1 {
  width: 180px; height: 70px;
  background: var(--yellow-soft);
  top: 13%; left: 44%;
}
.shape--lavender-1 {
  width: 90px; height: 210px;
  background: var(--lavender-soft);
  top: 16%; left: 31%;
}
.shape--gray-1 {
  width: 70px; height: 90px;
  background: var(--gray-soft);
  top: 58%; left: 25%;
}
.shape--yellow-2 {
  width: 110px; height: 110px;
  background: var(--yellow-soft);
  top: 56%; right: 18%;
}
.shape--lavender-2 {
  width: 140px; height: 45px;
  background: var(--lavender);
  bottom: 7%; left: 47%;
}

/* tiny equals-sign marks */
.shape--mark {
  width: 22px; height: 14px;
  background:
    linear-gradient(var(--ink), var(--ink)) top/100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom/100% 2px no-repeat;
  background-color: transparent;
}
.mark--1 { top: 20%; right: 5%; }
.mark--2 { top: 73%; left: 58%; }

/* ============ Tiles ============ */

.tile {
  position: relative;
  text-decoration: none;
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

.tile__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.75rem 2.5rem;
  background: var(--tile-bg);
  border-radius: var(--tile-radius);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.05),
    0 10px 30px -15px rgba(0,0,0,0.25);
  transition: box-shadow 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* stitched border effect */
.tile__inner::before {
  content: "";
  position: absolute;
  inset: var(--stitch-offset);
  border: 1.5px dashed rgba(255, 245, 230, 0.55);
  border-radius: 2px;
  pointer-events: none;
}

.tile__label {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1.35rem;
  line-height: 1.15;
  text-align: center;
  color: var(--cream);
  position: relative;
}

/* Color variants */
.tile--blue   { --tile-bg: var(--blue); }
.tile--red    { --tile-bg: var(--red); }
.tile--yellow { --tile-bg: var(--yellow); }

.tile--yellow .tile__label { color: var(--ink); }
.tile--yellow .tile__inner::before { border-color: rgba(20,20,20,0.4); }

/* Grid placement */
.tile--upcycling {
  grid-column: 3 / span 4;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: start;
  width: 260px;
  height: 130px;
  margin-top: 40px;
  margin-left: 40px;
}

.tile--edited {
  grid-column: 9 / span 3;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: end;
  width: 240px;
  height: 165px;
  margin-top: 30px;
}

.tile--screenprints {
  grid-column: 3 / span 4;
  grid-row: 3 / span 2;
  align-self: end;
  justify-self: start;
  width: 260px;
  height: 165px;
  margin-bottom: 40px;
  margin-left: 60px;
}

.frame--featured {
  position: absolute;
  top: calc(57% - 300px);
  left: 48%;
  width: 580px;
  height: 580px;
  z-index: 3;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.frame--featured:hover {
  transform: translateY(-6px) rotate(0.6deg);
}
.frame__svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.18));
  transition: filter 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* The featured photo sits inside the cream square area of the frame.
   Cream square is at SVG coordinates (192,192) to (488,488) within a 680x680 viewBox.
   That's 43.5% of the frame width/height, centered. */
.frame__photo {
  position: absolute;
  top: 28.2%;
  left: 28.2%;
  width: 43.5%;
  height: 43.5%;
  background: var(--cream);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.frame--featured:hover {
  transform: translateY(-6px) rotate(0.6deg);
}

.frame--featured:hover .frame__svg {
  filter: drop-shadow(0 22px 32px rgba(0,0,0,0.28));
}
/* Folded tile: uses inline SVG instead of .tile__inner
   The SVG renders the patch body, fold triangle, crease, and stitching.
   The label is positioned over the patch face (not over the fold). */
.tile--folded {
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.18));
  transition:
    transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tile--folded .tile__fold-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* SVG aspect ratio locked to 240x165 via preserveAspectRatio="none"
     â€” the fold scales with the tile without distortion because the viewBox
     matches the tile dimensions exactly. */
}

.tile__label--folded {
  position: absolute;
  z-index: 1;
  color: var(--cream);
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
}

.tile--folded:hover {
  filter: drop-shadow(0 20px 28px rgba(0,0,0,0.3));
}

/* Hover */
.tile:hover {
  transform: translateY(-6px) rotate(-0.5deg);
}
.tile:hover .tile__inner {
  box-shadow:
    0 2px 0 rgba(0,0,0,0.08),
    0 24px 40px -18px rgba(0,0,0,0.35);
}
.tile--edited:hover { transform: translateY(-6px) rotate(1deg); }
.tile--screenprints:hover { transform: translateY(-6px) rotate(-0.8deg); }

/* ============ Center Logo ============ */

.logo {
  grid-column: 1 / span 6;
  grid-row: 2 / span 2;
  align-self: center;
  justify-self: start;
  z-index: 4;
  width: 440px;
  height: 180px;
  position: relative;
   margin-left: 120px;
}

.logo__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--ink);
  border-radius: var(--tile-radius);
  box-shadow:
    0 2px 0 rgba(0,0,0,0.12),
    0 30px 60px -25px rgba(0,0,0,0.5);
}

.logo__inner::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(243, 236, 225, 0.35);
  border-radius: 2px;
}

.logo__text {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-size: 9.5rem;
  letter-spacing: 0.015em;
  color: var(--cream);
  line-height: 1;
  position: relative;
}

/* ============ Footer Marquee ============ */

.site-footer {
  position: relative;
  z-index: 5;
  background: var(--ink);
  overflow: hidden;
  padding: 1.1rem 0;
}

.marquee {
  display: flex;
  white-space: nowrap;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  animation: marquee 32s linear infinite;
  color: var(--cream);
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 400;
  padding-left: 2rem;
}

.marquee__track .dot {
  opacity: 0.5;
  font-size: 1.2rem;
  line-height: 1;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ Load animation ============ */

.tile, .logo, .shape, .line {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tile--upcycling   { animation-delay: 0.15s; }
.tile--edited      { animation-delay: 0.25s; }
.logo              { animation-delay: 0.05s; }
.tile--screenprints{ animation-delay: 0.35s; }
.shape             { animation-delay: 0.5s; animation-duration: 1.2s; }
.line              { animation-delay: 0.4s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Responsive ============ */

@media (max-width: 1100px) {
  .stage {
    padding: 1rem 2rem 3rem;
    grid-template-rows: auto auto auto auto;
  }
  .logo { width: 340px; height: 140px; }
  .logo__text { font-size: 6rem; }
}

@media (max-width: 768px) {
  .site-header { padding: 1.5rem; flex-wrap: wrap; }
  .site-nav { gap: 1.25rem; }
  .nav-link { font-size: 0.7rem; letter-spacing: 0.2em; }

   .frame--featured {
  width: 100% !important;
  max-width: 320px;
  height: auto !important;
  aspect-ratio: 1 / 1;
  margin: 0 !important;
  justify-self: center !important;
  align-self: center !important;
}
  .stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem 3rem;
    min-height: auto;
  }

  .lines, .shapes { display: none; }

  .logo {
    order: -1;
    width: 100%;
    max-width: 360px;
    height: 120px;
    margin-left: 0;
    justify-self: center;
  }
  .logo__text { font-size: 6rem; }

  .tile {
    width: 100% !important;
    max-width: 360px;
    height: 130px !important;
    margin: 0 !important;
    justify-self: center !important;
    align-self: center !important;
  }

  .marquee__track { font-size: 0.7rem; letter-spacing: 0.2em; }
}
