/* 画先生 — official site, editorial luxury */

:root {
  --bg: #f6f1e8;
  --bg-elevated: #fbf8f2;
  --accent: #c4a574;
  --accent-soft: rgba(196, 165, 116, 0.14);
  --ivory: #f6f1e8;
  --profile-text: #1c1917;
  --taupe: #8a8074;
  --taupe-strong: #6f675e;
  --hairline: rgba(196, 165, 116, 0.4);
  --hairline-soft: rgba(196, 165, 116, 0.24);
  --ink: #1c1917;
  --on-accent: #1c1917;
  --surface-muted: #efe8dc;
  --backdrop: rgba(40, 32, 24, 0.28);
  --status-success: #4f6a3e;
  --status-info: #8a6b3c;
  --status-error: #a35a4e;
  --vignette-top: rgba(196, 165, 116, 0.08);
  --vignette-bottom: rgba(140, 118, 80, 0.06);
  --grain-opacity: 0.14;
  --grain-blend: multiply;
  --serif-latin: "Cormorant Garamond", "Noto Serif SC", "Songti SC", serif;
  --serif: "Noto Serif SC", "Cormorant Garamond", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sheet: 8px;
  --shadow-sheet: 0 16px 40px rgba(80, 60, 36, 0.12), 0 2px 8px rgba(80, 60, 36, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html {
  color-scheme: light;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
textarea {
  font-family: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  pointer-events: none;
}

.page-bg-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("../assets/grain.png");
  background-repeat: repeat;
  background-size: 180px 180px;
  mix-blend-mode: var(--grain-blend);
}

.page-bg-dim {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 8%, var(--vignette-top) 0%, transparent 52%),
    radial-gradient(ellipse at 50% 100%, var(--vignette-bottom) 0%, transparent 58%);
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 52px 22px calc(96px + env(safe-area-inset-bottom));
}

@media (min-width: 800px) {
  .page {
    padding: 80px 48px 120px;
  }
}

/* Profile */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 8px 8px;
}

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: var(--surface-muted);
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--hairline);
}

.name {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.18em;
  color: var(--profile-text);
}

.bio {
  margin: 12px 0 0;
  max-width: 24em;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.04em;
  color: var(--profile-text);
  opacity: 0.88;
}

.bio[hidden] {
  display: none;
}

.profile::after {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  margin-top: 28px;
  background: var(--accent);
  opacity: 0.7;
}

/* Sections */
.block {
  margin-top: 56px;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 4px;
}

.section-index {
  font-family: var(--serif-latin);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
}

.section-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--taupe);
  line-height: 1;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: 4px;
  background: var(--hairline);
  transform: translateY(-3px);
}

/* Editorial entry rows */
.entry-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 26px 2px 28px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.25s ease;
}

.entry-row:hover,
.entry-row:focus-visible {
  border-color: var(--accent);
}

.entry-kicker {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--accent);
  line-height: 1.3;
}

.entry-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}

.entry-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.08em;
  color: var(--profile-text);
}

.entry-desc {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--taupe);
}

.entry-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  margin-top: 10px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.18em;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.entry-action::after {
  content: " →";
  font-family: var(--serif-latin);
  letter-spacing: 0;
  margin-left: 2px;
}

.entry-row:hover .entry-action,
.entry-row:focus-visible .entry-action {
  background: var(--accent);
  color: var(--on-accent);
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-top: 22px;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  color: var(--profile-text);
  background: transparent;
}

.product-photo {
  aspect-ratio: 3 / 2;
  padding: 6px;
  border: 1px solid var(--hairline);
  background: transparent;
  overflow: hidden;
}

.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-muted);
}

.product-photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--taupe);
  font-size: 16px;
  letter-spacing: 0.08em;
  background: var(--surface-muted);
  min-height: 100%;
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 2px 4px;
  flex: 1;
}

.product-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.08em;
}

.product-intro {
  margin: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--taupe-strong);
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  height: 46px;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.18em;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-apply::after {
  content: " →";
  font-family: var(--serif-latin);
  letter-spacing: 0;
  margin-left: 2px;
}

.btn-apply:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.product-empty {
  margin: 22px 0 0;
  padding: 36px 16px;
  text-align: center;
  border: 1px solid var(--hairline-soft);
  color: var(--taupe);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.product-empty[hidden] {
  display: none;
}

/* Footer */
.site-footer {
  margin-top: 80px;
  padding: 0 8px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--taupe);
}

.footer-dot {
  margin: 0 8px;
  color: var(--accent);
  opacity: 0.85;
}

.settings-link {
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.22em;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.settings-link:hover,
.settings-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

body.is-preview .settings-link,
body.is-preview .footer-dot {
  display: none;
}

/* Modals / sheets */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  animation: fade-in 0.25s ease;
}

.sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 780px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-bottom: 0;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 14px 24px calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-sheet);
  animation: sheet-up 0.28s ease;
}

.sheet-handle {
  width: 32px;
  height: 1px;
  margin: 6px auto 14px;
  background: var(--accent);
  opacity: 0.55;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--taupe);
  transition: color 0.25s ease;
}

.sheet-close:hover {
  color: var(--ink);
}

.sheet-kicker {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.sheet-title {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  line-height: 1.3;
}

.sheet-title::after {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  margin-top: 16px;
  background: var(--accent);
  opacity: 0.7;
}

.sheet-lead {
  margin: 16px 0 0;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.03em;
  color: var(--taupe-strong);
}

.sheet-prose {
  margin-top: 16px;
}

.sheet-prose p {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
}

.sheet-prose p:last-child {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
    padding: 32px 24px;
  }

  .sheet {
    border-radius: 6px;
    border-bottom: 1px solid var(--hairline);
    padding: 28px 32px 32px;
    animation: sheet-in 0.25s ease;
  }

  .sheet-handle {
    display: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes sheet-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Forms */
.apply-form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field {
  display: block;
}

.field > span {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--taupe-strong);
}

.field em {
  font-style: normal;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  padding: 10px 0 11px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.03em;
  outline: none;
  resize: vertical;
  transition: border-color 0.25s ease;
}

.field textarea {
  min-height: 104px;
  padding-top: 8px;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  resize: none;
  padding-right: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A8E80' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 9 12 16 17.5 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 14px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(154, 142, 128, 0.7);
  font-weight: 300;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-bottom-color: var(--accent);
}

.field input[readonly] {
  color: var(--taupe-strong);
  cursor: default;
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-bottom-color: var(--status-error);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.16em;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.btn-submit:hover {
  background: #d4b68a;
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.form-status {
  margin: 0;
  padding: 10px 0;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.03em;
}

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

.form-status.is-success {
  color: var(--status-success);
}

.form-status.is-info {
  color: var(--status-info);
}

.form-status.is-error {
  color: var(--status-error);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 12px 20px;
  border: 1px solid var(--hairline);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.5;
  max-width: calc(100% - 32px);
  pointer-events: none;
}

.toast[hidden] {
  display: none;
}

@media (min-width: 800px) {
  .name {
    font-size: 42px;
  }

  .entry-title {
    font-size: 38px;
  }

  .avatar {
    width: 80px;
    height: 80px;
  }

  .block {
    margin-top: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-row,
  .entry-action,
  .btn-apply,
  .btn-submit,
  .modal-backdrop,
  .sheet,
  .settings-link,
  .field input,
  .field textarea,
  .field select,
  .sheet-close {
    transition: none;
    animation: none;
  }
}
