/* The handheld storefront uses compact shopping controls and quieter editorial panels. */
@media (max-width: 767px), (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  .eser-reference-home {
    --mobile-gutter: clamp(16px, 4.5vw, 28px);
    --mobile-paper: #fcf9f3;
    --mobile-ink: #19372a;
    --mobile-line: #dedbcf;
  }

  /* A touch control for the five shopping actions. */
  .eser-reference-home .eser-benefits {
    --quick-accent: #dfedb4;
    --quick-turn: -32deg;
    padding: 17px var(--mobile-gutter) 7px;
    border: 0;
    background: var(--mobile-paper);
  }
  .eser-reference-home .eser-benefits[data-selected="1"] { --quick-accent: #c8e5d2; --quick-turn: 40deg; }
  .eser-reference-home .eser-benefits[data-selected="2"] { --quick-accent: #c9e5e9; --quick-turn: 112deg; }
  .eser-reference-home .eser-benefits[data-selected="3"] { --quick-accent: #f0d6b5; --quick-turn: 184deg; }
  .eser-reference-home .eser-benefits[data-selected="4"] { --quick-accent: #e0d5ed; --quick-turn: 256deg; }
  .eser-reference-home .eser-quick-console {
    max-width: 700px;
    margin-inline: auto;
    padding: 17px 14px 12px;
    overflow: hidden;
    border: 1px solid #4c6051;
    border-radius: 27px;
    background: radial-gradient(ellipse at 100% 0, #3b503c, transparent 65%), #1c332a;
    box-shadow: 0 8px 16px -14px #243c2a;
    color: #fffaf0;
  }
  .eser-reference-home [data-quick-enhanced] .eser-quick-stage[hidden] {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 96px;
    grid-template-rows: 24px minmax(112px, auto);
    gap: 5px 10px;
    padding: 0 4px 7px;
    touch-action: pan-y pinch-zoom;
  }
  .eser-reference-home .eser-quick-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #c1cdb8;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .02em;
    line-height: 1.3;
  }
  .eser-reference-home .eser-quick-label i { color: var(--quick-accent); font-size: 16px; }
  .eser-reference-home .eser-quick-counter {
    align-self: center;
    justify-self: end;
    padding-right: 3px;
    color: #94a78f;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
  }
  .eser-reference-home .eser-quick-counter b { color: var(--quick-accent); font-weight: 500; }
  .eser-reference-home .eser-quick-preview {
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 13px;
    min-height: 100px;
    min-width: 0;
    padding-block: 6px;
    color: #fffaf0;
    text-decoration: none;
  }
  .eser-reference-home .eser-quick-preview strong {
    display: block;
    max-width: 11ch;
    font-size: clamp(25px, 6.5vw, 34px);
    font-weight: 500;
    line-height: 1.09;
    letter-spacing: -.055em;
    text-wrap: balance;
  }
  .eser-reference-home .eser-quick-open {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d5dfc9;
    font-size: 12px;
    line-height: 1.3;
  }
  .eser-reference-home .eser-quick-open > i {
    display: grid;
    flex: 0 0 24px;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #24382a;
    background: var(--quick-accent);
    font-size: 16px;
  }
  .eser-reference-home .eser-quick-dial {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-self: center;
    gap: 6px;
    width: 96px;
    min-height: 110px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--quick-accent);
    cursor: pointer;
  }
  .eser-reference-home .eser-quick-wheel {
    position: relative;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border: 1px solid #819178;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, #8d9b80 0deg 1deg, transparent 1deg 12deg);
    box-shadow: 0 4px 12px #10231b80;
  }
  .eser-reference-home .eser-quick-wheel::before {
    position: absolute;
    content: '';
    inset: 8px;
    border: 1px solid #f9ffdf70;
    border-radius: 50%;
    background: linear-gradient(145deg, #fbffe5, var(--quick-accent) 52%, #adc59e);
    box-shadow: 0 2px 4px #12271980, inset 0 1px 0 #fff;
  }
  .eser-reference-home .eser-quick-wheel > i { position: relative; color: #29432c; font-size: 30px; }
  .eser-reference-home .eser-quick-needle {
    position: absolute;
    inset: 2px;
    transform: rotate(var(--quick-turn));
    transition: transform .32s cubic-bezier(.22,.7,.28,1);
  }
  .eser-reference-home .eser-quick-needle::before {
    position: absolute;
    top: -3px;
    left: calc(50% - 3px);
    content: '';
    width: 6px;
    height: 6px;
    border: 1px solid #fffde9;
    border-radius: 50%;
    background: var(--quick-accent);
  }
  .eser-reference-home .eser-quick-turn { display: inline-flex; align-items: center; gap: 1px; color: #d0dbc6; font-size: 10px; }
  .eser-reference-home .eser-quick-turn i { font-size: 14px; }
  .eser-reference-home .eser-quick-dial:active .eser-quick-wheel { transform: scale(.96); }
  .eser-reference-home .eser-benefits-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 3px;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 8px 0 0;
    border-top: 1px solid #53694e;
  }
  .eser-reference-home .eser-benefits-grid > div { display: flex; align-items: stretch; min-width: 0; min-height: 0; padding: 0; border: 0; }
  .eser-reference-home .eser-benefits-grid > div > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-width: 44px;
    min-height: 62px;
    padding: 7px 0 5px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: #d9e2d1;
    text-decoration: none;
    transition: background-color .2s, color .2s;
  }
  .eser-reference-home .eser-benefits-grid i { font-size: 22px; line-height: 1; color: inherit; }
  .eser-reference-home .eser-benefits-grid p { display: none; }
  .eser-reference-home .eser-quick-short[hidden] { display: block !important; font-size: 11px; line-height: 1.25; font-weight: 500; }
  .eser-reference-home .eser-benefits-grid a.is-selected {
    border-color: #f7ffe030;
    color: #233a29;
    background: var(--quick-accent);
    box-shadow: 0 2px 5px #11281b35;
  }
  .eser-reference-home .eser-benefits-grid a:active { transform: scale(.95); }
  .eser-reference-home .eser-benefits :is(a,button):focus-visible { outline: 2px solid #f3cd85; outline-offset: 2px; }
  @media (max-width: 359px) {
    .eser-reference-home .eser-quick-console { padding-inline: 10px; }
    .eser-reference-home [data-quick-enhanced] .eser-quick-stage[hidden] { grid-template-columns: minmax(0, 1fr) 78px; gap: 4px 6px; padding-inline: 4px; }
    .eser-reference-home .eser-quick-dial { width: 78px; }
    .eser-reference-home .eser-quick-wheel { width: 74px; height: 74px; }
    .eser-reference-home .eser-quick-wheel > i { font-size: 26px; }
    .eser-reference-home .eser-quick-short[hidden] { font-size: 10px; }
    .eser-reference-home .eser-quick-open { gap: 5px; font-size: 11px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .eser-reference-home .eser-quick-needle,
    .eser-reference-home .eser-benefits-grid > div > a { transition: none; }
  }
}

@media (max-width: 767px) {
  /* The side-scrolling collection shelf stays inside the full-width foliage layer. */
  .eser-reference-home .eser-reference-categories,
  .eser-reference-home .eser-reference-products,
  .eser-reference-home .eser-reference-about {
    width: calc(100% - var(--mobile-gutter) - var(--mobile-gutter));
    padding-inline: 0;
  }
  .eser-reference-home .eser-reference-categories {
    padding-block: 14px 40px;
  }
  .eser-reference-home #eser-category-title.visually-hidden {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 14px !important;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  .eser-reference-home #eser-category-title,
  .eser-reference-home .eser-products-heading h2,
  .eser-reference-home .eser-about-copy h2 {
    color: var(--mobile-ink);
    font: 400 clamp(32px, 8.3vw, 45px)/1.05 var(--eser-display);
    letter-spacing: -.035em;
  }
  .eser-reference-home .eser-category-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(146px, 45vw, 208px);
    align-items: stretch;
    gap: 10px;
    padding: 2px 2px 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #b5b8a6 transparent;
    overscroll-behavior-x: contain;
  }
  .eser-reference-home .eser-category-card {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    min-width: 0;
    background: #fffdf8;
    border: 1px solid var(--mobile-line);
    border-radius: 16px;
    scroll-snap-align: start;
  }
  .eser-reference-home .eser-category-card img {
    height: auto;
    aspect-ratio: 1.15;
    object-position: center 62%;
  }
  .eser-reference-home .eser-category-card::after {
    display: none;
  }
  .eser-reference-home .eser-category-card:nth-child(n) > .eser-category-card-copy {
    position: static;
    padding: 12px 12px 14px;
    color: var(--mobile-ink);
  }
  .eser-reference-home .eser-category-card > .eser-category-card-copy strong {
    font-size: clamp(21px, 5.1vw, 25px);
    line-height: 1.08;
  }
  .eser-reference-home .eser-category-card > .eser-category-card-copy small {
    margin-top: 5px;
    color: #596455;
    font-size: 12px;
    line-height: 1.4;
  }
  .eser-reference-home .eser-category-card > i {
    inset: 8px 8px auto auto;
    width: 25px;
    height: 25px;
    opacity: 1;
    transform: none;
  }

  /* An editorial cover, followed by a small journal entry and a craft entry. */
  .eser-reference-home .eser-reference-story {
    width: calc(100% - var(--mobile-gutter) - var(--mobile-gutter));
    min-height: 0;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    background: transparent;
  }
  .eser-reference-home .eser-reference-story::after {
    display: none;
  }
  .eser-reference-home .eser-story-photo {
    grid-column: 1 / -1;
    min-height: 0;
    border-radius: 22px 58px 22px 22px;
  }
  .eser-reference-home .eser-story-photo > img,
  .eser-reference-home .eser-story-middle > img {
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: 64% center;
  }
  .eser-reference-home .eser-story-photo::after {
    background: linear-gradient(0deg, #11281bed, #11281b87 59%, #11281b0a);
  }
  .eser-reference-home .eser-story-overlay {
    min-height: clamp(272px, 65vw, 340px);
    padding: clamp(20px, 5vw, 32px);
    justify-content: flex-end;
  }
  .eser-reference-home .eser-story-overlay h2,
  .eser-reference-home .eser-story-panel h2 {
    margin: 0 0 8px;
    color: #fffdf3;
  }
  .eser-reference-home .eser-story-overlay h2 {
    max-width: 12ch;
    font-size: clamp(35px, 9vw, 45px);
    line-height: .98;
  }
  .eser-reference-home .eser-story-overlay p,
  .eser-reference-home .eser-story-panel p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
  }
  .eser-reference-home .eser-story-overlay a,
  .eser-reference-home .eser-story-panel a {
    min-height: 44px;
    gap: 8px;
    border-radius: 12px;
    font-size: 12px;
  }
  .eser-reference-home .eser-story-middle,
  .eser-reference-home .eser-story-panel {
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: clamp(14px, 4vw, 22px);
    border-radius: 16px;
  }
  .eser-reference-home .eser-story-middle {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    text-align: left;
  }
  .eser-reference-home .eser-story-middle::after {
    background: linear-gradient(0deg, #10291bf5, #132b1c54);
  }
  .eser-reference-home .eser-story-middle-icon {
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    font-size: 21px;
  }
  .eser-reference-home .eser-story-middle-caption {
    font-size: 15px;
    line-height: 1.3;
  }
  .eser-reference-home .eser-story-panel {
    background: var(--mobile-ink);
  }
  .eser-reference-home .eser-story-panel-symbol {
    width: 31px;
    height: 31px;
    margin-bottom: 10px;
  }
  .eser-reference-home .eser-story-panel-symbol i { font-size: 19px; }
  .eser-reference-home .eser-story-panel h2 {
    font-size: clamp(25px, 6.6vw, 32px);
    line-height: 1.03;
  }
  .eser-reference-home .eser-story-panel p { font-size: 13px; }
  .eser-reference-home .eser-story-panel a {
    padding: 8px 0;
    margin-top: auto;
    color: #fbf7e9;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .eser-reference-home .eser-reference-products {
    padding-block: 34px;
    background: transparent;
  }
  .eser-reference-home .eser-products-heading {
    display: block;
    margin-bottom: 16px;
  }
  .eser-reference-home .eser-products-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 14px 0 0;
    overflow: visible;
  }
  .eser-reference-home .eser-products-controls button,
  .eser-reference-home .eser-products-controls a {
    justify-content: center;
    min-height: 44px;
    padding: 8px clamp(7px, 2vw, 14px);
    border-radius: 12px;
    color: var(--mobile-ink);
    background: #eeeee4;
    font-size: clamp(11px, 3vw, 14px);
    font-weight: 600;
  }
  .eser-reference-home .eser-products-controls button[aria-selected="true"] {
    color: white;
    background: var(--mobile-ink);
  }
  .eser-reference-home .eser-products-controls button::after { display: none; }
  .eser-reference-home .eser-products-controls a {
    margin-inline-start: auto;
    background: transparent;
  }
  .eser-reference-home .eser-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .eser-reference-home .eser-featured-card {
    border-color: var(--mobile-line);
    border-radius: 16px;
    background: #fffdf8;
  }
  .eser-reference-home .eser-featured-heart {
    width: 44px;
    height: 44px;
    inset: 3px 3px auto auto;
    background: transparent;
    font-size: 20px;
  }
  .eser-reference-home .eser-featured-heart i {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: #fffffff0;
  }
  .eser-reference-home .eser-featured-content {
    min-height: 0;
    padding: 12px 10px 10px;
  }
  .eser-reference-home .eser-featured-content h3 {
    min-height: 0;
    font-size: clamp(14px, 3.7vw, 17px);
    line-height: 1.35;
  }
  .eser-reference-home .eser-featured-category {
    color: #5a6356;
    font-size: 12px;
  }
  .eser-reference-home .eser-featured-add .addcart {
    min-height: 44px;
    border: 1px solid #d3dfd2;
    border-radius: 10px;
    background: #e7efe5;
    color: #193b25;
    font-size: 13px;
  }
  .eser-reference-home .eser-featured-add .cart_added {
    background: var(--mobile-ink);
    color: white;
  }

  /* Separate the ritual photograph and the reading surface on narrow screens. */
  .eser-reference-home .eser-ritual {
    min-height: 0;
    background: #ebe8d8;
  }
  .eser-reference-home .eser-ritual > img {
    position: static;
    display: block;
    height: auto;
    aspect-ratio: 2.03;
    object-position: center;
  }
  .eser-reference-home .eser-ritual::after { display: none; }
  .eser-reference-home .eser-ritual > .container-lg {
    display: block;
    min-height: 0;
    padding: 24px var(--mobile-gutter);
  }
  .eser-reference-home .eser-ritual-copy { max-width: none; }
  .eser-reference-home .eser-ritual h2 {
    max-width: none;
    margin: 0 0 10px;
    font-size: clamp(32px, 8.5vw, 45px);
    line-height: 1.05;
  }
  .eser-reference-home .eser-ritual p {
    max-width: 40ch;
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
  }
  .eser-reference-home .eser-ritual-quote { display: none; }
  .eser-reference-home .eser-reference-about {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 17px;
    padding-block: 32px;
  }
  .eser-reference-home .eser-about-image {
    height: auto;
    aspect-ratio: 1.9;
    border-radius: 18px;
  }
  .eser-reference-home .eser-about-copy h2 { margin: 0 0 10px; }
  .eser-reference-home .eser-about-copy p {
    margin: 0 0 15px;
    font-size: 15px;
  }
  .eser-reference-home .eser-about-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    gap: 7px;
    border: 0;
  }
  .eser-reference-home .eser-about-points > div {
    min-height: 51px;
    padding: 0 10px;
    gap: 7px;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    background: #fffdf8;
    font-size: 12px;
    line-height: 1.3;
  }
  .eser-reference-home .eser-about-points i { font-size: 19px; }
  .eser-reference-home .eser-about-points > div > a .eser-about-point-arrow {
    font-size: 13px;
  }
  .eser-reference-home .eser-reference-newsletter {
    min-height: 0;
    background: var(--mobile-ink);
  }
  .eser-reference-home .eser-reference-newsletter::after {
    background: linear-gradient(125deg, #0c2518e6, #173120af 50%, #0c2318ed);
  }
  .eser-reference-home .eser-reference-newsletter > .container-lg {
    width: 100%;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 30px var(--mobile-gutter);
    gap: 16px;
  }
  .eser-reference-home .eser-reference-newsletter h2 {
    color: #fffdf3;
    font-size: clamp(34px, 8.5vw, 46px);
    line-height: 1.05;
  }
  .eser-reference-home .eser-reference-newsletter p { font-size: 14px; }
  .eser-reference-home .eser-newsletter-form {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: none;
  }
  .eser-reference-home .eser-newsletter-entry {
    min-height: 54px;
    border-radius: 13px;
  }
  .eser-reference-home .eser-newsletter-entry input[type="email"] { font-size: 16px; }
  .eser-reference-home .eser-newsletter-entry button {
    min-width: 90px;
    min-height: 44px;
    border-radius: 10px;
    font-size: 13px;
  }
  .eser-reference-home .eser-newsletter-consent {
    padding-block: 5px;
    font-size: 12px;
    line-height: 1.45;
  }
  .eser-reference-home .eser-newsletter-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}

@media (min-width: 560px) and (max-width: 767px) {
  .eser-reference-home .eser-featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .eser-reference-home .eser-reference-about { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eser-reference-home .eser-about-points { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
