/* Interactive layer for the Rikkei Digital homepage (built from the Claude Design canvas) */
:root {
  --red: #B92329;
  --red-700: #8E171C;
  --red-50: #FFF0F1;
  --ink: #393939;
  --ink-2: #616161;
  --line: #EBEBEB;
  --paper: #FFFFFF;
  --shadow: 0 16px 40px rgba(46, 10, 12, 0.14);
  --header-h: 92px;
  color-scheme: light;
}
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); background: var(--paper); }
body { background: var(--paper); color: var(--ink-2); overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(185, 35, 41, 0.45); outline-offset: 2px; border-radius: 6px; }
button { font-family: inherit; }

/* Sticky header */
#site-header { transition: transform .25s ease; }
#site-header.is-fixed { position: fixed !important; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 50; padding-top: 12px !important; animation: hdr-in .28s ease; }
#site-header.is-fixed > div { box-shadow: 0 10px 30px rgba(46, 10, 12, 0.18) !important; }
@keyframes hdr-in { from { transform: translateY(-110%); } to { transform: none; } }

/* Nav dropdowns */
.nav-item { position: relative; display: flex; }
.nav-item > a svg { transition: transform .2s ease; }
.nav-item.is-open > a svg { transform: rotate(180deg); }
.nav-item > a[aria-expanded] { border-radius: 10px; }
#main-nav > a:hover, .nav-item > a:hover, .nav-item.is-open > a { color: var(--red) !important; background: var(--red-50); border-radius: 10px; }
.dd { position: absolute; top: calc(100% + 10px); left: 0; min-width: 300px; background: var(--paper); border: 1px solid #F0E3E5; border-radius: 16px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 60; }
.dd::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-item.is-open .dd { opacity: 1; visibility: visible; transform: none; }
.dd a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 20px; }
.dd a small { font-weight: 500; font-size: 12px; line-height: 18px; color: var(--ink-2); }
.dd a:hover, .dd a:focus-visible { background: var(--red-50); color: var(--red); }

/* Language menu */
.lang-wrap { position: relative; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid #F0E3E5; border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 150px; z-index: 60; }
.lang-menu button { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.lang-menu button:hover { background: var(--red-50); color: var(--red); }
.lang-menu button[aria-checked="true"]::after { content: "✓"; color: var(--red); }

/* Hamburger */
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); align-items: center; justify-content: center; cursor: pointer; margin-left: auto; }

/* Search highlight + toast */
.flash { animation: flash 1.8s ease; border-radius: 6px; }
@keyframes flash { 0%, 40% { background: #FFE08A; box-shadow: 0 0 0 6px #FFE08A; } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: #2E2E2E; color: #FFFFFF; padding: 12px 18px; border-radius: 12px; font-size: 14px; line-height: 20px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 80; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Cards: hover lift */
#solutions article, #industries > div > div:last-child > a, #cases article, #why > div > div:last-child > div, #awards [data-frame] { transition: transform .22s ease, box-shadow .22s ease; }
#solutions article:hover, #industries > div > div:last-child > a:hover, #cases article:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(57, 57, 57, 0.12) !important; }
#solutions article [data-frame] > img, #industries [data-frame] > img, #cases [data-frame] > img { transition: transform .5s ease; }
#solutions article:hover [data-frame] > img, #industries a:hover [data-frame] > img, #cases article:hover [data-frame] > img { transform: scale(1.05); }
#solutions article.is-target { box-shadow: 0 0 0 3px var(--red), 0 20px 44px rgba(57, 57, 57, 0.12) !important; }
#why > div > div:last-child > div:hover { transform: translateY(-4px); }
#hero a { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
#hero a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }

/* Journey stepper */
#journey-steps > li { cursor: pointer; }
#journey-steps > li > div:nth-child(2) { transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease; }
#journey-steps > li:not(.is-active) > div:nth-child(2) { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
#journey-steps > li.is-active > div:nth-child(2) { background: #FFFFFF !important; border-color: #F3D3D7 !important; box-shadow: 0 12px 32px rgba(142, 23, 28, 0.10) !important; }
#journey-steps > li:not(.is-active):hover > div:nth-child(2) { background: rgba(255, 255, 255, 0.6) !important; }
#journey-steps > li > div:nth-child(2) > span, #journey-steps > li h3 { transition: color .25s ease; }
#journey-steps > li:not(.is-active) > div:nth-child(2) > span, #journey-steps > li:not(.is-active) h3 { color: #2E2E2E !important; }
#journey-steps > li.is-active > div:nth-child(2) > span, #journey-steps > li.is-active h3 { color: var(--red) !important; }
#journey-steps > li > div:first-child > span:first-child { transition: width .25s ease, height .25s ease, box-shadow .25s ease; width: 10px !important; height: 10px !important; box-shadow: none !important; }
#journey-steps > li.is-active > div:first-child > span:first-child { width: 12px !important; height: 12px !important; box-shadow: 0 0 0 6px rgba(185, 35, 41, 0.18) !important; }

/* Carousel controls (dots + arrows) */
.car-dots { display: flex; gap: 6px; align-items: center; }
.car-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: #D5D5DB; cursor: pointer; transition: width .2s ease, background-color .2s ease; }
.car-dots button[aria-current="true"] { width: 16px; background: var(--red); }
.car-dots button::before { content: ""; display: block; margin: -18px -6px; height: 44px; }
.car-btn { transition: background-color .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease; }
.car-btn:hover:not(:disabled) { background: var(--red) !important; color: #FFFFFF !important; border-color: var(--red) !important; }
.car-btn:disabled { opacity: .35; cursor: default !important; }
.car-controls[hidden] { display: none !important; }
.car-track { scroll-behavior: smooth; scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }

/* Trusted logos marquee */
.marquee { overflow: hidden; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex !important; flex-wrap: nowrap !important; gap: 24px !important; width: max-content !important; justify-content: flex-start !important; animation: marquee var(--dur, 40s) linear infinite; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track > [data-frame], .marquee-track > img { flex: 0 0 140px !important; width: 140px !important; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Contact form */
.field-error { font-size: 12px; line-height: 16px; color: var(--red); min-height: 0; }
#contact-form input[aria-invalid="true"], #contact-form select[aria-invalid="true"] { border-color: var(--red) !important; background: var(--red-50) !important; }
#contact-form input:focus, #contact-form select:focus, #contact-form textarea:focus { outline: none; border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(185, 35, 41, 0.15); }
#contact-form button[type="submit"] { transition: background-color .2s ease, transform .2s ease; }
#contact-form button[type="submit"]:hover { background: var(--red-700) !important; }
#contact-form button[type="submit"]:disabled { opacity: .7; cursor: progress; }
.form-success { width: 100%; display: grid; justify-items: center; text-align: center; gap: 12px; padding: 32px 8px; }
.form-success .ok { width: 64px; height: 64px; border-radius: 50%; background: var(--red-50); color: var(--red); display: grid; place-items: center; }
.form-success h3 { margin: 0; font-size: 22px; line-height: 30px; color: var(--ink); }
.form-success p { margin: 0; color: var(--ink-2); max-width: 40ch; }
.form-success button { margin-top: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.copy-btn { border: 1px solid rgba(255, 255, 255, 0.5); background: transparent; color: inherit; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; margin-left: 8px; cursor: pointer; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* Back to top */
.to-top { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--red); color: #FFFFFF; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(185, 35, 41, 0.35); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease, background-color .2s ease; z-index: 40; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--red-700); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  #site-header > div > div:last-child > label { display: none !important; }
}
@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  #site-header > div { flex-wrap: wrap !important; gap: 12px !important; }
  #site-header > div > div:last-child { margin-left: 0 !important; }
  #main-nav { display: none !important; order: 10; width: 100%; flex-direction: column; align-items: stretch !important; gap: 2px !important; padding-top: 8px; border-top: 1px solid var(--line); }
  #main-nav.is-open { display: flex !important; }
  .nav-item { flex-direction: column; }
  .dd { position: static; box-shadow: none; border: 0; min-width: 0; padding: 0 0 4px 12px; display: none; opacity: 1; visibility: visible; transform: none; }
  .nav-item.is-open .dd { display: grid; }
  #main-nav.is-open ~ div .search-mobile { display: flex; }
  #industries > div > div:last-child > a { flex-basis: 300px !important; }
}
@media (max-width: 900px) {
  #cases article { flex: 0 0 82% !important; scroll-snap-align: start; }
  #cases article:hover, #solutions article:hover, #industries > div > div:last-child > a:hover { transform: none; }
}
@media (max-width: 760px) {
  section, footer { padding-left: max(20px, env(safe-area-inset-left, 0px)) !important; padding-right: max(20px, env(safe-area-inset-right, 0px)) !important; padding-top: 64px !important; padding-bottom: 64px !important; }
  #site-header { padding-left: max(12px, env(safe-area-inset-left, 0px)) !important; padding-right: max(12px, env(safe-area-inset-right, 0px)) !important; }
  #site-header > div { padding: 10px 12px !important; border-radius: 16px !important; }
  #site-header > div > div:last-child > a { padding: 10px 14px !important; }
  #hero { padding-top: 56px !important; padding-bottom: 96px !important; min-height: 0 !important; width: auto !important; margin-left: max(20px, env(safe-area-inset-left, 0px)) !important; margin-right: max(20px, env(safe-area-inset-right, 0px)) !important; }
  #hero h1 { font-size: 34px !important; line-height: 42px !important; }
  #hero p { font-size: 16px !important; line-height: 26px !important; }
  #hero-bg::after { background: linear-gradient(180deg, rgba(90, 6, 12, 0.7) 0%, rgba(90, 6, 12, 0.45) 60%, rgba(90, 6, 12, 0.2) 100%) !important; }
  section h2 { font-size: 28px !important; line-height: 36px !important; }
  section > div > div > p, section p[style*="font-size: 18px"] { font-size: 16px !important; line-height: 26px !important; }
  #why span[style*="font-size: 64px"] { font-size: 44px !important; line-height: 52px !important; }
  #why > div > div:nth-child(2) > div { border-left: 0 !important; }
  #trusted p { font-size: 20px !important; text-align: center !important; }
  #contact form { padding: 20px !important; }
  #solutions article, #why > div > div:last-child > div { flex-basis: 100% !important; }
  .car-dots button::before { margin: -18px -3px; }
}
@media (max-width: 420px) {
  #site-header > div > div:last-child > .lang-wrap { display: none; }
}
@media (max-width: 900px) {
  #cases-track { flex-wrap: nowrap !important; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 12px; }
}
.lang-menu[hidden], [hidden] { display: none !important; }

/* Shared additions for every page */
.is-filtered { display: none !important; }
.filter-empty { margin: 0; padding: 24px; border: 1px dashed #E2CFD2; border-radius: 16px; text-align: center; color: var(--ink-2); background: #FFFFFF; width: 100%; box-sizing: border-box; }
section[hidden] { display: none !important; }
[role="tablist"] > button, [role="tablist"] > a, [data-filter] > button, nav[aria-label="Phân trang"] a { transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease; cursor: pointer; }
[data-filter] > button:hover:not([aria-pressed="true"]), [data-status] > button:hover:not([aria-pressed="true"]) { border-color: var(--red) !important; color: var(--red) !important; }
[data-svc-tabs] > button:hover:not([aria-selected="true"]) { border-color: #F3D3D7 !important; box-shadow: 0 8px 20px rgba(142, 23, 28, 0.08); }
[data-svc-panel] { animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
[data-acc] > div { transition: background-color .2s ease, box-shadow .2s ease; }
[data-acc] > div > p { animation: fade-in .25s ease; }
.slider-track { flex-wrap: nowrap !important; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.slider-track > * { scroll-snap-align: start; }
article { transition: transform .22s ease, box-shadow .22s ease; }
section article:hover { transform: translateY(-4px); }
section article [data-frame] > img { transition: transform .5s ease; }
section article:hover [data-frame] > img { transform: scale(1.04); }
input[aria-invalid="true"] { border-color: var(--red) !important; background: var(--red-50) !important; }
section a[style*="background: #B92329"], section a[style*="border: 2px solid"], section button[style*="background: #B92329"] { transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
section a[style*="background: #B92329"]:hover, section button[style*="background: #B92329"]:hover { background: var(--red-700) !important; transform: translateY(-2px); }
section a[style*="border: 2px solid"]:hover { transform: translateY(-2px); }
@media (max-width: 760px) {
  [data-svc-tabs] > button { flex-basis: 45% !important; }
  [data-svc-tabs] > button span { white-space: normal !important; }
  [role="tabpanel"] { padding: 24px !important; }
  h1 { font-size: 34px !important; line-height: 42px !important; }
}
.dd a[aria-current="page"] { color: var(--red); background: var(--red-50); }
