:root {
  --page-bg: #090909;
  --ink: #f7f4ee;
  --muted: rgba(247, 244, 238, 0.6);
  --paper: rgba(18, 18, 17, 0.94);
  --line: rgba(247, 244, 238, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #151514 0%, var(--page-bg) 180px),
    var(--page-bg);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
}

::selection {
  background: rgba(247, 244, 238, 0.22);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.landing-page {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 22px 22px 44px;
}

.site-mark {
  display: grid;
  place-items: center;
  margin: 0 0 18px;
  text-align: center;
}

.mark-link {
  display: grid;
  gap: 5px;
  place-items: center;
  width: fit-content;
}

.site-mark h1 {
  margin: 0;
  font-size: clamp(31px, 3vw, 40px);
  font-weight: 500;
  line-height: 0.92;
}

.site-mark p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.28;
}

.collage-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(141, 14px);
  gap: 0;
}

.collage-tile {
  position: relative;
  overflow: hidden;
  background: #151515;
}

.collage-tile {
  display: block;
  isolation: isolate;
}

.collage-tile::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.54));
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.collage-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.collage-tile:hover img,
.collage-tile:focus-visible img {
  transform: scale(1.018);
}

.collage-tile:hover::after,
.collage-tile:focus-visible::after {
  opacity: 1;
}

.tile-label {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  gap: 1px;
  color: #fffaf0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  opacity: 0;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
  transition: opacity 180ms ease;
}

.tile-label small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.74;
}

.collage-tile:hover .tile-label,
.collage-tile:focus-visible .tile-label {
  opacity: 1;
}

.tile-one {
  grid-column: 1 / span 6;
  grid-row: 1 / span 16;
}

.tile-one img {
  object-position: 54% 50%;
}

.tile-two {
  grid-column: 7 / span 4;
  grid-row: 1 / span 16;
}

.tile-two img {
  object-position: 50% 50%;
}

.tile-three {
  grid-column: 10 / span 3;
  grid-row: 64 / span 15;
}

.tile-three img {
  object-position: 82% 50%;
}

.tile-four {
  grid-column: 1 / span 5;
  grid-row: 17 / span 26;
}

.tile-four img {
  object-position: 28% 44%;
}

.tile-five {
  grid-column: 6 / span 4;
  grid-row: 34 / span 27;
}

.tile-five img {
  object-position: 60% 50%;
}

.tile-six {
  grid-column: 1 / span 5;
  grid-row: 43 / span 18;
}

.tile-six img {
  object-position: 44% 54%;
}

.tile-seven {
  grid-column: 11 / span 2;
  grid-row: 1 / span 33;
}

.tile-seven img {
  object-position: 56% 50%;
}

.tile-photo {
  background: #151515;
}

.tile-nine {
  grid-column: 4 / span 6;
  grid-row: 61 / span 18;
}

.tile-ten {
  grid-column: 10 / span 3;
  grid-row: 79 / span 10;
}

.tile-eleven {
  grid-column: 6 / span 5;
  grid-row: 17 / span 17;
}

.tile-twelve {
  grid-column: 1 / span 7;
  grid-row: 79 / span 18;
}

.tile-thirteen {
  grid-column: 1 / span 4;
  grid-row: 97 / span 26;
}

.tile-fourteen {
  grid-column: 8 / span 5;
  grid-row: 89 / span 18;
}

.tile-fifteen {
  grid-column: 1 / span 3;
  grid-row: 61 / span 18;
}

.tile-sixteen {
  grid-column: 5 / span 8;
  grid-row: 115 / span 26;
}

.tile-seventeen {
  grid-column: 8 / span 2;
  grid-row: 79 / span 10;
}

.tile-eighteen {
  grid-column: 5 / span 8;
  grid-row: 141 / span 18;
}

.tile-nine img {
  object-position: 50% 50%;
}

.tile-ten img {
  object-position: 66% 55%;
}

.tile-eleven img {
  object-position: 50% 58%;
}

.tile-twelve img {
  object-position: 60% 46%;
}

.tile-thirteen img {
  object-position: 42% 52%;
}

.tile-fourteen img {
  object-position: 50% 50%;
}

.tile-fifteen img {
  object-position: 50% 50%;
}

.tile-sixteen img {
  object-position: 50% 50%;
}

.tile-seventeen img {
  object-position: 64% 64%;
}

.tile-eighteen img {
  object-position: 50% 52%;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding-top: 34px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.35;
}

.site-footer a {
  color: var(--ink);
}

@media (max-width: 900px) {
  .landing-page {
    padding: 18px 16px 34px;
  }

  .collage-board {
    display: grid;
  }

  .collage-tile {
    margin-bottom: 0;
  }

  .tile-label,
  .collage-tile::after {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .site-mark {
    margin-bottom: 14px;
  }

}

.project-page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 22px 48px;
}

.project-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 0;
}

.project-header .back-link {
  position: absolute;
  top: 4px;
  left: 0;
}

.project-header .site-mark {
  margin: 0;
}

.project-header .site-mark h1 {
  font-size: clamp(27px, 2.5vw, 34px);
}

.project-header .site-mark p {
  font-size: 11.5px;
}

.back-link {
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-title-block {
  max-width: 820px;
  margin: 8px auto 28px;
  text-align: center;
}

.project-title-block h2 {
  margin: 0;
  font-size: clamp(44px, 7vw, 92px);
  font-weight: 500;
  line-height: 0.98;
}

.project-title-block p {
  margin: 22px 0 0;
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.photo-frame {
  display: grid;
  place-items: center;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.photo-frame img {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 780px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.layout-editor {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 22px 22px 48px;
}

.mobile-layout-editor {
  width: min(100%, 980px);
}

.editor-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  margin-bottom: 22px;
}

.editor-toolbar h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 500;
  line-height: 0.92;
  text-align: center;
}

.editor-toolbar p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.editor-actions button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.editor-actions button:hover,
.editor-actions button:focus-visible {
  background: var(--ink);
  color: #0b0b0b;
  outline: none;
}

.layout-save-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(247, 244, 238, 0.045);
}

.layout-save-panel p {
  margin: 0;
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.45;
  text-align: center;
}

.layout-save-panel textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.74);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.4;
  resize: vertical;
}

.editor-board {
  background-image:
    linear-gradient(rgba(247, 244, 238, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 244, 238, 0.08) 1px, transparent 1px);
  background-size: calc(100% / 12) 14px;
  touch-action: none;
}

.mobile-editor-board {
  background-size: calc(100% / 6) 14px;
}

.mobile-editor-preview {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.mobile-editor-phone {
  --phone-width: 393px;
  --phone-height: 852px;
  height: auto;
  min-height: 0;
  padding: 18px 12px 12px;
}

.mobile-editor-screen {
  width: 100%;
  height: min(760px, calc(100vh - 250px));
  min-height: 560px;
  overflow: auto;
  border-radius: 24px;
  background: var(--page-bg);
  overscroll-behavior: contain;
}

.mobile-editor-screen .mobile-editor-board {
  width: 100%;
  min-height: 100%;
}

.editor-board .collage-tile {
  cursor: grab;
  outline: 1px solid rgba(247, 244, 238, 0.42);
  user-select: none;
}

.editor-board .collage-tile.is-selected {
  outline: 2px solid rgba(247, 244, 238, 0.92);
  z-index: 12;
}

.editor-board .collage-tile.is-drop-target {
  outline: 3px solid rgba(153, 198, 255, 0.95);
  z-index: 16;
}

.editor-board.is-media-mode .collage-tile {
  cursor: move;
  outline-color: rgba(153, 198, 255, 0.72);
}

.editor-board.is-media-mode .resize-handle {
  display: none;
}

.editor-board .collage-tile.is-editing {
  cursor: grabbing;
  outline: 2px solid #f7f4ee;
  z-index: 20;
}

.editor-board .tile-label {
  opacity: 1;
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: 18px;
  height: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.82);
  border-left: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(8, 8, 8, 0.78);
  cursor: nwse-resize;
}

.mobile-preview {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 22px 48px;
}

.mobile-preview-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.mobile-preview-header h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 500;
  line-height: 0.92;
  text-align: center;
}

.mobile-preview-header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.device-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 20px;
}

.device-controls button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.device-controls button:hover,
.device-controls button:focus-visible,
.device-controls button.is-active {
  background: var(--ink);
  color: #0b0b0b;
  outline: none;
}

.phone-shell {
  --phone-width: 393px;
  --phone-height: 852px;
  position: relative;
  width: min(var(--phone-width), calc(100vw - 44px));
  height: min(var(--phone-height), calc(100vh - 190px));
  min-height: 560px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(247, 244, 238, 0.2);
  border-radius: 34px;
  background: #050505;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.phone-speaker {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 2;
  width: 66px;
  height: 5px;
  border-radius: 999px;
  background: rgba(247, 244, 238, 0.2);
  transform: translateX(-50%);
}

.phone-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 24px;
  background: var(--page-bg);
}

@media (max-width: 700px) {
  .project-header {
    min-height: 62px;
  }

  .project-header .site-mark {
    margin-bottom: 0;
  }

  .mobile-preview-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mobile-preview-header .back-link:last-child {
    justify-self: start;
  }

}
