:root {
  --black: #0f0d0e;
  --gold: #c9a24b;
  --blush: #f3e3e0;
  --cream: #fbf7f2;
  --ink: #231f20;
  --muted: #6b5f5c;
}

/* Gold text is used only on black. Phones first. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}
h1, h2, h3, .brand { font-family: Georgia, "Times New Roman", serif; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.preview-note {
  padding: .5rem 1rem;
  background: #fff1c2;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: .75rem 1.25rem;
  background: var(--black);
}
.brand { color: var(--gold); font-size: 1.4rem; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.nav a { color: var(--cream); font-size: .95rem; text-decoration: none; padding: .25rem 0; }
.nav a:hover, .nav a.nav-appt { color: var(--gold); }
.nav a.nav-login, .nav .nav-out {
  padding: .1rem .9rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}

.hero {
  padding: 3.5rem 1.25rem;
  border-top: 1px solid var(--gold);
  background: var(--black);
  color: var(--cream);
  text-align: center;
}
.hero h1 { margin: 0; color: var(--gold); font-size: clamp(2.2rem, 9vw, 4rem); line-height: 1.15; }
.tagline { margin: .75rem 0 1.75rem; }
.actions { display: flex; flex-direction: column; gap: .75rem; max-width: 520px; margin: 1.5rem auto 0; }
.tagline + .actions { margin-top: 0; }

.btn {
  display: inline-block;
  min-height: 48px;
  padding: .65rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.btn-call { background: var(--gold); color: var(--black); }
.btn-text { border-color: var(--gold); color: var(--gold); }
.btn-directions { background: var(--black); color: var(--cream); }
.btn-appt { border-color: var(--gold); background: var(--gold); color: var(--black); }
/* Appointments is the main button: Call beside it is only outlined. */
.btn-appt ~ .btn-call,
.actionbar .btn-call:not(:only-child) { border-color: var(--gold); background: transparent; color: var(--gold); }

.section { padding: 2.5rem 1.25rem; scroll-margin-top: 4rem; }
.section > * { max-width: 960px; margin-left: auto; margin-right: auto; }
.section h2 { margin-top: 0; font-size: 1.8rem; text-align: center; }
#gallery, #visit { background: var(--blush); }
#visit { text-align: center; }
#visit a:not(.btn) { color: var(--ink); }

/* Booking, login, account and admin pages */
.section h1 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; line-height: 1.3; text-align: center; }
.shade { background: var(--blush); }
.center { text-align: center; }
[hidden] { display: none !important; }

.form { display: flex; flex-direction: column; gap: .5rem; max-width: 520px; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.form label, .label { margin-bottom: 0; font-weight: 600; }
.form input:not([type="checkbox"]),
.form select,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: .5rem .75rem;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
button.btn { font: inherit; font-weight: 600; cursor: pointer; }
button.btn:disabled { opacity: .6; cursor: wait; }
.btn-dark { margin-top: .75rem; background: var(--black); color: var(--cream); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-light { border-color: var(--muted); background: transparent; color: var(--ink); }
.link { border: 0; background: none; padding: .5rem; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; text-align: center; }
.hint a { color: var(--ink); }
.good { margin: 0; color: #2f6b1f; font-weight: 600; text-align: center; }
.bad { margin: 0; color: #a32d2d; font-weight: 600; text-align: center; }
.done { text-align: center; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .5rem; }
.slots .hint { grid-column: 1 / -1; }
.slot, .tabs button {
  min-height: 44px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.slot[aria-pressed="true"] { background: var(--gold); font-weight: 700; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; max-width: 520px; margin-bottom: 1rem; }
.tabs button { border-color: var(--black); }
.tabs button[aria-pressed="true"] { background: var(--black); color: var(--cream); }

.menu-list { max-width: 640px; }
.menu-list li .btn { min-height: 36px; padding: .15rem 1rem; font-size: .9rem; }
.menu-list .service-price { min-width: 3rem; text-align: right; }
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.design { display: flex; flex-direction: column; gap: .35rem; text-align: center; }
.design img { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; object-fit: cover; }
.design p { margin: 0; overflow-wrap: anywhere; }
.design .btn { margin-top: auto; padding-left: .5rem; padding-right: .5rem; }
.chosen { display: flex; gap: .75rem; align-items: center; padding: .75rem; border: 2px solid var(--gold); border-radius: 12px; }
.chosen img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; }
.chosen p { margin: 0; }
.stars { display: flex; gap: .25rem; }
.star { width: 48px; height: 48px; border: 0; background: none; color: #8a5a00; font-size: 2rem; line-height: 1; cursor: pointer; }
.rating { color: #8a5a00; font-size: 1.2rem; letter-spacing: .1em; }
.who { color: var(--muted); font-size: .9rem; }
.status-hidden { color: var(--muted); }
.admin-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; padding: .75rem 1rem 0; }
.admin-jump a { color: var(--ink); font-weight: 600; }
.photos { display: flex; flex-wrap: wrap; gap: .5rem; }
.photos img { display: block; width: 96px; height: 96px; border: 1px solid var(--blush); border-radius: 10px; object-fit: cover; }
.cards { display: flex; flex-direction: column; gap: .75rem; max-width: 640px; }
.card { padding: 1rem; border: 1px solid var(--blush); border-radius: 12px; background: #fff; }
.card p { margin: 0 0 .25rem; overflow-wrap: anywhere; }
.card a:not(.btn) { color: var(--ink); }
.card .bad { text-align: left; }
.when { font-weight: 700; }
.status { font-weight: 600; }
.status-pending { color: #7a5200; }
.status-confirmed { color: #2f6b1f; }
.status-declined, .status-cancelled { color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.card > .btn { margin-top: .5rem; }

.hour-row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: .25rem .5rem; margin-bottom: .75rem; }
/* On a phone the day has its own line, so that AM and PM stay readable. */
.hour-row .check { display: flex; grid-column: 1 / -1; align-items: center; gap: .4rem; font-weight: 400; }
.hour-row input[type="checkbox"] { width: 1.25rem; height: 1.25rem; }
.form .hour-row input[type="time"] { min-width: 0; padding: .25rem .4rem; }

.service-category { max-width: 640px; }
.price-list { margin: 0; padding: 0; list-style: none; }
.price-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--blush);
}
.service-note { color: var(--muted); font-size: .9rem; }
.service-price { margin-left: auto; font-weight: 700; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.gallery figure { margin: 0; }
.gallery img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; }

table.hours { width: 100%; max-width: 520px; border-collapse: collapse; }
table.hours th, table.hours td { padding: .6rem 0; border-bottom: 1px solid var(--blush); }
table.hours th { text-align: left; }
table.hours td { text-align: right; }

address { margin-bottom: 1rem; font-style: normal; }
.site-footer {
  padding: 1.5rem 1.5rem calc(84px + env(safe-area-inset-bottom)); /* room for the bottom bar */
  background: var(--black);
  color: var(--cream);
  text-align: center;
}

.actionbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  gap: .5rem;
  padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
  background: var(--black);
}
.actionbar .btn { flex: 1; padding-left: .5rem; padding-right: .5rem; }
.actionbar .btn-appt { flex: 1.7; }

@media (min-width: 720px) {
  .site-footer { padding-bottom: 1.5rem; }
  .hour-row { grid-template-columns: 8.5rem 1fr 1fr; }
  .hour-row .check { grid-column: auto; }
  .actionbar { display: none; }
  .site-header { position: sticky; top: 0; z-index: 10; }
  .actions { flex-direction: row; justify-content: center; max-width: 720px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- 3D ---------- */
.hero {
  padding-top: 2rem;
  background: radial-gradient(ellipse at 50% 18%, #3a2d1c 0%, var(--black) 62%);
  overflow: hidden;
}
.hero h1 {
  text-shadow: 0 1px 0 #b08d3c, 0 2px 0 #9a7a32, 0 3px 0 #836729, 0 4px 0 #6c5521, 0 5px 0 #55421a,
    0 10px 18px rgba(0, 0, 0, .7);
}
.scene { display: flex; justify-content: center; align-items: center; height: 230px; margin-bottom: 1rem; perspective: 900px; }
.tilt { transform: rotateX(var(--rx, -14deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .2s ease-out; }
.ring { position: relative; width: 76px; height: 152px; transform-style: preserve-3d; animation: spin 22s linear infinite; }
/* Real nails cut out of the salon's photos; their own outline and shine are kept. */
/* Drawn at twice the size and scaled back (scale(.5) below): the browser then keeps the picture sharp in 3D. */
.nail {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: center / contain no-repeat;
}
.nail:nth-child(1) { transform: rotateY(0deg) translateZ(135px) scale(.5); background-image: url("/nail-1.webp"); }
.nail:nth-child(2) { transform: rotateY(45deg) translateZ(135px) scale(.5); background-image: url("/nail-2.webp"); }
.nail:nth-child(3) { transform: rotateY(90deg) translateZ(135px) scale(.5); background-image: url("/nail-3.webp"); }
.nail:nth-child(4) { transform: rotateY(135deg) translateZ(135px) scale(.5); background-image: url("/nail-4.webp"); }
.nail:nth-child(5) { transform: rotateY(180deg) translateZ(135px) scale(.5); background-image: url("/nail-5.webp"); }
.nail:nth-child(6) { transform: rotateY(225deg) translateZ(135px) scale(.5); background-image: url("/nail-6.webp"); }
.nail:nth-child(7) { transform: rotateY(270deg) translateZ(135px) scale(.5); background-image: url("/nail-7.webp"); }
.nail:nth-child(8) { transform: rotateY(315deg) translateZ(135px) scale(.5); background-image: url("/nail-8.webp"); }
@keyframes spin { to { transform: rotateY(360deg); } }

/* Buttons that sink when pressed */
.btn-appt, .btn-call, .btn-gold, .btn-dark, .btn-directions { transition: transform .08s, box-shadow .08s; }
.btn-appt, .btn-gold, .hero .btn-call:only-of-type { box-shadow: 0 5px 0 #7d5f1f, 0 8px 14px rgba(0, 0, 0, .25); }
.btn-dark, .btn-directions { box-shadow: 0 5px 0 #4a4044, 0 8px 14px rgba(0, 0, 0, .2); }
.btn-appt:active, .btn-gold:active, .btn-dark:active, .btn-directions:active { transform: translateY(4px); box-shadow: 0 1px 0 #4a4044; }

/* Cards with depth; fx.js leans them toward the pointer */
.design, .card {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .15s ease-out, box-shadow .15s;
}
.card { box-shadow: 0 8px 20px rgba(60, 30, 25, .12); }
.design img { box-shadow: 0 12px 22px rgba(60, 30, 25, .28); }
.design img, .design .btn { transform: translateZ(24px); }

@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; transform: rotateY(22deg); }
  .tilt, .design, .card, .btn { transition: none; }
}

/* ---------- page frame and tiles ---------- */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; max-width: 1100px; width: 100%; margin: 0 auto; padding: 1.5rem 1.25rem; }
.tile { padding: 1rem .75rem; border: 1px solid var(--blush); border-radius: 14px; background: #fff; color: var(--ink);
  text-decoration: none; box-shadow: 0 8px 18px rgba(60, 30, 25, .14); }
.tile strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; }
.tile span { color: var(--muted); font-size: .9rem; line-height: 1.4; }

/* ---------- computer screens ---------- */
@media (min-width: 900px) {
  .site-header { padding-left: max(1.5rem, calc((100% - 1100px) / 2)); padding-right: max(1.5rem, calc((100% - 1100px) / 2)); }
  .nav { gap: 1.5rem; align-items: center; }
  .section { padding: 3.5rem 2rem; }
  .section h1, .section h2 { font-size: 2.4rem; }

  /* Home: the ring of nails on the left, name and buttons on the right */
  .hero { display: grid; grid-template-columns: 1fr 1fr; align-content: center; align-items: center; column-gap: 2rem;
    min-height: 520px; padding: 3rem max(2rem, calc((100% - 1100px) / 2)); }
  .hero .scene { grid-column: 1; grid-row: 1 / span 3; margin: 0; transform: scale(1.4); }
  .hero h1, .hero .tagline, .hero .actions { grid-column: 2; }
  .hero h1 { font-size: 4rem; }
  .hero .actions { flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; padding: 3rem 2rem; text-align: center; }
  .tile { padding: 1.75rem 1rem; }

  /* Booking: two columns */
  #book-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: end; max-width: 820px; }
  #book-form > * { grid-column: 1 / -1; }
  #book-form > .field:not(#photo-box):not(#tech-name-box) { grid-column: auto; }
  #book-form > .field:last-of-type:not(#photo-box):not(#tech-name-box) { grid-column: 1 / -1; }
  #book-form .btn-dark { justify-self: center; min-width: 20rem; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }

  .menu-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; max-width: 960px; }
  .menu-list li:only-child { grid-column: 1 / -1; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); align-items: start; gap: 1.25rem; max-width: 1100px; }
  .cards > p { grid-column: 1 / -1; }
  .designs { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem; max-width: 1100px; }
}

a.design { color: var(--ink); text-decoration: none; }
.latest .designs { grid-template-columns: 1fr 1fr; margin-bottom: 1.5rem; }
.latest .design p { font-weight: 600; }
@media (min-width: 900px) {
  .latest .designs { grid-template-columns: repeat(4, 1fr); }
}

.design-edit { display: flex; flex-direction: column; gap: .4rem; text-align: left; }
.design-edit label { display: flex; flex-direction: column; font-size: .9rem; font-weight: 600; }
.design-edit input { width: 100%; min-height: 44px; padding: .35rem .6rem; border: 1px solid var(--muted);
  border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 400; }
.design-edit .btn { min-height: 44px; }
/* The admin's list stays flat, so that cards do not cover each other. */
#design-list { gap: 1.5rem 1rem; }
#design-list .design { transform: none; }
#design-list .design img, #design-list .design .btn { transform: none; }

/* Design descriptions */
.about { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.about.short { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.chosen > div { min-width: 0; overflow-wrap: anywhere; }
.design-edit textarea { width: 100%; padding: .35rem .6rem; border: 1px solid var(--muted); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 400; resize: vertical; }

.price-note { max-width: 640px; margin: 1rem auto; padding: .6rem 1rem; border: 1px solid var(--gold); border-radius: 12px;
  background: #fff7e2; color: var(--ink); font-size: .95rem; font-weight: 600; text-align: center; }
