:root {
  --page-bg: #f7fbff;
  --surface: #ffffff;
  --surface-soft: #f4f8fb;
  --surface-strong: #eaf2f7;
  --accent: rgb(103, 162, 192);
  --accent-strong: rgb(25, 97, 128);
  --text-main: #173746;
  --text-soft: #607988;
  --shadow-light: rgba(255, 255, 255, 0.95);
  --shadow-dark: rgba(176, 197, 209, 0.45);
  --shadow-dark-strong: rgba(150, 174, 189, 0.55);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(103, 162, 192, 0.12), transparent 26%),
    radial-gradient(circle at bottom left, rgba(103, 162, 192, 0.1), transparent 24%),
    var(--page-bg);
}

body.modal-open {
  overflow: hidden;
}

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

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 128px;
}

.neo-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: -14px -14px 28px var(--shadow-light), 14px 14px 28px var(--shadow-dark);
}

.neo-inset {
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  box-shadow: inset 8px 8px 18px rgba(179, 197, 208, 0.26), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.site-header,
.hero-copy,
.hero-visual,
.project-card,
.site-footer,
.cookie-banner,
.overlay-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: -14px -14px 28px var(--shadow-light), 14px 14px 28px var(--shadow-dark);
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
}

.brand,
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px 10px 10px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #eef4f8);
  box-shadow: -8px -8px 18px rgba(255, 255, 255, 0.95), 8px 8px 18px rgba(181, 196, 207, 0.35);
  font-size: 1.25rem;
  font-weight: 700;
}

.brand img {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: -6px -6px 16px rgba(255, 255, 255, 0.9), 10px 10px 22px rgba(125, 142, 153, 0.28);
}

.header-actions,
.site-nav,
.footer-links,
.cookie-actions,
.action-row,
.section-headline {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.header-actions {
  justify-content: flex-end;
}

.nav-link,
.site-nav a {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--surface-soft);
  box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.95), 8px 8px 16px rgba(187, 204, 215, 0.35);
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(145deg, rgb(122, 185, 214), rgb(103, 162, 192));
  color: #ffffff;
  box-shadow: inset -4px -4px 12px rgba(255, 255, 255, 0.16), inset 4px 4px 12px rgba(57, 111, 137, 0.2),
    10px 10px 20px rgba(103, 162, 192, 0.26);
}

.button-secondary {
  background: var(--surface-soft);
  color: var(--accent-strong);
  box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.95), 8px 8px 16px rgba(187, 204, 215, 0.35);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  margin-top: 34px;
}

.hero-copy,
.hero-visual,
.project-card,
.site-footer,
.cookie-banner,
.overlay-panel {
  padding: 32px;
}

.eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.02;
  max-width: 14ch;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero-text,
.section-heading p,
.site-footer,
.cookie-copy p,
.rich-content {
  color: var(--text-soft);
  line-height: 1.7;
}

.hero-copy {
  display: grid;
  align-content: center;
}

.hero-visual {
  display: grid;
  place-items: center;
  min-height: 360px;
  background: linear-gradient(180deg, rgba(103, 162, 192, 0.08), transparent 100%), var(--surface);
}

.hero-visual img {
  width: min(100%, 420px);
  max-height: 420px;
  object-fit: contain;
  border-radius: 28px;
  box-shadow: -12px -12px 24px rgba(255, 255, 255, 0.92), 12px 12px 24px rgba(155, 171, 183, 0.24);
}

.projects-section {
  margin-top: 90px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  overflow: hidden;
}

.project-thumb-link {
  display: block;
  border-radius: var(--radius-lg);
  transition: transform 160ms ease;
}

.project-thumb-link:hover {
  transform: translateY(-3px);
}

.project-thumb {
  min-height: 250px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #ffffff, #eef4f8);
  box-shadow: inset 8px 8px 18px rgba(186, 202, 212, 0.28), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.project-thumb img,
.project-thumb video {
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: -10px -10px 22px rgba(255, 255, 255, 0.92), 12px 12px 24px rgba(155, 171, 183, 0.28);
}

.project-thumb video {
  background: #dfe9ef;
}

.project-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.carousel-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-strong);
  box-shadow: -6px -6px 12px rgba(255, 255, 255, 0.95), 6px 6px 12px rgba(187, 204, 215, 0.32);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.carousel-status {
  min-width: 56px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

.project-media-disabled {
  filter: grayscale(0.4) brightness(0.9);
  opacity: 0.7;
  user-select: none;
  -webkit-user-select: none;
}

.project-disabled .project-thumb img,
.project-disabled .project-thumb video {
  filter: grayscale(0.4) brightness(0.9);
  opacity: 0.7;
  user-select: none;
  -webkit-user-select: none;
}

.project-body {
  padding: 22px 6px 0;
}

.project-body h3 {
  margin: 0 0 10px;
  font-size: 1.42rem;
}

.project-body a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  color: var(--accent-strong);
  background: var(--surface-soft);
  box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.95), 8px 8px 16px rgba(187, 204, 215, 0.35);
  font-weight: 700;
}

.project-link-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  color: rgba(23, 55, 70, 0.48);
  background: #eef3f6;
  box-shadow: inset 6px 6px 12px rgba(185, 201, 211, 0.3), inset -6px -6px 12px rgba(255, 255, 255, 0.9);
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
}

.site-footer {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
}

.cookie-banner {
  position: fixed;
  left: 76px;
  right: 16px;
  bottom: 16px;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.consent-reopen {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 23;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: -10px -10px 22px rgba(255, 255, 255, 0.95), 10px 10px 22px rgba(166, 183, 194, 0.45);
  font-size: 1.35rem;
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(245, 250, 253, 0.72);
  backdrop-filter: blur(10px);
}

.overlay-panel {
  position: relative;
  width: min(1200px, 100%);
  max-height: min(92vh, 1000px);
  overflow: auto;
}

.auth-panel {
  width: min(460px, 100%);
}

.legal-panel {
  width: min(920px, 100%);
}

.overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.overlay-body,
.settings-layout {
  display: grid;
  gap: 22px;
}

.settings-section,
.legal-section-block {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.settings-section h3,
.legal-section-block h3 {
  margin: 0 0 12px;
}

.settings-section p,
.legal-section-block p,
.settings-status {
  color: var(--text-soft);
  line-height: 1.65;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.settings-field-full {
  grid-column: 1 / -1;
}

.settings-field input,
.settings-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 8px 8px 18px rgba(181, 198, 209, 0.26), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
  font: inherit;
  color: var(--text-main);
}

.project-toggle {
  align-content: start;
}

.project-toggle input[type="checkbox"] {
  appearance: auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  margin-top: 10px;
  justify-self: start;
  accent-color: var(--accent-strong);
  box-shadow: none;
}

.project-editor-list {
  display: grid;
  gap: 16px;
}

.project-row {
  display: grid;
  grid-template-columns: 56px minmax(180px, 0.95fr) minmax(220px, 1.05fr) 132px minmax(320px, 1.6fr) minmax(220px, 1.05fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 22px;
}

.project-actions {
  display: grid;
  gap: 8px;
}

.icon-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
}

.project-row.dragging {
  opacity: 0.68;
  transform: scale(0.995);
}

.project-row.drop-target {
  outline: 2px dashed rgba(25, 97, 128, 0.35);
  outline-offset: 4px;
}

.project-upload {
  display: grid;
  gap: 8px;
}

.project-media-editor,
.project-media-list {
  display: grid;
  gap: 10px;
}

.project-media-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 88px 40px;
  gap: 8px;
  align-items: center;
}

.project-media-row select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 8px 8px 18px rgba(181, 198, 209, 0.26), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
  font: inherit;
  color: var(--text-main);
}

.project-media-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.project-upload-preview {
  width: 100%;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-strong);
  box-shadow: inset 8px 8px 18px rgba(181, 198, 209, 0.24), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.site-upload-preview {
  width: 100%;
  height: 160px;
  border-radius: 20px;
  object-fit: contain;
  background: var(--surface-strong);
  box-shadow: inset 8px 8px 18px rgba(181, 198, 209, 0.24), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.upload-input {
  width: 100%;
}

.editor-shell {
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: inset 8px 8px 18px rgba(181, 198, 209, 0.24), inset -8px -8px 18px rgba(255, 255, 255, 0.95);
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid rgba(25, 97, 128, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.editor-tool {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: -6px -6px 12px rgba(255, 255, 255, 0.95), 6px 6px 12px rgba(183, 201, 212, 0.28);
  font: inherit;
  color: var(--text-main);
  cursor: pointer;
}

.editor-surface {
  min-height: 180px;
  padding: 14px 16px;
  outline: 0;
  color: var(--text-main);
  line-height: 1.65;
}

.editor-surface.editor-compact {
  min-height: 110px;
}

.editor-surface::selection,
.editor-surface *::selection {
  background: rgba(103, 162, 192, 0.24);
}

.editor-surface strong,
.editor-surface b,
.rich-content strong,
.rich-content b {
  color: var(--accent-strong);
}

.editor-surface em,
.editor-surface i,
.rich-content em,
.rich-content i {
  color: #2a84a7;
}

.editor-surface a,
.rich-content a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.editor-surface ul,
.editor-surface ol,
.rich-content ul,
.rich-content ol {
  padding-left: 22px;
}

.editor-surface li::marker,
.rich-content li::marker {
  color: var(--accent-strong);
}

.editor-surface h3,
.editor-surface h4,
.rich-content h3,
.rich-content h4 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-family: "Space Grotesk", sans-serif;
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content h3,
.rich-content h4 {
  margin: 0 0 14px;
}

.settings-status {
  min-height: 24px;
  margin: 0;
}

.settings-status.error {
  color: #b14d4d;
}

.settings-status.success {
  color: var(--accent-strong);
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--surface-strong);
}

@media (max-width: 1120px) {
  .project-grid,
  .hero,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .project-row {
    grid-template-columns: 1fr;
  }

  .project-actions {
    grid-template-columns: repeat(4, 40px);
  }

  .project-media-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1220px);
    padding-bottom: 156px;
  }

  .site-header,
  .hero-copy,
  .hero-visual,
  .project-card,
  .site-footer,
  .cookie-banner,
  .overlay-panel {
    padding: 24px;
  }

  .site-header,
  .site-footer,
  .cookie-banner,
  .header-actions,
  .section-headline,
  .action-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner {
    left: 16px;
  }

  .brand {
    width: 100%;
  }

  .brand img {
    width: 68px;
    height: 68px;
  }
}
