:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-soft: #151316;
  --ink: #f6f3f7;
  --muted: #aaa2ad;
  --line: rgba(255, 255, 255, 0.14);
  --violet: #9b5cff;
  --red: #d02b52;
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 12%, rgba(155, 92, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 8% 82%, rgba(208, 43, 82, 0.12), transparent 22rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    sans-serif;
  line-height: 1.65;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(5, 5, 5, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-size: 14px;
}

nav a:hover,
footer a:hover {
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: 94vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  align-items: end;
  gap: clamp(18px, 4vw, 48px);
  overflow: hidden;
  padding: 110px clamp(18px, 6vw, 86px) clamp(44px, 10vh, 96px);
  border-bottom: 1px solid var(--line);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.9), rgba(5, 5, 5, 0.22) 58%),
    linear-gradient(0deg, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.06) 48%);
}

.hero-copy,
.hero-card {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-copy {
  max-width: 820px;
}

.kicker,
.section-title p {
  margin: 0 0 10px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 96px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.hero-copy > p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: #e5dfe9;
  font-size: clamp(16px, 2vw, 20px);
}

.hero-card {
  padding: 20px;
  background: rgba(9, 9, 10, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 70px var(--shadow);
}

.hero-card span,
.hero-card p {
  color: var(--muted);
}

.hero-card strong {
  display: block;
  margin: 12px 0;
  font-size: 26px;
  line-height: 1.1;
}

.intro,
.section-block {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.intro {
  padding: clamp(42px, 7vw, 86px) 0 18px;
  font-size: clamp(22px, 4vw, 42px);
  line-height: 1.3;
}

.section-block {
  padding: clamp(56px, 8vw, 104px) 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin-bottom: 16px;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.05;
}

.gallery {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 0.9fr;
  gap: 16px;
}

.work {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 70px var(--shadow);
}

.work:first-child {
  grid-row: span 2;
  min-height: 660px;
}

.work img,
.post-cover img,
.post-images img,
.image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.work img {
  min-height: inherit;
  filter: contrast(1.08) saturate(0.95);
  transition: transform 0.45s ease, filter 0.45s ease;
}

.work:hover img {
  transform: scale(1.035);
  filter: contrast(1.14) saturate(1.08);
}

.work-text {
  position: absolute;
  inset: auto 0 0;
  padding: 20px;
  background: linear-gradient(0deg, rgba(5, 5, 5, 0.9), transparent);
}

.work h3 {
  margin-bottom: 2px;
  font-size: 22px;
}

.work p,
.post time,
.comment time,
.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.journal-section,
.guestbook,
.studio {
  border-top: 1px solid var(--line);
}

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

.post,
.comment-form,
.comment,
.admin-bar,
.post-form {
  background: rgba(13, 13, 15, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  overflow: hidden;
}

.post-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.post-cover {
  height: 210px;
  border-bottom: 1px solid var(--line);
}

.post h3 {
  margin: 12px 0;
  font-size: 25px;
  line-height: 1.2;
}

.post p {
  color: #d7d0da;
  white-space: pre-line;
}

.post-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.post-images img {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.post-actions,
.form-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.post-actions {
  justify-content: space-between;
}

.like-button,
.edit-button,
.comment-form button,
.admin-bar button,
.post-form button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #1a1a1e;
  padding: 0 16px;
}

.like-button.is-liked {
  background: var(--red);
  border-color: var(--red);
}

.edit-button,
.post-form button[type="button"] {
  color: var(--muted);
}

.guestbook {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.guestbook .section-title {
  grid-column: 1 / -1;
  margin-bottom: 6px;
}

.comment-form,
.admin-bar,
.post-form {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 18px;
}

.admin-bar {
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  margin-bottom: 16px;
}

.post-form[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.check-line {
  display: flex;
  align-items: center;
}

.check-line input {
  width: auto;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
  color: var(--ink);
  padding: 12px 13px;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.18);
}

.comment-form button,
.admin-bar button,
.post-form button[type="submit"] {
  justify-self: start;
  background: var(--violet);
  border-color: var(--violet);
}

.comments {
  display: grid;
  gap: 12px;
}

.comment {
  padding: 16px;
}

.comment strong {
  display: block;
  margin-bottom: 4px;
}

.comment p {
  margin: 10px 0 0;
  color: #e3dde7;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.image-preview img {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--line);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.icp-link {
  width: 100%;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
    padding-block: 14px;
  }

  .hero,
  .gallery,
  .posts,
  .guestbook,
  .admin-bar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .work,
  .work:first-child {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .site-header,
  footer,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
    gap: 20px;
  }

  .hero {
    min-height: 86vh;
    padding-inline: 28px;
  }

  h1 {
    font-size: clamp(34px, 13vw, 48px);
    line-height: 1.05;
  }

  .work,
  .work:first-child {
    min-height: 340px;
  }
}
