:root {
  --ink: #20211d;
  --paper: #f2ede3;
  --card: #faf7f0;
  --tobacco: #a9552d;
  --line: rgba(32, 33, 29, 0.15);
  --muted: #74736d;
  --old-gold: #847762;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Manrope, sans-serif;
  transition:
    background-color 0.45s ease,
    color 0.45s ease;
}


/* ---------------------------------
   HEADER
   --------------------------------- */

.site-header {
  height: 82px;
  padding: 0 clamp(24px, 6vw, 90px);

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;

  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;

  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border: 1px solid var(--ink);
  border-radius: 50%;

  font: 14px "DM Serif Display", serif;
  letter-spacing: 0;

  transition:
    transform 0.35s ease,
    border-color 0.4s ease,
    color 0.4s ease;
}

nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

nav a {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;

  text-decoration: none;
  text-transform: uppercase;
}

.nav-cta {
  padding: 10px 13px;

  background: var(--ink);
  color: #fff;
}

.nav-cta span {
  margin-left: 6px;
  color: #d99b76;
}


/* ---------------------------------
   PAGE / HERO
   --------------------------------- */

.page-shell {
  max-width: 1320px;
  margin: auto;

  padding:
    0
    clamp(24px, 6vw, 90px)
    80px;
}

.hero {
  padding: 86px 0 58px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 13px;

  color: var(--tobacco);

  font:
    500 10px "DM Mono",
    monospace;

  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;

  font:
    clamp(48px, 6vw, 88px) / 0.93
    "DM Serif Display",
    serif;

  letter-spacing: -0.055em;
}

.hero h1 em {
  font-style: italic;
}

.hero > p {
  max-width: 280px;
  margin: 0 0 6px;

  color: var(--muted);

  font-size: 13px;
  line-height: 1.8;
}


/* ---------------------------------
   COLLECTION STATS
   --------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  border-bottom: 1px solid var(--line);
}

.stats article {
  padding: 28px 0 25px;

  border-right: 1px solid var(--line);
}

.stats article + article {
  padding-left: 35px;
}

.stats article:last-child {
  border: 0;
}

.stats span {
  display: block;
  margin-bottom: 7px;

  color: var(--muted);

  font:
    10px "DM Mono",
    monospace;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats strong {
  font:
    35px "DM Serif Display",
    serif;

  letter-spacing: -0.03em;
}


/* ---------------------------------
   MAIN CONTENT
   --------------------------------- */

.content-grid {
  display: grid;

  grid-template-columns:
    minmax(360px, 0.82fr)
    1.18fr;

  gap: clamp(45px, 7vw, 110px);

  padding-top: 66px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 29px;
}

.section-title h2 {
  margin: 0;

  font:
    36px / 1 "DM Serif Display",
    serif;

  letter-spacing: -0.04em;
}

.entry-number {
  margin-top: 6px;

  color: var(--muted);

  font:
    9px "DM Mono",
    monospace;

  letter-spacing: 0.11em;
}


/* ---------------------------------
   FORM
   --------------------------------- */

.field {
  min-width: 0;
  margin: 0;

  border: 0;
}

.field label,
.field legend {
  display: block;
  margin: 0 0 8px;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;

  text-transform: uppercase;
}

.field label span {
  color: var(--muted);
  font-weight: 500;
}

input,
textarea {
  width: 100%;

  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;

  background: var(--card);

  padding: 13px;

  color: var(--ink);

  font:
    13px Manrope,
    sans-serif;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  border-color: var(--tobacco);

  box-shadow:
    0 0 0 3px rgba(169, 85, 45, 0.1);
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 14px;
  margin-top: 17px;
}


/* ---------------------------------
   FLAVOUR WHEEL
   --------------------------------- */

.flavour-field {
  margin-top: 17px;
  padding: 0;
}

.taste-wheel {
  position: relative;

  width: min(100%, 300px);
  aspect-ratio: 1;

  margin: 12px auto 18px;

  border: 1px solid var(--line);
  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      var(--card) 0 28%,
      transparent 28.5%
    ),
    radial-gradient(
      circle,
      rgba(169, 85, 45, 0.045),
      transparent 68%
    );

  display: flex;
  align-items: center;
  justify-content: center;
}


/* Wheel centre */

.taste-wheel::after {
  content: "FLAVOUR";

  position: absolute;

  width: 82px;
  height: 82px;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 50%;

  background: var(--card);

  color: var(--muted);

  font:
    9px "DM Mono",
    monospace;

  letter-spacing: 0.12em;

  pointer-events: none;
}


/*
   Six positions around the wheel.

   12 o'clock  = Woody
   2 o'clock   = Earthy
   4 o'clock   = Spicy
   6 o'clock   = Creamy
   8 o'clock   = Sweet
   10 o'clock  = Leather
*/

.taste {
  position: absolute;

  width: 72px;
  height: 72px;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 50%;

  background: var(--card);

  padding: 0;

  color: var(--muted);

  font-size: 10px;
  text-align: center;

  cursor: pointer;

  transform:
    translate(-50%, -50%);

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}


/* Woody */

.taste:nth-child(1) {
  top: 12%;
  left: 50%;
}


/* Earthy */

.taste:nth-child(2) {
  top: 30%;
  left: 82%;
}


/* Spicy */

.taste:nth-child(3) {
  top: 70%;
  left: 82%;
}


/* Creamy */

.taste:nth-child(4) {
  top: 88%;
  left: 50%;
}


/* Sweet */

.taste:nth-child(5) {
  top: 70%;
  left: 18%;
}


/* Leather */

.taste:nth-child(6) {
  top: 30%;
  left: 18%;
}


/* Hover */

.taste:hover {
  border-color: var(--tobacco);
  color: var(--tobacco);

  transform:
    translate(-50%, -50%)
    scale(1.08);
}


/* Selected */

.taste.active {
  border-color: var(--tobacco);
  background: var(--tobacco);
  color: #fff;

  box-shadow:
    0 4px 12px rgba(169, 85, 45, 0.18);

  transform:
    translate(-50%, -50%)
    scale(1.08);
}


/* ---------------------------------
   IMAGE UPLOAD
   --------------------------------- */

.upload-field {
  margin-top: 17px;
}

.upload-label {
  display: flex;
  align-items: center;
  gap: 12px;

  margin: 0 !important;
  padding: 13px;

  border: 1px dashed var(--line);

  cursor: pointer;

  text-transform: none !important;

  transition:
    border-color 0.2s ease;
}

.upload-label:hover {
  border-color: var(--tobacco);
}

.upload-label input {
  display: none;
}

.upload-icon {
  width: 24px;
  height: 24px;

  display: grid;
  place-items: center;

  border: 1px solid var(--tobacco);
  border-radius: 50%;

  color: var(--tobacco);
  font-size: 18px;
}

.upload-label strong {
  display: block;

  font-size: 11px;
  letter-spacing: 0.02em;
}

.upload-label small {
  display: block;
  margin-top: 2px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 500;
}

.image-preview {
  display: none;
  position: relative;

  margin-top: 10px;
}

.image-preview img {
  width: 100%;
  max-height: 220px;

  object-fit: cover;
}

.image-preview button {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 27px;
  height: 27px;

  border: 0;
  border-radius: 50%;

  background: var(--ink);
  color: #fff;

  font-size: 18px;

  cursor: pointer;
}


/* ---------------------------------
   BUTTONS
   --------------------------------- */

.primary-button {
  width: 100%;

  display: flex;
  justify-content: space-between;

  margin-top: 20px;
  padding: 16px 17px;

  border: 0;

  background: var(--ink);
  color: #fff;

  font-size: 11px;
  letter-spacing: 0.07em;

  text-transform: uppercase;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.primary-button:hover {
  background: var(--tobacco);
  transform: translateY(-1px);
}

.text-button {
  border: 0;
  background: transparent;

  color: var(--tobacco);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;

  text-decoration: underline;
  text-underline-offset: 3px;

  text-transform: uppercase;

  cursor: pointer;
}


/* ---------------------------------
   ARCHIVE
   --------------------------------- */

.log-entries {
  display: grid;
  gap: 12px;
}

.empty-state {
  padding: 58px 25px;

  border: 1px dashed var(--line);

  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;

  font:
    25px "DM Serif Display",
    serif;
}

.empty-state p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.6;
}

.log-card {
  display: grid;

  grid-template-columns:
    88px
    1fr
    auto;

  gap: 17px;
  align-items: start;

  padding: 13px;

  border: 1px solid var(--line);

  background:
    rgba(250, 247, 240, 0.55);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.log-card:hover {
  transform: translateY(-1px);

  border-color:
    rgba(32, 33, 29, 0.25);
}

.log-image,
.log-image-placeholder {
  width: 88px;
  height: 88px;

  object-fit: cover;

  background: #d7c9b4;
}

.log-image-placeholder {
  display: grid;
  place-items: center;

  color: var(--old-gold);

  font:
    26px "DM Serif Display",
    serif;
}

.log-card h3 {
  margin: 2px 0 4px;

  font:
    22px "DM Serif Display",
    serif;

  letter-spacing: -0.02em;
}

.log-meta,
.log-notes {
  margin: 0;

  color: var(--muted);

  font-size: 11px;
  line-height: 1.7;
}

.log-notes {
  margin-top: 6px;
}

.log-rating {
  color: var(--tobacco);

  font:
    11px "DM Mono",
    monospace;
}

.delete-button {
  border: 0;
  background: transparent;

  color: #a09a90;

  font-size: 17px;

  cursor: pointer;

  transition:
    color 0.15s ease;
}

.delete-button:hover {
  color: var(--tobacco);
}


/* ---------------------------------
   FOOTER
   --------------------------------- */

footer {
  display: flex;
  justify-content: space-between;

  padding:
    27px
    clamp(24px, 6vw, 90px);

  border-top: 1px solid var(--line);

  color: var(--muted);

  font:
    10px "DM Mono",
    monospace;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ---------------------------------
   TOAST
   --------------------------------- */

.toast {
  position: fixed;

  bottom: 25px;
  left: 50%;

  padding: 12px 16px;

  background: var(--ink);
  color: #fff;

  font-size: 12px;

  opacity: 0;
  pointer-events: none;

  transform:
    translate(-50%, 10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.toast.show {
  opacity: 1;

  transform:
    translate(-50%, 0);
}


/* ---------------------------------
   SECRET: CIGAR HOUR
   Press C
   --------------------------------- */

body.cigar-hour {
  --paper: #e5d8c5;
  --card: #f3eadc;
  --ink: #2a211b;
  --muted: #75675b;
  --line: rgba(42, 33, 27, 0.18);
  --tobacco: #8f4325;

  background:
    radial-gradient(
      circle at 80% 15%,
      rgba(169, 85, 45, 0.08),
      transparent 30%
    ),
    var(--paper);
}


/* CV seal */

body.cigar-hour .brand-mark {
  transform:
    rotate(-10deg)
    scale(1.05);

  border-color: var(--tobacco);
  color: var(--tobacco);

  box-shadow:
    0 0 0 4px rgba(143, 67, 37, 0.04);
}


/* Navigation */

body.cigar-hour nav a {
  color: #4a382d;
}

body.cigar-hour .nav-cta {
  background: var(--tobacco);
}


/* Hero */

body.cigar-hour .hero {
  border-color:
    rgba(42, 33, 27, 0.2);
}

body.cigar-hour .hero h1 {
  letter-spacing: -0.045em;

  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25);
}

body.cigar-hour .hero h1 em {
  color: var(--tobacco);

  letter-spacing: 0.035em;
}


/* Stats */

body.cigar-hour .stats strong {
  color: #3a2a20;
}

body.cigar-hour .stats article {
  border-color:
    rgba(42, 33, 27, 0.16);
}


/* Inputs */

body.cigar-hour input,
body.cigar-hour textarea {
  background:
    rgba(250, 247, 240, 0.72);

  border-color:
    rgba(42, 33, 27, 0.17);
}

body.cigar-hour input:focus,
body.cigar-hour textarea:focus {
  border-color: var(--tobacco);

  box-shadow:
    0 0 0 3px rgba(143, 67, 37, 0.08);
}


/* Cigar Hour flavour wheel */

body.cigar-hour .taste-wheel {
  border-color:
    rgba(42, 33, 27, 0.2);

  background:
    radial-gradient(
      circle,
      var(--card) 0 28%,
      transparent 28.5%
    ),
    radial-gradient(
      circle,
      rgba(143, 67, 37, 0.07),
      transparent 68%
    );
}

body.cigar-hour .taste-wheel::after {
  border-color:
    rgba(42, 33, 27, 0.2);
}

body.cigar-hour .taste {
  background: var(--card);
}

body.cigar-hour .taste:hover,
body.cigar-hour .taste.active {
  background: var(--tobacco);

  border-color:
    var(--tobacco);

  color: #fff;
}


/* Archive cards */

body.cigar-hour .log-card {
  background:
    rgba(250, 247, 240, 0.68);

  border-color:
    rgba(42, 33, 27, 0.17);

  box-shadow:
    0 2px 8px rgba(70, 45, 30, 0.025);
}

body.cigar-hour .log-card:hover {
  transform: translateY(-2px);

  box-shadow:
    0 5px 18px rgba(70, 45, 30, 0.07);
}

body.cigar-hour .log-rating {
  color: var(--tobacco);
}


/* Images */

body.cigar-hour .log-image-placeholder,
body.cigar-hour .log-image {
  background: #cdbba4;
}


/* Save button */

body.cigar-hour .primary-button {
  background: #30251e;

  box-shadow:
    0 4px 12px rgba(48, 37, 30, 0.08);
}

body.cigar-hour .primary-button:hover {
  background: var(--tobacco);
}


/* Upload */

body.cigar-hour .upload-label {
  border-color:
    rgba(42, 33, 27, 0.2);
}

body.cigar-hour .upload-label:hover {
  border-color: var(--tobacco);
}


/* Footer */

body.cigar-hour footer {
  color: #75675b;

  border-color:
    rgba(42, 33, 27, 0.17);
}


/* Secret label */

body.cigar-hour::after {
  content: "CIGAR HOUR";

  position: fixed;

  right: 18px;
  bottom: 14px;

  color: var(--tobacco);

  font:
    10px "DM Mono",
    monospace;

  letter-spacing: 0.18em;

  opacity: 0.55;

  pointer-events: none;

  animation:
    quietFade 0.45s ease;
}


/* Very subtle smoke */

body.cigar-hour::before {
  content: "";

  position: fixed;

  width: 280px;
  height: 280px;

  right: -120px;
  top: 80px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(120, 95, 75, 0.045),
      transparent 68%
    );

  filter: blur(18px);

  pointer-events: none;

  animation:
    smokeDrift
    7s ease-in-out
    infinite alternate;
}

@keyframes smokeDrift {
  from {
    transform:
      translate(0, 0)
      scale(1);

    opacity: 0.35;
  }

  to {
    transform:
      translate(-45px, 30px)
      scale(1.18);

    opacity: 0.7;
  }
}

@keyframes quietFade {
  from {
    opacity: 0;

    transform:
      translateY(4px);
  }

  to {
    opacity: 0.55;

    transform:
      translateY(0);
  }
}


/* ---------------------------------
   MOBILE
   --------------------------------- */

@media (max-width: 760px) {

  .site-header {
    height: 70px;
  }

  nav > a:first-child {
    display: none;
  }

  .hero {
    display: block;

    padding:
      57px 0
      43px;
  }

  .hero > p {
    margin-top: 24px;
  }

  .stats article {
    padding: 21px 0;
  }

  .stats article + article {
    padding-left: 16px;
  }

  .stats strong {
    font-size: 27px;
  }

  .stats span {
    font-size: 8px;
  }

  .content-grid {
    grid-template-columns: 1fr;

    gap: 58px;

    padding-top: 48px;
  }

  .log-card {
    grid-template-columns:
      70px
      1fr
      auto;

    gap: 12px;
  }

  .log-image,
  .log-image-placeholder {
    width: 70px;
    height: 70px;
  }

  .form-row {
    gap: 10px;
  }

  footer {
    font-size: 8px;
  }

  .taste-wheel {
    width: 280px;
  }
}


/* ---------------------------------
   VERY SMALL PHONES
   --------------------------------- */

@media (max-width: 420px) {

  .hero h1 {
    font-size: 45px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stats article,
  .stats article + article {
    padding-left: 0;

    border-right: 0;
    border-bottom:
      1px solid var(--line);
  }

  .stats article:last-child {
    border-bottom: 0;
  }

  .log-card {
    grid-template-columns:
      60px
      1fr
      auto;
  }

  .log-image,
  .log-image-placeholder {
    width: 60px;
    height: 60px;
  }

  .taste-wheel {
    width: 260px;
  }

  .taste {
    width: 64px;
    height: 64px;
  }

  .taste-wheel::after {
    width: 74px;
    height: 74px;
  }
}