:root{
  --ink:#172033;
  --muted:#647085;
  --paper:#fffaf0;
  --surface:rgba(255,255,255,.88);
  --line:rgba(59,43,25,.14);
  --gold:#b7791f;
  --red:#9f2d2d;
  --green:#28685d;
  --blue:#1e4f86;
  --shadow:0 24px 70px rgba(28,24,18,.16);
}
*{box-sizing:border-box}
body{
  min-height:100vh;
  margin:0;
  color:var(--ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:
    radial-gradient(circle at 18% 12%,rgba(183,121,31,.22),transparent 28%),
    radial-gradient(circle at 78% 10%,rgba(40,104,93,.2),transparent 28%),
    linear-gradient(135deg,#2d2117 0,#634225 34%,#efe2c5 34%,#f8f1df 100%);
  background-size:120% 120%,120% 120%,100% 100%;
  animation:bgDrift 16s ease-in-out infinite alternate;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background-image:
    linear-gradient(90deg,rgba(59,43,25,.18) 1px,transparent 1px),
    linear-gradient(rgba(59,43,25,.12) 1px,transparent 1px);
  background-size:54px 54px;
  mask-image:linear-gradient(120deg,transparent 0,#000 16%,#000 82%,transparent 100%);
  animation:gridSlide 22s linear infinite;
}
a{color:inherit}
.wrap{
  position:relative;
  z-index:1;
  width:min(1120px,100%);
  margin:0 auto;
  padding:42px 20px 56px;
  animation:pageIn .7s ease both;
}
.hero{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);
  gap:28px;
  align-items:stretch;
  min-height:calc(100vh - 84px);
}
.hero-copy,.panel{
  background:var(--surface);
  border:1px solid rgba(255,255,255,.62);
  box-shadow:var(--shadow);
  backdrop-filter:blur(14px);
}
.hero-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:42px;
  border-radius:8px;
  animation:riseIn .75s .08s ease both;
}
.kicker{
  width:max-content;
  max-width:100%;
  margin:0 0 18px;
  padding:7px 10px;
  border:1px solid rgba(183,121,31,.32);
  border-radius:999px;
  color:#71430b;
  background:rgba(183,121,31,.1);
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  animation:softPulse 3.6s ease-in-out infinite;
}
h1{
  max-width:820px;
  margin:0 0 12px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(2.1rem,5vw,4.7rem);
  line-height:.96;
  font-weight:800;
  letter-spacing:0;
  animation:titleIn .8s .12s ease both;
}
.page-title{font-size:clamp(2rem,4vw,3.8rem)}
p{margin:0;color:var(--muted);line-height:1.65}
.lede{max-width:650px;font-size:1.06rem}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px}
.button,.ghost,.back-link{
  position:relative;
  overflow:hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:12px 18px;
  border-radius:6px;
  text-decoration:none;
  font-weight:800;
  transition:transform .22s ease,box-shadow .22s ease,background .22s ease;
}
.button::after,.ghost::after,.back-link::after{
  content:"";
  position:absolute;
  inset:-20% auto -20% -45%;
  width:34%;
  transform:skewX(-18deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);
  transition:left .55s ease;
}
.button:hover::after,.ghost:hover::after,.back-link:hover::after{left:115%}
.button{
  color:#fff;
  background:linear-gradient(135deg,#8f2c24,#c4862d);
  box-shadow:0 16px 32px rgba(143,44,36,.24);
}
.ghost,.back-link{
  color:#24344b;
  background:rgba(255,255,255,.72);
  border:1px solid var(--line);
}
.button:hover,.ghost:hover,.back-link:hover{transform:translateY(-2px);box-shadow:0 18px 32px rgba(28,24,18,.16)}
.hero-gallery{
  display:grid;
  grid-template-rows:1fr 1fr 1fr;
  gap:12px;
  animation:riseIn .75s .18s ease both;
}
.hero-frame,.portrait{
  position:relative;
  overflow:hidden;
  border-radius:8px;
  box-shadow:0 18px 44px rgba(17,24,39,.2);
  background:#2d2117;
}
.hero-frame img,.portrait img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  filter:saturate(.9) contrast(1.06);
  transform:scale(1.01);
  transition:transform .8s ease,filter .45s ease;
}
.hero-frame:hover img,.card:hover .portrait img{transform:scale(1.08);filter:saturate(1.04) contrast(1.1)}
.hero-frame::after,.portrait::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,transparent 28%,rgba(23,32,51,.72));
}
.hero-frame span{
  position:absolute;
  left:16px;
  bottom:14px;
  z-index:1;
  color:#fff8e8;
  font-family:Georgia,"Times New Roman",serif;
  font-size:1.35rem;
  font-weight:800;
  transform:translateY(0);
  transition:transform .35s ease;
}
.hero-frame:hover span{transform:translateY(-4px)}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin:12px 0 24px;
  animation:riseIn .7s ease both;
}
.section-head p{max-width:620px}
.grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}
.card{
  min-height:440px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:8px;
  color:inherit;
  text-decoration:none;
  background:var(--surface);
  border:1px solid rgba(255,255,255,.62);
  box-shadow:var(--shadow);
  animation:cardIn .7s ease both;
  transition:transform .25s ease,box-shadow .25s ease;
}
.card:nth-child(2){animation-delay:.08s}
.card:nth-child(3){animation-delay:.16s}
.card:hover{transform:translateY(-6px);box-shadow:0 30px 80px rgba(28,24,18,.22)}
.portrait{height:250px;border-radius:0;box-shadow:none}
.card-body{display:flex;flex:1;flex-direction:column;padding:22px}
.card h2{
  margin:0 0 8px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:1.55rem;
  line-height:1.1;
}
.card p{margin:0}
.tag{
  width:max-content;
  max-width:100%;
  margin-top:auto;
  padding-top:18px;
  color:#7c4b11;
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.chat-shell{
  margin-top:22px;
  overflow:hidden;
  border-radius:8px;
  background:#fff;
  border:1px solid rgba(255,255,255,.72);
  box-shadow:var(--shadow);
  animation:chatReveal .75s .12s ease both;
}
.chat-shell iframe{
  display:block;
  width:100%;
  min-height:680px;
  border:0;
}
.chat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-top:24px;
  animation:riseIn .7s ease both;
}
.voice-panel{
  display:grid;
  gap:14px;
  margin-top:22px;
  padding:20px;
  border:1px solid rgba(255,255,255,.62);
  border-radius:8px;
  background:rgba(255,250,240,.9);
  box-shadow:0 18px 45px rgba(28,24,18,.12);
  animation:riseIn .7s .08s ease both;
}
.talking-chat{
  min-height:680px;
  grid-template-rows:auto minmax(430px,1fr) auto;
  padding:22px;
  background:
    linear-gradient(180deg,rgba(255,250,240,.96),rgba(255,255,255,.9)),
    radial-gradient(circle at 16% 0,rgba(183,121,31,.18),transparent 34%);
}
.talking-chat-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding-bottom:14px;
  border-bottom:1px solid var(--line);
}
.voice-panel h2{
  margin:0 0 4px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:1.35rem;
  line-height:1.1;
}
.voice-panel p{font-size:.94rem}
.voice-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
.compact-actions{justify-content:flex-end}
.voice-ask{
  display:grid;
  gap:8px;
}
.native-composer{
  padding-top:14px;
  border-top:1px solid var(--line);
}
.voice-prompt-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
}
.voice-button{
  position:relative;
  overflow:hidden;
  min-height:42px;
  padding:10px 14px;
  border:0;
  border-radius:6px;
  color:#fff;
  background:linear-gradient(135deg,#8f2c24,#c4862d);
  box-shadow:0 12px 24px rgba(143,44,36,.18);
  font-weight:800;
  cursor:pointer;
  transition:transform .22s ease,box-shadow .22s ease;
}
.voice-button:hover{transform:translateY(-2px);box-shadow:0 16px 28px rgba(143,44,36,.24)}
.voice-button:disabled{
  cursor:wait;
  opacity:.62;
  transform:none;
}
.ghost-voice{
  color:#24344b;
  background:rgba(255,255,255,.78);
  border:1px solid var(--line);
  box-shadow:none;
}
.voice-label{
  color:#4b5563;
  font-size:.82rem;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.voice-panel textarea,
.voice-panel input{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:6px;
  color:var(--ink);
  background:rgba(255,255,255,.9);
  font:inherit;
  line-height:1.5;
}
.voice-panel input{
  min-height:42px;
}
.voice-panel textarea{
  resize:vertical;
  min-height:88px;
}
.voice-panel textarea:focus,
.voice-panel input:focus{
  outline:none;
  box-shadow:0 0 0 4px rgba(183,121,31,.18);
}
.voice-status{
  min-height:1.3em;
  color:#71430b;
  font-size:.92rem;
  font-weight:800;
}
.native-chat-log{
  display:flex;
  flex-direction:column;
  gap:13px;
  min-height:430px;
  max-height:58vh;
  overflow:auto;
  padding:18px;
  border:1px solid rgba(59,43,25,.12);
  border-radius:8px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.72),rgba(255,250,240,.68)),
    linear-gradient(90deg,rgba(183,121,31,.06) 1px,transparent 1px);
  background-size:auto,42px 42px;
  scroll-behavior:smooth;
}
.native-message{
  display:flex;
  animation:messageIn .28s ease both;
}
.native-message.user{justify-content:flex-end}
.native-message.assistant{justify-content:flex-start}
.message-bubble{
  max-width:min(76%,760px);
  padding:13px 15px;
  border-radius:8px;
  box-shadow:0 10px 24px rgba(28,24,18,.08);
}
.native-message.user .message-bubble{
  color:#fff;
  background:linear-gradient(135deg,#8f2c24,#b7791f);
}
.native-message.assistant .message-bubble{
  color:var(--ink);
  background:rgba(255,255,255,.95);
  border:1px solid rgba(59,43,25,.12);
}
.native-message.error .message-bubble{
  color:#7f1d1d;
  background:#fff1f2;
  border-color:rgba(159,45,45,.22);
}
.message-bubble p{
  margin:0;
  color:inherit;
  line-height:1.55;
  white-space:pre-wrap;
}
.native-message.loading .message-bubble p::after{
  content:"";
  display:inline-block;
  width:1.1em;
  text-align:left;
  animation:typingDots 1.1s steps(4,end) infinite;
}
.small{font-size:.95rem;color:var(--muted)}
.note{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid var(--line);
  font-size:.92rem;
}
.messages,.controls,input[type=text],button,.chat-area{font:inherit}
.messages{display:flex;flex-direction:column;gap:12px}
@keyframes bgDrift{
  from{background-position:0 0,100% 0,0 0}
  to{background-position:10% 6%,88% 10%,0 0}
}
@keyframes gridSlide{
  from{background-position:0 0,0 0}
  to{background-position:54px 54px,54px 54px}
}
@keyframes pageIn{
  from{opacity:0}
  to{opacity:1}
}
@keyframes riseIn{
  from{opacity:0;transform:translateY(18px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes titleIn{
  from{opacity:0;transform:translateY(14px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes cardIn{
  from{opacity:0;transform:translateY(24px) rotateX(5deg)}
  to{opacity:1;transform:translateY(0) rotateX(0)}
}
@keyframes chatReveal{
  from{opacity:0;transform:translateY(18px);clip-path:inset(0 0 18% 0)}
  to{opacity:1;transform:translateY(0);clip-path:inset(0)}
}
@keyframes softPulse{
  0%,100%{box-shadow:0 0 0 rgba(183,121,31,0)}
  50%{box-shadow:0 0 28px rgba(183,121,31,.18)}
}
@keyframes messageIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes typingDots{
  0%{content:""}
  25%{content:"."}
  50%{content:".."}
  75%,100%{content:"..."}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
  }
}
@media (max-width:900px){
  .hero{grid-template-columns:1fr;min-height:0}
  .hero-gallery{grid-template-columns:repeat(3,1fr);grid-template-rows:180px}
  .grid{grid-template-columns:1fr}
  .card{min-height:0}
  .portrait{height:280px}
}
@media (max-width:640px){
  .wrap{padding:22px 14px 34px}
  .hero-copy{padding:28px 22px}
  .hero-gallery{grid-template-columns:1fr;grid-template-rows:170px 170px 170px}
  .section-head,.chat-header,.talking-chat-top{align-items:stretch;flex-direction:column}
  .actions,.button,.ghost,.back-link,.voice-button{width:100%}
  .voice-actions{align-items:stretch;flex-direction:column}
  .voice-prompt-row{grid-template-columns:1fr}
  .talking-chat{min-height:620px;padding:16px}
  .native-chat-log{max-height:54vh;padding:12px}
  .message-bubble{max-width:92%}
  .chat-shell iframe{min-height:640px}
}
